Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Jan 21, 2026

What does this PR do?

How did you verify your code works?

Greptile Summary

This PR implements a comprehensive settings system for the desktop application with persistent configuration, sound effects, custom keybinds, and improved state management. Major changes include:

  • Added new SettingsProvider context with persisted state for appearance (fonts, themes), notifications, sounds, and keybinds
  • Implemented settings dialog with tabs for general settings and keyboard shortcuts
  • Added sound effect playback for notifications (agent completion, permissions, errors)
  • Enhanced Select component with onHighlight callback for hover previews (e.g., theme/sound previews)
  • Improved global-sync with deduplication logic to prevent duplicate bootstrap/session loading requests
  • Added global config update mechanism with JSONC patching and automatic instance disposal
  • Fixed tool result handling to fallback to existing input when undefined
  • Added graceful error handling for missing file watcher native bindings
  • Implemented command catalog persistence and custom keybind support
  • Added e2e test for prompt submission flow
  • Major refactor of layout component with workspace management and inline editing

The changes introduce significant new functionality while maintaining backward compatibility. The code follows SolidJS patterns with proper use of stores and effects.

Confidence Score: 4/5

  • This PR is generally safe to merge with minor considerations
  • The PR implements substantial new features with good architectural patterns including deduplication, graceful error handling, and proper cleanup. However, the large scope (95 files, 4778 additions) increases risk. The code follows established patterns and includes test coverage. The main concerns are around the complexity of state synchronization during config reloads and potential race conditions, though the implementation includes safeguards like bootstrap queues and deduplication maps.
  • Pay close attention to packages/app/src/context/global-sync.tsx for the reload mechanism and packages/opencode/src/config/config.ts for the JSONC patching logic

Important Files Changed

Filename Overview
packages/app/src/context/global-sync.tsx Added reload mechanism with bootstrap queue and deduplication for session/instance loading to prevent duplicate requests
packages/app/src/context/settings.tsx New settings context providing persisted state for appearance, keybinds, notifications, and sounds
packages/app/src/pages/layout.tsx Major refactor adding workspace management, inline editing, persisted state, and settings integration
packages/opencode/src/config/config.ts Added global config update with JSONC patching and instance disposal trigger
packages/opencode/src/session/processor.ts Fixed tool result/error handling to fallback to existing input when new input is undefined
packages/ui/src/components/select.tsx Added onHighlight callback with cleanup, settings variant styling, and proper event handling for hover previews
packages/app/src/context/command.tsx Added command catalog persistence and custom keybind support with normalized key handling

Sequence Diagram

sequenceDiagram
    participant User
    participant Layout
    participant Settings
    participant GlobalSync
    participant Config
    participant Server
    participant Instance

    Note over User,Instance: Settings Update Flow
    User->>Layout: Open settings dialog
    Layout->>Settings: Render settings UI
    User->>Settings: Change config (theme/sound/keybind)
    Settings->>Settings: Update local persisted state
    
    Note over User,Instance: Global Config Update Flow
    User->>Settings: Update server config
    Settings->>GlobalSync: updateConfig(config)
    GlobalSync->>GlobalSync: Set reload = "pending"
    GlobalSync->>Config: updateGlobal(config)
    Config->>Config: Parse & patch JSONC
    Config->>Config: Validate with Zod schema
    Config->>Server: Write config file
    Config->>Instance: disposeAll()
    Config->>GlobalSync: Emit global.disposed event
    GlobalSync->>GlobalSync: Set reload = "complete"
    GlobalSync->>GlobalSync: Process bootstrap queue
    GlobalSync->>Instance: bootstrapInstance(directory)
    Instance-->>GlobalSync: Return new state
    
    Note over User,Instance: Session Loading with Deduplication
    User->>Layout: Navigate to project
    Layout->>GlobalSync: child(directory)
    GlobalSync->>GlobalSync: ensureChild(directory)
    GlobalSync->>GlobalSync: Check booting Map
    alt Not already bootstrapping
        GlobalSync->>Instance: bootstrapInstance(directory)
        GlobalSync->>GlobalSync: Store promise in booting Map
        Instance-->>GlobalSync: Complete bootstrap
        GlobalSync->>GlobalSync: Remove from booting Map
    else Already bootstrapping
        GlobalSync-->>Layout: Return pending promise
    end
    
    Note over User,Instance: Select Component Preview Flow
    User->>Settings: Hover over theme option
    Settings->>Select: onHighlight(theme)
    Select->>Select: Check if key changed
    Select->>Settings: Call theme.previewTheme(id)
    Settings->>Layout: Apply preview
    Select->>Select: Store cleanup function
    User->>Settings: Move to different option
    Select->>Select: Call cleanup()
    Settings->>Layout: Cancel preview
    Select->>Settings: Call new preview
    User->>Settings: Select option
    Select->>Select: Call stop() cleanup
    Select->>Settings: onSelect(option)
Loading

adamdotdevin and others added 30 commits January 20, 2026 07:33
…nomalyco#9597)

Co-authored-by: Aiden Cline <63023139+rekram1-node@users.noreply.github.com>
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
iamdavidhill and others added 29 commits January 20, 2026 20:34
Preserve fork features while updating e2e seeding and locators for the refreshed UI.
Start the opencode dev server with Start-Process on Windows so the health check and Playwright run can reach it.
Restore the resizable sidebar by accepting a width override in the sidebar component.
Use the app e2e-local script on Windows and skip the standalone server/health check steps.
Allow more time in CI and detect early server exits when waiting for the opencode server.
@shuv1337 shuv1337 merged commit 2412e8f into integration Jan 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.