feat(desktop): in-app spot editor for the file preview pane - #52772
Merged
Conversation
Adds a CodeMirror 6 spot editor to the right-rail file preview so users can make quick edits in-app without leaving for an IDE. Entering edit mode is a pure in-place swap of the read view — same fixed-height header, same gutter geometry/typography (mirrors SourceView 1:1) so nothing shifts — toggled via the Edit button, a bare `e` when the pane is hovered/focused, or the tab. - Save path is transport-agnostic (writeDesktopFileText): local Electron IPC or a new hardened POST /api/fs/write-text on the dashboard server (path validation, parent-must-exist, regular-files-only, size cap, atomic temp-file + os.replace), behind the existing auth middleware. - Stale-on-disk guard re-reads before writing and offers overwrite vs discard-and-reload instead of clobbering external/agent edits. - VS Code-style modified dot on the tab; ⌘/Ctrl+S and ⌘/Ctrl+Enter save, Esc cancels; GitHub highlight style matched to the read view's Shiki theme. - Typing stays render-free (draft in a ref; dirty flips once at the boundary).
Extends the pane store with heightOverride (alongside widthOverride) and a get/set/clear API, and wires the pane shell + desktop controller so the bottom-row terminal pane can be resized on the Y axis with its size persisted.
Contributor
🔎 Lint report:
|
Use the app's amber warn color for the unsaved-edits tab dot (was inheriting the label text color) and add a tab-bg ring + soft drop shadow so it stays legible where it overlaps the filename.
ethernet8023
approved these changes
Jun 26, 2026
1 task
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
feat(desktop): in-app spot editor for the file preview pane
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
feat(desktop): in-app spot editor for the file preview pane
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
feat(desktop): in-app spot editor for the file preview pane
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
feat(desktop): in-app spot editor for the file preview pane
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
feat(desktop): in-app spot editor for the file preview pane
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds basic, in-app code editing to the desktop app's right-rail file preview — a CodeMirror 6 spot editor, deliberately not an IDE. The design goal: entering edit mode is a pure in-place swap of the read view, so nothing about the file's layout, font, or position moves.
code-editor.tsx): line numbers, history, selection, bracket matching, GitHub syntax highlighting matched to the read view's Shiki theme (code-editor-theme.ts). No fold gutter / autocomplete / active-line chrome. Follows app light/dark live.SourceView1:1 (including beating CodeMirror's higher-specificity base CSS).Editbutton, a bareewhen the pane is hovered/focused (and nothing typable has focus), and the editor auto-focuses on entry.⌘/Ctrl+Sand⌘/Ctrl+Entersave;Esccancels.writeDesktopFileText): local Electron IPC, or a new hardenedPOST /api/fs/write-texton the dashboard server (path validation, parent-must-exist, regular-files-only, size cap, atomic temp-file +os.replace) — behind the existing auth middleware, so remote/dashboard mode works too.preview-edit.ts); typing stays render-free (draft in a ref,dirtyflips once at the boundary).Also included (separate commit): vertical resize for the bottom-row terminal pane — the pane store gains a
heightOverridealongsidewidthOverride, wired through the pane shell + desktop controller and persisted.Test plan
Edit/e/ enter edit; confirm zero layout shift vs the read view (font, gutter, line height, position).⌘S/⌘⏎/ button) writes to disk; tab dot appears while dirty, clears on save;Esc/Cancel discards.POST /api/fs/write-text; unauthorized requests rejected.