Documentation

Docs / Reference

ADR 0050 - Per-browser editor choice for IDE links

Status: Accepted (delegated review, 2026-11-04)

Numbering: the task (T016k) asked for the next free number; 0048 (T018b1) and 0049 (T016h) are taken on other branches, so this is 0050.

Context

graphvein.yaml's ide setting (ADR 0044) chooses the editor of every IDE link, for the CLI and for graphvein serve. The editor is a personal choice, so a repository setting should only be the team default. T016k adds a per-browser editor picker to the web UI (developer decisions of 2026-11-04: sidebar placement, picker A, K3 A, K4 A, K5 A, logos for three editors).

A client-only picker cannot build correct links. The column depends on the preset's unit and base (UTF-16 and 1-based for VS Code, code points and 1-based for Zed, code points and 0-based for IntelliJ IDEA); converting needs the current line text and the file hash check, which only the server has (caller rows, gap sheets and Flow cards carry no line text). Rebuilding templates in TypeScript would duplicate encodePath, absURLPath and the placeholder filling, and a drift would produce a confident wrong link. Rewriting a link's scheme is wrong because the path form, the query syntax and the column differ.

The server also could not tell Graphvein's built-in default from a team choice: config.Load set IDE.Editor to vscode either way.

Options considered

  1. A request parameter editor=<preset> on the node-presenting endpoints (chosen). Links stay server-built from one code path; the client only names a preset.
  2. Links for every preset in every response: six times the link data, and every client must select the right one.
  3. Columns in every unit plus the absolute path, with templates filled in the client: duplicated encoding, the drift risk above.
  4. A server-side per-user setting (cookie or user config file): state on the server, the CLI question the developer left for later, and not per browser.
  5. Rewriting the scheme in the client: wrong links.

Decision

Consequences

Known gaps

Review fixes R2

Review correction (2026-11-04, T016k), second review.

Principle: a link claims exact: true only when every step of the column conversion is proven for that editor; otherwise it is line-only (when the preset has a line template) or exact: false with a caveat.

Review notes (2026-11-04)

Delegated review, 2026-11-04. Records: the T016k task records (internal).

Status: Accepted (delegated review, 2026-11-25)

Context. A first-time user's editor links opened VS Code (the built-in default) with no hint where to change it; the editor picker had moved from the sidebar into Settings; presets with caveats showed long notes inline; project-caller links carried a fixed editor status, so a browser choice could read as ignored.

Decision.

Consequences. Contract-visible additions only (short_note, ide_status; goldens ide-builtin and project-users, MCP omitted entries); no link is built in the browser (the server still builds every link; after a pick the view asks again with editor=). Without "Remember", the choice lasts until the page reloads.

Known gaps. The Changes head link never shows the chooser (the change endpoints take no editor=); at narrow widths the note popover can cover the row's name while open.

Review notes (delegated review, 2026-11-25)

Revision 1 accepted after the final CI gate of 2026-11-25 (CI runs 45627357238, 45632313364 and 45638139948 (the last green on Linux, Postgres and Windows; postgres log 0 FAIL, 291 /postgres PASS)): first-click chooser through one shared EditorLink (enforcing test, Jump-to included), short_note and status icons, ide_status per project link. Developer-requested; verified by tests and screenshots.

Report a problem with this pageSource: docs/adr/0050-per-browser-editor-choice.md