Skip to content

feat: give the commit message a bordered box that grows while writing - #1

Merged
owlnai merged 1 commit into
feat/stage-all-promptfrom
feat/commit-box
Nov 11, 2026
Merged

owlnai merged 1 commit into
feat/stage-all-promptfrom
feat/commit-box

Conversation

@owlnai

@owlnai owlnai commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

Written by an AI agent on behalf of @owlnai. @owlnai has reviewed it.

This is the top layer of three and sits on the stage-all prompt layer. A long commit message, which Claude drafts often, was clamped to 8 rows showing only its tail. The subject scrolled out of view, and you couldn't scroll back to it. While unfocused, the message sat inline with no outline, so it didn't read as somewhere to click.

What changed

The commit message is now a bordered one-line box under the file list while unfocused, so it reads as a place to click. Its line shows the subject and +N lines. While writing, the box takes the file list's place and shows the staged count and the subject length on its border (yellow past 50, red past 72). ↑ ↓, PgUp/PgDn and the wheel scroll it, typing jumps back to the cursor, and a new draft opens at the top. Ctrl+E opens the message in $VISUAL/$EDITOR (falling back to vi).

Evidence

Same scratch repo (one modified file, one untracked, nothing staged), same 47-column Rex pane, same 11-line message typed in. "Before" is main, built in a separate worktree. The layers below don't change the box, apart from the hint text. These are real rex capture screens; blank rows are trimmed.

Writing a long message

Before: the subject is out of view and can't be scrolled back to.

 recent
 022f734 chore: init 24s
   The tokenizer now tracks which quote opened
   the value
   and only closes on the same one. Escaped
   quotes inside
   are kept as written.
   Adds tests for both quote styles and for
   escapes.▏
 ───────────────────────────────────────────────
 nothing staged · ⇧Enter new line · Tab draft

After:

 ⎇ main                            ○ unpublished
 demo2 → no upstream

 ╭ commit message ──────── nothing staged · 54 ╮
 │feat(parser): handle nested quotes in        │
 │attribute values                             │
 │                                             │
 │Quoted values that contained the other quote │
 │character                                    │
 │were cut at the first match, so attributes   │
 │like                                         │
 │title="it's fine" lost everything after the  │
 │apostrophe.                                  │
 │                                             │
 │The tokenizer now tracks which quote opened  │
 │the value                                    │
 │and only closes on the same one. Escaped     │
 │quotes inside                                │
 │are kept as written.                         │
 │                                             │
 │Adds tests for both quote styles and for     │
 │escapes.▏                                    │
 ╰─────────────────────────────────────────────╯
 ───────────────────────────────────────────────
 ⏎ commit · ⇧⏎ line · Tab draft · ^E editor

Unfocused

Before: the message stays inline as dimmed rows, with no outline.

 022f734 chore: init 26s
   The tokenizer now tracks which quote opened
   ...
   escapes.
 ───────────────────────────────────────────────

After:

 022f734 chore: init 83s
 ╭─────────────────────────────────────────────╮
 │feat(parser): handle nested quotes…  +7 lines│
 ╰─────────────────────────────────────────────╯
 ───────────────────────────────────────────────
 spc stage · ⏎ diff · c commit · Tab draft

Also checked:

  • Ctrl+E with a stand-in $EDITOR script replaced the message, and the resulting commit had the editor's subject and body.
  • The branch builds with no new warnings.

Not checked:

  • Mouse wheel scrolling and clicks, because rex send-key can't send mouse events.
  • The counter's colors, because captures are plain text.
  • Shift+Enter, because rex send-key didn't deliver it. I used Ctrl+J, which goes down the same path.
  • The remaining cargo clippy warnings were there before this branch. cargo fmt --check already failed on main because the repo uses wider lines, and I matched that style.

Details

  • The editor runs through sh -c '$EDITOR "$1"', so values with arguments like code -w work. The message goes through a temp file that is deleted afterwards. On a non-zero exit, the message is left unchanged and the exit status is shown.
  • Narrow panes drop the hints that don't fit, starting from the right. I shortened the commit-mode hints so that Tab draft and ^E editor fit in about 47 columns.

ELI5

The box where you write the note for a save is now outlined so it's easy to spot. While you type, it grows big enough to show long notes, you can scroll through them, and you can open them in your own editor.

The box stays one line under the file list, bordered so it reads as a place
to click. While writing, it takes the list's place, shows the subject's
length, scrolls with the arrows and wheel, and Ctrl+E opens $EDITOR.
@owlnai owlnai changed the title feat: commit box that grows, stage-all prompt, Tab-only drafting feat: give the commit message a bordered box that grows while writing Nov 11, 2026
@owlnai
owlnai changed the base branch from main to feat/stage-all-prompt November 11, 2026 04:48
@owlnai
owlnai added this pull request to stack #4 November 11, 2026 04:48
@owlnai
owlnai merged commit 8b496cd into main Nov 11, 2026
8 checks passed
@owlnai
owlnai deleted the feat/commit-box branch November 11, 2026 04:51
@owlnai owlnai mentioned this pull request Nov 11, 2026
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