Skip to content

fix(app): hide breadcrumb bar in Amicode webview (#326) - #233

Merged
jeonghun-jj-lee merged 1 commit into
local/amicodefrom
hide-breadcrumb-bar
Aug 22, 2026
Merged

jeonghun-jj-lee merged 1 commit into
local/amicodefrom
hide-breadcrumb-bar

Conversation

@jeonghun-jj-lee

@jeonghun-jj-lee jeonghun-jj-lee commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Gate the breadcrumb bar (project selector + workspace selector + git status) on !inAmicode() so it never renders inside the Amicode VS Code panel.

Sessions already scope to all workspace folders via the multi-directory engine (opencode#215), making the bar redundant chrome in the Amicode webview. The standalone web app still shows it.

Changes

  • new-session-view.tsx: import inAmicode, wrap the breadcrumb <Show> with !inAmicode() &&
  • new-session-view.test.ts: source-assertion test (same pattern as prompt-input-clipboard-structure.test.ts)

Testing

  • bun test src/pages/new-session/new-session-view.test.ts — 2/2 pass
  • bun typecheck — clean
  • Standalone web: bar still visible (inAmicode = false)
  • Amicode webview: bar hidden (inAmicode = true)

Closes amicode#326 (acceptance criterion: breadcrumb bar hidden).

Summary by CodeRabbit

  • Bug Fixes
    • Improved the new-session view for Amicode webview users by hiding the project breadcrumb when it is not applicable.
    • Preserved the existing project, workspace, and Git-status controls in other environments.

Gate the project selector + workspace selector + git status row on
!inAmicode() so it never renders inside the Amicode VS Code panel.
Sessions already scope to all workspace folders via the multi-directory
engine (opencode#215), making the bar redundant chrome.

Adds a source-assertion test following the established pattern
(prompt-input-clipboard-structure.test.ts).
@jeonghun-jj-lee
jeonghun-jj-lee merged commit 11a74dc into local/amicode Aug 22, 2026
1 of 2 checks passed
@coderabbitai

coderabbitai Bot commented Aug 22, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c9d0cd71-edf1-4507-9347-b59d51ea99b1

📥 Commits

Reviewing files that changed from the base of the PR and between dff0376 and 4a3c18a.

📒 Files selected for processing (2)
  • packages/app/src/pages/new-session/new-session-view.test.ts
  • packages/app/src/pages/new-session/new-session-view.tsx

📝 Walkthrough

Walkthrough

The new-session view now hides the project-selected breadcrumb bar in the Amicode webview. Bun tests verify the import and combined rendering condition.

Changes

New-session breadcrumb visibility

Layer / File(s) Summary
Guard breadcrumb rendering
packages/app/src/pages/new-session/new-session-view.tsx, packages/app/src/pages/new-session/new-session-view.test.ts
The view imports inAmicode() and renders the project, workspace, and Git breadcrumb bar only when Amicode is inactive and a project is selected. Tests verify the source structure.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: aarontrowbridge, brendonovich

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch hide-breadcrumb-bar

Comment @coderabbitai help to get the list of available commands.

jeonghun-jj-lee added a commit that referenced this pull request Sep 6, 2026
…faults

CM6's built-in default uses a 5-class child-combinator selector for
.cm-selectionBackground with hardcoded colors (#233 dark, #d7d4f0 light).
Our theme's lower-specificity descendant selector lost, making selections
invisible in dark mode. Use matching child-combinator depth so our
CSS variable (--v2-background-bg-layer-03) wins.

Part of #302
jeonghun-jj-lee added a commit that referenced this pull request Sep 6, 2026
…select-all) to Files Changed editor (#304)

* feat(session-ui): add CM6 history, keymap, and bracketMatching extensions

Add @codemirror/commands dependency and wire history(), defaultKeymap,
historyKeymap, and bracketMatching() into the diff editor.

- history() in editableExtensions (only when readOnly is false)
- keymap + bracketMatching in baseExtensions (shared by all panes)

Part of #302

* test(session-ui): verify external updates excluded from undo history

updateModified and updateOriginal use addToHistory.of(false), which the
new history() extension respects. These tests confirm the invariant.

Part of #302

* feat(session-ui): make revert undoable via isolateHistory (D7)

Use isolateHistory.of('full') on the revert dispatch so it always
creates its own undo group. Cmd+Z after revert now restores the
pre-revert edits. Updated docstrings to match.

Part of #302

* feat(app): delegate Z/Y/A to CM6 in global clipboard handler

Add CLIPBOARD_EDITOR_SELECTOR for data-amc-clipboard='codemirror'.
The global handler returns early (no preventDefault) for undo/redo/
select-all when the target is inside a CM6 editor, letting CM6's
own keymap handle them. Clipboard chords (C/X/V) still bridge.

Part of #302

* feat(app): use execCommand('delete') for CM6 cut targets

Inside a CM6 editor, cut deletion uses execCommand('delete') instead
of range.deleteContents() so CM6's mutation observer creates a proper
undo-tracked transaction. Non-CM6 contenteditable targets keep the
existing range.deleteContents() + dispatchInput('deleteByCut') path.

Part of #302

* feat(session-ui): mark diff editor container for CM6 clipboard delegation

Add data-amc-clipboard='codemirror' to the EditableDiffView container
div so global-clipboard.ts recognizes it and delegates Z/Y/A to CM6.

Part of #302

* fix(session-ui): boost selection highlight specificity to beat CM6 defaults

CM6's built-in default uses a 5-class child-combinator selector for
.cm-selectionBackground with hardcoded colors (#233 dark, #d7d4f0 light).
Our theme's lower-specificity descendant selector lost, making selections
invisible in dark mode. Use matching child-combinator depth so our
CSS variable (--v2-background-bg-layer-03) wins.

Part of #302

* feat(session-ui): stash __amcEditor bridge on container for clipboard handler

createDiffEditor attaches getSelectedText() and cutSelectedText() on
the parent element so the global clipboard handler can read from CM6's
document model without importing @codemirror packages. Cleaned up on
destroy().

Part of #302

* fix(app): read copy/cut from CM6 model bridge instead of DOM selection

When copying or cutting inside a CM6 editor, the global clipboard
handler now reads from the __amcEditor bridge (which uses
state.sliceDoc) instead of window.getSelection().toString(). This
fixes two bugs:
- Unified mode: DOM selection included deleted-line decoration widgets
- ReadOnly mode: DOM selection might not be synced by CM6

Part of #302

* docs: add manual test plan for CM6 editing shortcuts (#302)

* chore: remove test.md to rewrite via agent
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.

1 participant