feat: editor/ sample app — multi-buffer text editor (Stage 4 §3.2) - #189
Merged
Conversation
6 tasks
Closes another §3.2 sample-app gap. A focused multi-buffer editor
demonstrating widgets.MultiLineInput + widgets.SplitPane +
widgets.MenuBar in one place.
Layout:
- Menu bar (File / Edit) at the top.
- SplitPane.Direction.Horizontal: buffer list on the left, editor
on the right.
- StatusBar at the bottom showing buffer count, dirty state, and
the most recent action.
Buffers:
- One untitled buffer at startup.
- Ctrl+N adds a new untitled buffer.
- Ctrl+O opens a textInput dialog; Enter loads the path into a new
buffer; Esc cancels.
- Ctrl+S writes the current buffer to disk (refuses untitled —
surfaced in the status bar).
- Ctrl+W closes the active buffer; closing the only buffer leaves
a fresh untitled one.
- Ctrl+I (Ctrl-Tab on most terminals) switches to the next buffer.
Quit:
- Ctrl+Q / Ctrl+C exits when no buffers are dirty.
- With dirty buffers, surfaces a Dialogs.confirm overlay; Tab
flips Yes/No focus, Enter commits, Esc cancels.
Menu:
- F2 moves focus to the menu bar; arrows + Enter operate it via
MenuBar.handleKey; the picked (menuIdx, itemIdx) routes through
applyMenuPick to the same buffer ops as the keyboard shortcuts.
- Esc returns focus to the editor.
Tests: 15 specs in EditorAppSpec covering initial state, buffer
ops, dirty tracking, OpenPath dialog flow against a real temp dir
on disk, save round-trip, ConfirmQuit dialog, menu pick → New
buffer.
- sbt editorDemo command alias added
- docs/contrib/RUN_EXAMPLES.md updated
rorygraves
force-pushed
the
feat/editor-sample-app
branch
from
April 29, 2026 21:47
8941df1 to
873872b
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Closes another §3.2 sample-app gap. A focused multi-buffer editor that
exercises `widgets.MultiLineInput` + `widgets.SplitPane` +
`widgets.MenuBar` in one app.
Layout
Buffers
Quit
Menu
Tests
15 specs covering:
Test plan