-
Notifications
You must be signed in to change notification settings - Fork 57
feat(desktop): add 3-color workspace status indicators #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e6acf0f
feat(desktop): add 3-color workspace status indicators
andreasasprou c6c9241
fix(desktop): use StatusIndicator in workspace sidebar instead of har…
andreasasprou 0cd3808
fix(desktop): use correct OpenCode event types for status indicators
andreasasprou 03fe2ce
fix(desktop): clear pane status on terminal exit to fix stuck indicators
andreasasprou a231505
fix(desktop): clear status on ESC/Ctrl+C to handle agent interrupts
andreasasprou 12a6b11
fix(desktop): use session.status event for OpenCode busy detection
andreasasprou 12688e0
chore(desktop): add debug logging to OpenCode plugin for idle detection
andreasasprou 43c908d
chore(desktop): add debug logging to trace OpenCode Stop notification…
andreasasprou d542032
feat(desktop): add debug logging utility with SUPERSET_DEBUG flag
andreasasprou f3f5dc9
fix(desktop): remove unused needsAttention variable
andreasasprou 0906d4c
fix(desktop): harden OpenCode plugin against race conditions (v8)
andreasasprou 8fe8b15
chore: remove thoughts/ directory from PR (internal artifacts)
andreasasprou 765edf1
fix(desktop): address PR review feedback
andreasasprou 6a815d8
chore: revert .gitignore change
andreasasprou 07189fc
fix(desktop): reset rootSessionID after Stop for new sessions
andreasasprou 0467bc3
chore: remove thoughts/ from PR again
andreasasprou 250ab5c
refactor(desktop): centralize status priority logic
andreasasprou 7c7a7b7
chore: fix import organization
andreasasprou c3e32f9
Use external file instead of inline content
Kitenite 20a05ed
Inject plugin marker
Kitenite 9a78b89
refactor and clean up comments
Kitenite 8c2a9a3
Move notify into its own file
Kitenite 4cd7df3
typecheck
Kitenite f133d5a
fix potential race condition
Kitenite File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -66,4 +66,4 @@ next-env.d.ts | |
| .env | ||
|
|
||
| # Reference material downloaded for agents | ||
| examples | ||
| examples | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,99 @@ | ||
| # External Files Written by Superset Desktop | ||
|
|
||
| This document lists all files written by the Superset desktop app outside of user projects. | ||
| Understanding these files is critical for maintaining dev/prod separation and avoiding conflicts. | ||
|
|
||
| ## Environment-Specific Directories | ||
|
|
||
| The app uses different home directories based on environment: | ||
| - **Development**: `~/.superset-dev/` | ||
| - **Production**: `~/.superset/` | ||
|
|
||
| This separation prevents dev and prod from interfering with each other. | ||
|
|
||
| ## Files in `~/.superset[-dev]/` | ||
|
|
||
| ### `bin/` - Agent Wrapper Scripts | ||
|
|
||
| | File | Purpose | | ||
| |------|---------| | ||
| | `claude` | Wrapper for Claude Code CLI that injects notification hooks | | ||
| | `codex` | Wrapper for Codex CLI that injects notification hooks | | ||
| | `opencode` | Wrapper for OpenCode CLI that sets `OPENCODE_CONFIG_DIR` | | ||
|
|
||
| These wrappers are added to `PATH` via shell integration, allowing them to intercept | ||
| agent commands and inject Superset-specific configuration. | ||
|
|
||
| ### `hooks/` - Notification Hook Scripts | ||
|
|
||
| | File | Purpose | | ||
| |------|---------| | ||
| | `notify.sh` | Shell script called by agents when they complete or need input | | ||
| | `claude-settings.json` | Claude Code settings file with hook configuration | | ||
| | `opencode/plugin/superset-notify.js` | OpenCode plugin for lifecycle events | | ||
|
|
||
| ### `zsh/` and `bash/` - Shell Integration | ||
|
|
||
| | File | Purpose | | ||
| |------|---------| | ||
| | `init.zsh` | Zsh initialization script (sources .zshrc, sets up PATH) | | ||
| | `init.bash` | Bash initialization script (sources .bashrc, sets up PATH) | | ||
|
|
||
| ## Global Files (AVOID ADDING NEW ONES) | ||
|
|
||
| **DO NOT write to global locations** like `~/.config/`, `~/Library/`, etc. | ||
| These cause dev/prod conflicts when both environments are running. | ||
|
|
||
| ### Known Issues with Global Files | ||
|
|
||
| Previously, the OpenCode plugin was written to `~/.config/opencode/plugin/superset-notify.js`. | ||
| This caused severe issues: | ||
| 1. Dev would overwrite prod's plugin with incompatible protocol | ||
| 2. Prod terminals would send events that dev's server couldn't handle | ||
| 3. Users received spam notifications for every agent message | ||
|
|
||
| **Solution**: The global plugin is no longer written. On startup, any stale global plugin | ||
| with our marker is deleted to prevent conflicts from older versions. | ||
|
|
||
| ## Shell RC File Modifications | ||
|
|
||
| The app modifies shell RC files to add the Superset bin directory to PATH: | ||
|
|
||
| | Shell | RC File | Modification | | ||
| |-------|---------|--------------| | ||
| | Zsh | `~/.zshrc` | Prepends `~/.superset[-dev]/bin` to PATH | | ||
| | Bash | `~/.bashrc` | Prepends `~/.superset[-dev]/bin` to PATH | | ||
|
|
||
| ## Terminal Environment Variables | ||
|
|
||
| Each terminal session receives these environment variables: | ||
|
|
||
| | Variable | Purpose | | ||
| |----------|---------| | ||
| | `SUPERSET_PANE_ID` | Unique identifier for the terminal pane | | ||
| | `SUPERSET_TAB_ID` | Identifier for the containing tab | | ||
| | `SUPERSET_WORKSPACE_ID` | Identifier for the workspace | | ||
| | `SUPERSET_WORKSPACE_NAME` | Human-readable workspace name | | ||
| | `SUPERSET_WORKSPACE_PATH` | Filesystem path to the workspace | | ||
| | `SUPERSET_ROOT_PATH` | Root path of the project | | ||
| | `SUPERSET_PORT` | Port for the notification server | | ||
| | `SUPERSET_ENV` | Environment (`development` or `production`) | | ||
| | `SUPERSET_HOOK_VERSION` | Hook protocol version for compatibility | | ||
|
|
||
| ## Adding New External Files | ||
|
|
||
| Before adding new files outside of `~/.superset[-dev]/`: | ||
|
|
||
| 1. **Consider if it's necessary** - Can you use the environment-specific directory instead? | ||
| 2. **Check for conflicts** - Will dev and prod overwrite each other? | ||
| 3. **Update this document** - Add the file to the appropriate section | ||
| 4. **Add cleanup logic** - If migrating from global to local, clean up the old location | ||
|
|
||
| ## Debugging Cross-Environment Issues | ||
|
|
||
| If you suspect dev/prod cross-talk: | ||
|
|
||
| 1. Check logs for "Environment mismatch" warnings | ||
| 2. Verify `SUPERSET_ENV` and `SUPERSET_PORT` are set correctly in terminal | ||
| 3. Delete stale global files: `rm -rf ~/.config/opencode/plugin/superset-notify.js` | ||
| 4. Restart both dev and prod apps to regenerate hooks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andreasasprou fyi i moved this into a js file and uses template replace instead. we get the benefit of linting and making the script more maintainable