Skip to content

Conversation

@shuv1337
Copy link
Collaborator

@shuv1337 shuv1337 commented Jan 20, 2026

Summary

  • Syncs upstream sst/opencode v1.1.27 into integration branch
  • Desktop: completely disable pinch-to-zoom to prevent accidental zooming
  • App: fix localStorage quota errors with improved persistence layer
  • App: fix message list overflow and scrolling issues (fix(app): message list overflow & scrolling anomalyco/opencode#9530)
  • UI: session hover popover styling and positioning updates
  • TUI: fix message history cleanup to prevent memory leaks
  • Batch tool: update definition to clarify max tool calls
  • Truncation: ensure handling applies to MCP servers

Key Changes

Area Description
packages/desktop/ New webview-zoom.ts disables pinch zoom
packages/app/src/utils/persist.ts Enhanced localStorage quota handling
packages/app/src/pages/session.tsx Message list overflow fixes
packages/ui/ Session popover and message styling
packages/opencode/src/cli/cmd/tui/ Memory leak fix in sync context

Testing

  • Built and type-checked locally
  • Upstream CI passed for v1.1.27

Breaking Changes

None

Greptile Summary

Merges upstream v1.1.27 with several critical fixes for desktop zoom behavior, localStorage quota handling, and memory management.

Key improvements:

  • Desktop zoom refactor: replaced mousewheel pinch-to-zoom blocker with keyboard-based zoom control (Ctrl/Cmd +/-/0)
  • LocalStorage resilience: added quota error handling with automatic eviction strategy and in-memory cache fallback when storage is exhausted
  • Memory leak fix: TUI message history now properly cleans up part store references when removing old messages (>100 limit)
  • UI polish: fixed message list overflow, improved auto-scroll behavior, added empty states for review tab
  • MCP truncation: ensured output truncation applies to MCP server tool results with proper metadata tracking

Changes verified:

  • Upstream sync properly merged from sst/opencode v1.1.27
  • Type-checked and built locally per PR description
  • All changes follow established patterns in the codebase

Confidence Score: 4/5

  • Safe to merge with one minor fix needed for zoom handler
  • Well-structured upstream sync with solid improvements to storage resilience and memory management. One logical issue found: webview zoom handler missing event.preventDefault() which could cause conflicting zoom behaviors. All other changes are well-tested improvements from upstream.
  • packages/desktop/src/webview-zoom.ts needs preventDefault() added to prevent default browser zoom

Important Files Changed

Filename Overview
packages/desktop/src/webview-zoom.ts New keyboard-based zoom control for desktop, replaces mousewheel pinch-to-zoom handler
packages/app/src/utils/persist.ts Enhanced localStorage persistence with quota handling, in-memory cache fallback, and eviction strategy
packages/app/src/pages/session.tsx Fixed message list overflow with max-width, improved auto-scroll, added empty state for review tab
packages/opencode/src/cli/cmd/tui/context/sync.tsx Fixed memory leak by properly cleaning up part store when removing old messages
packages/opencode/src/session/prompt.ts Applied truncation handling to MCP server outputs with metadata tracking

Sequence Diagram

sequenceDiagram
    participant User
    participant Desktop
    participant WebviewZoom
    participant LocalStorage
    participant PersistLayer
    participant Cache
    participant Session
    participant SyncContext

    User->>Desktop: Triggers zoom (Ctrl/Cmd + +/-)
    Desktop->>WebviewZoom: keydown event
    WebviewZoom->>WebviewZoom: Calculate new zoom level
    WebviewZoom->>Desktop: invoke set_webview_zoom

    User->>Session: Interacts with app
    Session->>PersistLayer: Save state
    PersistLayer->>Cache: Write to cache
    PersistLayer->>LocalStorage: Attempt write
    alt Quota exceeded
        LocalStorage-->>PersistLayer: QuotaExceededError
        PersistLayer->>LocalStorage: Evict oldest items
        PersistLayer->>LocalStorage: Retry write
    end
    alt Still exceeds quota
        LocalStorage-->>PersistLayer: Still fails
        PersistLayer->>PersistLayer: Disable localStorage, use cache only
    end

    User->>Session: Creates messages
    Session->>SyncContext: Store message parts
    SyncContext->>SyncContext: Check message count > 100
    alt Too many messages
        SyncContext->>SyncContext: Remove oldest message
        SyncContext->>SyncContext: Delete associated parts from store
    end

    User->>Desktop: Closes/hides window
    Desktop->>PersistLayer: Flush all storage
    PersistLayer->>LocalStorage: Write pending changes
Loading

adamdotdevin and others added 30 commits January 19, 2026 16:13
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.

39 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +15 to +31
window.addEventListener("keydown", (event) => {
if (OS_NAME === "macos" ? event.metaKey : event.ctrlKey) {
if (event.key === "-") {
zoomLevel -= 0.2
} else if (event.key === "=" || event.key === "+") {
zoomLevel += 0.2
} else if (event.key === "0") {
zoomLevel = 1
} else {
return
}
zoomLevel = Math.min(Math.max(zoomLevel, MIN_ZOOM_LEVEL), MAX_ZOOM_LEVEL)
invoke("plugin:webview|set_webview_zoom", {
value: zoomLevel,
})
}
})
Copy link

Choose a reason for hiding this comment

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

logic: missing event.preventDefault() after line 25 to prevent default browser zoom behavior from conflicting with the custom webview zoom

Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/desktop/src/webview-zoom.ts
Line: 15:31

Comment:
**logic:** missing `event.preventDefault()` after line 25 to prevent default browser zoom behavior from conflicting with the custom webview zoom

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

@blacksmith-sh
Copy link

blacksmith-sh bot commented Jan 20, 2026

Found 9 test failures on Blacksmith runners:

Failures

Test View Logs
e2e/context.spec.ts/context panel can be opened from the prompt View Logs
e2e/file-open.spec.ts/can open a file tab from the search palette View Logs
e2e/home.spec.ts/home renders and shows core entrypoints View Logs
e2e/home.spec.ts/server picker dialog opens from home View Logs
e2e/navigation.spec.ts/project route redirects to /session View Logs
e2e/palette.spec.ts/search palette opens and closes View Logs
e2e/session.spec.ts/can open an existing session and type into the prompt View Logs
e2e/sidebar.spec.ts/sidebar can be collapsed and expanded View Logs
e2e/terminal.spec.ts/terminal panel can be toggled View Logs

Fix in Cursor

@shuv1337 shuv1337 merged commit 6aac6d1 into integration Jan 20, 2026
3 of 4 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.