You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -249,7 +249,7 @@ Append new entry points under the matching sub-heading. Keep entries to one line
249
249
-**Editor view** — `packages/ui/src/features/editor/`. A real, editable **CodeMirror 6** editor on nav screen `editor`. `PidEditorView` composes the tab strip (`PidEditorTabBar`), styled breadcrumb (`PidEditorBreadcrumb`), and the `CodeMirrorEditor` host. Files open from a single-click in the file tree (`PidFileTree`'s `onSelectionChange` → `useEditorStore.openFile` + `setScreen("editor")`).
250
250
-**State** — `useEditorStore.ts`: open tabs + active id + per-tab content/baseline/eol/dirty/cursor/readOnly/indent. Loads via `fs.readFile` + `git.fileBaseline`; saves via `fs.writeFile` (Ctrl/Cmd+S). The store holds tab metadata only — CodeMirror `EditorState`s are cached per tab inside `CodeMirrorEditor` so switching tabs preserves undo history, selection, and scroll.
251
251
-**Theme + highlighting** — `editorTheme.ts` maps CodeMirror chrome + a `HighlightStyle` (lezer tags) onto theme tokens, so syntax colours track the active pi-deck theme (the `dark` flag is reconfigured via a compartment on light/dark flips). Languages by extension in `languages.ts` (also the tab type-badge).
252
-
-**Diff gutter** — `diffExtension.ts` paints live add/mod/del line tints against the git HEAD baseline using `@codemirror/merge`'s `Chunk` diff primitive (no inline-original merge UI). Recomputes as you type; `null` baseline (untracked / no repo) shows no tints.
252
+
-**Diff gutter** — `diffExtension.ts` paints live add/mod/del line tints against the git HEAD baseline using `@codemirror/merge`'s `Chunk` diff primitive (no inline-original merge UI). Recomputes as you type; `null` baseline (untracked / no repo) shows no tints. Hovering a block's gutter thickens its bar; *clicking* the gutter opens a pinned floating toolbar (`PidDiffBlockToolbar`) — prev/next change, revert-block (undoable buffer edit via `revertDiffChunk`), open-in-Diff — dismissed on outside-click / Escape / scroll / edit / tab switch. Inline per-block commit is deferred — it needs hunk-level git staging.
253
253
-**Status bar** — `PidEditorStatus.tsx`, rendered in `PidFooter` only on the `editor` screen: cursor Ln/Col + selection, indentation, UTF-8, LF/CRLF, language.
// Prev/next: navigate to the neighbour block and re-anchor the pinned toolbar to it.
345
+
constreanchor=(view: EditorView,index: number)=>{
346
+
openIdxRef.current=index;
347
+
activeIdxRef.current=index;
348
+
requestAnimationFrame(()=>{
349
+
constinfo=diffChunkInfo(view,index);
350
+
if(info)setOpenChunk(info);
351
+
elsecloseToolbar();
352
+
});
353
+
};
240
354
241
355
return(
242
-
<divclassName="pid-editor-cm-wrap">
356
+
// biome-ignore lint/a11y/noStaticElementInteractions: pointer-only affordance (gutter click opens the toolbar, hover thickens the bar); the same actions live in the dedicated Diff view.
357
+
// biome-ignore lint/a11y/useKeyWithClickEvents: the click is event-delegation for the non-focusable gutter; the toolbar's actions are also reachable in the keyboard-accessible Diff view.
0 commit comments