fix: restore V2 composer translation callback - #929
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe prompt input now forwards placeholder translation requests to ChangesPrompt placeholder update
Priority: ⬇️ Low Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to V2 composer placeholders again use the active language service for translations, with matching bundle metadata. No merge-blocking risk is identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Full details: Description checkExplanation The description states the change and verification performed, but it does not include the required Related Issue, Description, Type of Change, Verification checkboxes, and Manual Testing Notes sections. Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…) (#1028) * feat(#1026): Slice 1 — VS Code theme extraction + bridge Add syntax_theme_bridge.ts: resolves the active VS Code color theme to either a Shiki built-in name (fast path, ~30 popular themes) or a full TextMate theme object extracted from the contributing extension's filesystem. Handles include chains (max depth 5, cycle detection) and merges editor.tokenColorCustomizations user overrides. Wire into ChatPanel: postSyntaxTheme() fires on theme change, on workbench.colorTheme change, and on tokenColorCustomizations change. Add 'syntax-theme' to both Lane 2 relay allowlists so the message reaches the framed app. 8 tests covering: built-in matching, custom extraction, include chains, cycle detection, user override merging, and fallback behavior. * chore: sync overlay to opencode a9c4bc736a (Shiki syntax highlighting, #1026) Overlay promotion from opencode fork branch with Slices 2-5: - shiki-theme-state.ts: reactive theme state for the webview - shiki-highlight-worker.ts: dedicated Shiki tokenization Web Worker - shiki-highlight-plugin.ts: CM6 ViewPlugin with Shiki decorations - editor-core.ts: wired Shiki extension + language-data fallback - preview-editor.tsx + editable-diff-view: pass lang to baseExtensions - markdown-shiki.worker.ts: theme-update support - pierre/worker.ts: active theme for @pierre/diffs pools - app.tsx: syntax-theme message handler Plus opencode fork upstream changes included in the full promotion. * fix(#1026): correct Shiki decoration bugs + sync overlay Three bugs fixed in the fork: 1. Empty fallback theme: worker init now uses the actual OpenCodeTheme (30+ TextMate scope rules) instead of an empty stub 2. Worker URL: uses Vite ?worker&url import pattern matching existing markdown-shiki and @pierre/diffs workers 3. Test compat: extracted pure decoration logic to shiki-highlight- decorations.ts; editor-core.ts lazy-imports the plugin module New integration test verifies Shiki produces colored tokens + valid CM6 decorations for Julia, TypeScript, Python, Rust, Go, YAML, and Shell (16 tests, all green). * chore: clean overlay sync from correct upstream base (afc0f1c26a vs 6fa55b660a) Previous incremental syncs used intermediate fork commits as the base, causing new Shiki files to be missing from the overlay. Redo as a full fork-vs-upstream-base delta to get all 18 files correctly. Fixes: shiki-highlight-plugin.ts, shiki-highlight-worker.ts, shiki-highlight-decorations.ts, shiki-theme-state.ts and tests now present in the overlay. The binary was already built from the correct fork commit (afc0f1c26a) — this fixes only the overlay tracking copy. * fix(#1026): deliver VS Code syntax theme after iframe boot The extension previously posted syntax-theme only after a later VS Code theme/configuration change. A newly opened Preview tab therefore stayed on the OpenCode fallback palette forever. Post the resolved syntax theme on the existing app-ready handshake, when the iframe listener is guaranteed to exist. Restore live refreshes for colorTheme and tokenColorCustomizations changes, and admit the message through both Lane 2 relay render paths. Add regression coverage proving a fresh panel receives dark-plus after app-ready and both relays contain syntax-theme. * chore: restore overlay from main — sync deferred to post-fork-merge The overlay sync in earlier commits wiped amicode-side patches (#929, #832, #987, OAuth bridge, titlebar interactions) because the fork's local/amicode branch doesn't carry them yet. Restore the full overlay from main; the proper sync happens after the fork PR merges into local/amicode. * chore: restore app-bundle manifest from main The sync:apply rewrote the manifest to point at the Shiki feature branch (afc0f1c26a) instead of local/amicode. Restore main's manifest so the drift gate passes against local/amicode as-is. * chore: remove leftover Shiki overlay files — overlay now matches main exactly
Summary: restore the translator callback required by the V2 composer placeholder helper and refresh the overlay manifest. Verification: materialized app build and upstream placeholder contract test.
Summary by CodeRabbit
Bug Fixes
Chores