[codex] Stabilize local workspace comments#344
Conversation
There was a problem hiding this comment.
Review mode: initial
Findings
-
[Minor] Missing changeset for user-visible i18n changes. The PR renames button labels from "Send to Claude" to "Add to chat" and "Comment" to "Save comment", and adds new i18n keys (
sendToChat,addedToChat). These are user-facing changes that require a changeset per project convention. Runpnpm changeset, selectpatchfor@open-codesign/i18nand@open-codesign/desktop, and describe the changes. This ensures the changelog and release notes are accurate.
Suggested fix:pnpm changeset
Then commit the generated
.mdfile. -
[Nit] The
findReusablePendingCommentForSelectorandfindReusableWorkspaceFileCommentForSelectorfunctions iterate over thecommentsarray from the end for each element selection. If a design accumulates hundreds of comments, this could become a minor performance bottleneck. Consider storing a map fromsnapshotId+selectorto comment index for O(1) lookups if this becomes noticeable. Not a blocker.
Summary
No blockers, security issues, or data-loss risks found. The PR correctly separates comment saving from sending, adds a queued-comment model, reuses existing pending comments per selector, handles cancellation robustly, and treats missing workspace watcher paths as recoverable without spurious error toasts. Test coverage is excellent across main-process, renderer, and runtime overlay layers. The only actionable issue is the missing changeset.
Testing
- Not run (automation). The PR adds extensive unit tests for store, helpers, and overlay behavior. CI should pass.
Open-CoDesign Bot
Summary
This PR stabilizes comment mode for local workspace previews and fixes a few related local-workspace edge cases found during manual testing.
What changed
Files / App.jsxpreview.Why
Local workspace comment mode had a few state mismatches between the preview iframe, saved comment rows, and the renderer store. These could leave the UI in stale states: saved comments not appearing in the bubble, duplicated comments on the same selection, deleted comments leaving an orphaned bubble, and saved comments opening without the target element highlighted.
Validation