Undo confirmation dialog: too narrow and language polish #13

Closed
opened 2026-05-28 14:45:09 +01:00 by oliversturm · 1 comment
oliversturm commented 2026-05-28 14:45:09 +01:00 (Migrated from github.com)

Two related improvements to the undo confirmation dialog.

1. Width

The dialog wraps its first line of text even on wide terminals while occupying roughly a quarter of the terminal width (centered). The min-width / preferred-width should grow to accommodate at least the snapshot summary line on a single row; reasonable bounds for outlier terminals are fine, but the current bounds are too tight for even a short insert statement.

2. Language polish

  • Capitalize Snapshot at the start of the summary line.
  • Locale-format the timestamp instead of the current raw form.
  • Capitalize the button labels: Yes / No.
  • Reconsider Esc cancel placed above Yes / No:
    • Why is it on a separate row above the buttons? Visually noisy.
    • Either put it inline with the buttons (e.g. [Y]es [N]o [Esc] cancel), or omit it entirely — Esc to cancel is conventional enough that explicit hinting may not be needed.
Two related improvements to the undo confirmation dialog. ### 1. Width The dialog wraps its first line of text even on wide terminals while occupying roughly a quarter of the terminal width (centered). The min-width / preferred-width should grow to accommodate at least the snapshot summary line on a single row; reasonable bounds for outlier terminals are fine, but the current bounds are too tight for even a short insert statement. ### 2. Language polish - **Capitalize** `Snapshot` at the start of the summary line. - **Locale-format** the timestamp instead of the current raw form. - **Capitalize** the button labels: `Yes` / `No`. - **Reconsider** `Esc cancel` placed above `Yes` / `No`: - Why is it on a separate row above the buttons? Visually noisy. - Either put it inline with the buttons (e.g. `[Y]es [N]o [Esc] cancel`), or omit it entirely — `Esc` to cancel is conventional enough that explicit hinting may not be needed.
oliversturm commented 2026-05-29 23:15:47 +01:00 (Migrated from github.com)

Fixed in 5ea69db.

Both improvements addressed:

1. Width. The dialog capped at 60 columns and wrapped even a short insert on wide terminals. It now grows to fit its longest content line on a single row, bounded 34–100 columns and never exceeding the available area (undo_dialog_width, unit-tested incl. tiny-terminal edge cases).

2. Language polish.

  • Snapshot capitalised at the start of the summary line.
  • Timestamp now rendered in the machine's local timezone, human-formatted (e.g. 24 May 2026, 11:00) instead of the raw ISO-8601 …T…Z form — via a new chrono dependency (stable, clock feature only; English month names, no unstable-locales).
  • Button labels capitalised: Yes / No (also applies to the rebuild-confirm dialog for consistency).
  • Esc cancel: on investigation this was already inline with the buttons ([Y] Yes [N] No Esc cancel), not on a separate row — that sub-item had been resolved in an earlier session, so no change was needed.

Covered by helper unit tests (format_local_datetime, format_snapshot_timestamp incl. garbage fallback, undo_dialog_width) and render-level tests asserting the command no longer wraps and the labels/timestamp are correct. requirements.md U2 updated.

Fixed in 5ea69db. Both improvements addressed: **1. Width.** The dialog capped at 60 columns and wrapped even a short insert on wide terminals. It now grows to fit its longest content line on a single row, bounded 34–100 columns and never exceeding the available area (`undo_dialog_width`, unit-tested incl. tiny-terminal edge cases). **2. Language polish.** - `Snapshot` capitalised at the start of the summary line. - Timestamp now rendered in the machine's **local timezone**, human-formatted (e.g. `24 May 2026, 11:00`) instead of the raw ISO-8601 `…T…Z` form — via a new `chrono` dependency (stable, `clock` feature only; English month names, no unstable-locales). - Button labels capitalised: `Yes` / `No` (also applies to the rebuild-confirm dialog for consistency). - `Esc cancel`: on investigation this was **already inline** with the buttons (`[Y] Yes [N] No Esc cancel`), not on a separate row — that sub-item had been resolved in an earlier session, so no change was needed. Covered by helper unit tests (`format_local_datetime`, `format_snapshot_timestamp` incl. garbage fallback, `undo_dialog_width`) and render-level tests asserting the command no longer wraps and the labels/timestamp are correct. requirements.md U2 updated.
Sign in to join this conversation.