Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Dec 31, 2025

Summary

Merge upstream opencode v1.0.221 changes into the shuvcode integration branch, including desktop app improvements, model selector enhancements, and LSP workspace file watching support.

Changes

Features

  • Better model selector UI with improved layout and interaction
  • Desktop app auto-accept improvements with better visual affordance
  • LSP workspace/didChangeWatchedFiles support for file system monitoring
  • Keybind tooltip component for improved UX
  • Default to ai-sdk/openai-compatible when no npm package provided

Fixes

  • Auto-accept colors in app
  • Tooltip colors in desktop
  • Text selection behavior in app
  • Desktop notifications suppressed when auto-accepting
  • More defensive property access in desktop
  • Prompt input cleanup in desktop

Refactoring

  • Session context usage component improvements
  • Permission context restructuring
  • Global sync context updates
  • Tool args cleanup in app
  • Variant toggle improvements

Infrastructure

  • Upstream sync to v1.0.221
  • Changelog script improvements for tui section categorization
  • Zed extension configuration updates

Breaking Changes

None

Testing

Production builds tested locally:

  • CLI binary compiles and runs correctly (139 MB, version 0.0.0-shuvcode-dev-202512312226)
  • App UI builds and serves correctly (47 MB)
  • All browser tests pass (page loads, API connection works, PWA service worker registered)

Greptile Summary

This PR successfully merges upstream opencode v1.0.221 changes into the shuvcode fork, bringing significant desktop app improvements, UI enhancements, and LSP workspace file watching support.

Key Changes:

  • Desktop Stability: Added comprehensive error handling throughout the desktop app with .catch() blocks on all async operations, including storage operations that now fall back to in-memory storage when Tauri Store fails
  • Permission System Refactor: Migrated from prop-based to event-based permission handling using global SDK event listeners, improving reactivity and code organization
  • Model Selector UX: Introduced ModelSelectorPopover component for quick model selection without opening a full dialog, extracted reusable ModelList component
  • LSP Integration: Added workspace/didChangeWatchedFiles notification support for better file system monitoring in LSP servers
  • Keybind Tooltips: Created TooltipKeybind component for consistent display of keyboard shortcuts across the UI
  • Default Model Provider: Changed default npm package to @ai-sdk/openai-compatible when no provider package is specified
  • Auto-Accept UI: Added visual button for toggling auto-accept edits with proper keybind tooltip and success color indication

Testing Notes:

The PR description confirms production builds were tested locally with CLI binary, app UI, and browser tests all passing.

Confidence Score: 4/5

  • This PR is safe to merge with one minor formatting issue to fix
  • The changes are well-structured and improve error handling significantly. The permission system refactor is clean and event-driven. Only one minor indentation syntax error was found in prompt-input.tsx line 1498 that needs fixing. The defensive programming patterns added to the desktop app properly prevent crashes from Tauri API failures.
  • Only packages/app/src/components/prompt-input.tsx needs attention for the indentation fix on line 1498

Important Files Changed

Filename Overview
packages/app/src/components/prompt-input.tsx Improved UI with keybind tooltips, model selector popover, auto-accept button; has indentation issue on line 1498
packages/desktop/src/index.tsx Added defensive error handling with catch blocks and memory fallback for storage failures
packages/app/src/context/permission.tsx Refactored from prop-based to event-based permission handling with global SDK integration
packages/opencode/src/lsp/client.ts Added workspace/didChangeWatchedFiles notifications for file system monitoring support
packages/app/src/components/dialog-select-model.tsx Refactored to extract ModelList component and added ModelSelectorPopover for improved UX
packages/opencode/src/provider/provider.ts Changed default npm package from provider ID to @ai-sdk/openai-compatible when no package specified

Sequence Diagram

sequenceDiagram
    participant User
    participant App
    participant PermissionContext
    participant GlobalSDK
    participant LSPClient
    participant Desktop

    User->>App: Toggle auto-accept edits
    App->>PermissionContext: toggleAutoAccept(sessionID, directory)
    PermissionContext->>GlobalSDK: Listen to permission.updated events
    PermissionContext->>GlobalSDK: permission.list({directory})
    GlobalSDK-->>PermissionContext: Return pending permissions
    PermissionContext->>PermissionContext: Check shouldAutoAccept(perm)
    PermissionContext->>GlobalSDK: permission.respond({once})
    
    User->>App: Select model via popover
    App->>App: ModelSelectorPopover renders
    User->>App: Click model
    App->>App: local.model.set(modelID, providerID)
    App->>App: Close popover
    
    User->>App: Edit file in workspace
    App->>LSPClient: notify.open({path})
    LSPClient->>LSPClient: Check if file version exists
    LSPClient->>LSPClient: Send workspace/didChangeWatchedFiles
    LSPClient->>LSPClient: Send textDocument/didChange or didOpen
    
    Desktop->>Desktop: Initialize storage
    Desktop->>Desktop: Try Store.load(name)
    alt Store fails
        Desktop->>Desktop: Fallback to memory storage
    end
    Desktop-->>App: Return storage API with error handling
Loading

marceldev89 and others added 25 commits December 31, 2025 11:35
Co-authored-by: Aiden Cline <aidenpcline@gmail.com>
…er/model"

This reverts commit 9d32a0354f1db3ea4893f4ad00900c6420ab78c6.
Resolved conflicts:
- bun.lock: accepted upstream
- prompt-input.tsx: kept fork's larger mobile submit button (size-8 rounded-md)
- global-sync.tsx: kept fork's defensive Array.isArray() checks with upstream's filter chaining
- layout.tsx: adopted upstream's Mark logo link and TooltipKeybind component
- session.tsx: kept fork's version (no upstream Header component - we use inline header in layout.tsx)
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

44 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

icon={working() ? "stop" : "arrow-up"}
variant="primary"
class="size-8 rounded-md"
class="size-8 rounded-md"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

syntax: indentation is missing on this line

Suggested change
class="size-8 rounded-md"
class="size-8 rounded-md"

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/app/src/components/prompt-input.tsx
Line: 1498:1498

Comment:
**syntax:** indentation is missing on this line

```suggestion
                class="size-8 rounded-md"
```

<sub>Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!</sub>

How can I resolve this? If you propose a fix, please make it concise.

Apply Greptile suggestion to fix missing indentation on class attribute.
@shuv1337 shuv1337 merged commit 157eb6e into integration Dec 31, 2025
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.

7 participants