Skip to content

Agent: a startup failure window that says the failure plainly - #1594

Merged
AnthonyRonning merged 3 commits into
masterfrom
ux/startup-error-dialog
Nov 14, 2026
Merged

AnthonyRonning merged 3 commits into
masterfrom
ux/startup-error-dialog

Conversation

@matthewrball

@matthewrball matthewrball commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

Startup failures opened a bare text list — a small heading, the raw error, gray pill buttons, and a full-width Close bar. This gives the startup failure window the same language as the Quit prompt: the brand display headline, the failure as one plain passage, quiet evidence, and one accent recovery pill beside a quiet Close — and it now resolves the OS appearance and locale, registers Maple's bundled fonts, and grows once when a status adds a details pane.

Before and after

The same real failure in both captures: a second Maple start against a host this profile already owns (dark theme).

Before After
Dark startup_before_dark startup_after_dark

What changes

  • The quit prompt's language. The window (600 × 440; 640 × 520 for the guarded stop) keeps its construction but renders the display headline in Array at 40px, the failure as a 15px/24px passage, the log path and Copy-details/Show-log tools grouped with it as quiet evidence, and the recovery action as the one accent pill with a ghost Close beside it. With no recovery to offer, Close is the accent action.
  • The window follows the OS in both failure paths. The locale always came from the system (the failure windows never read saved settings, and that stays true — opening the store in a failure path would risk migrating a database that a locked or older host owns). The real defect was the palette: it is resolved only in the main window's render, so a system-light desktop got dark window content with a light titlebar. The failure window now resolves the OS appearance every frame, and both windows redraw when the OS appearance changes.
  • Bundled fonts are registered. The standalone path bypassed the main bootstrap, so the new display and body font pins would have silently fallen back to the platform font. Registration is now shared between both startup paths.
  • The window grows once for a status. A status that replaces the failure (a failed restart, a failed guarded stop) adds its own sentence and a details pane that the failure-only height cannot fit — the German two-line headline overflowed it by 27px. The window now grows to 480px the first time a status appears and never shrinks; the guarded 520px window already fits.
  • The wait sentence yields to a status. "Keep Maple open until its host has finished stopping" now shows only while no status has replaced the failure; every status carries its own keep-open instruction, so the failed-retry state no longer says it twice.
  • Deterministic geometry fixtures. MAPLE_DEBUG_STARTUP_ERROR=incompatible|guarded|restart, optionally suffixed with a locale (guarded-de), opens the failure window in states a live start cannot reach on demand — the guarded stop and the restart-failure status — with long fixture diagnostics.

Behaviour to be aware of

  • The details pane caps at 88px and scrolls; the original error is the only evidence of why startup failed, so it is preserved under "Details" whenever a status replaces it, and Copy details always includes it.
  • The guarded variant (macOS termination-integration failure) keeps Close unavailable until the host stop is proven; its retry pill dims while a stop is in flight.
  • The fixtures are debug tooling only: they replace the failure message when the variable is set, and never run in release flows.

Rebased review

  • Rebased onto master after Agent: show the remaining native dialogs in the quit prompt's design #1601 and Korean localization (Add Korean localization to Maple Work #1605). Existing catalog keys cover the startup window, including Korean; no new translation text was needed.
  • Fixed status sizing for an already-tall window: the first status consumes the one-shot sizing decision, so a later user shrink does not trigger unwanted growth. The regression test covers that sequence.
  • Full local just ci passed, including formatting, all Clippy feature sets, workspace tests, all-target builds and headless tests. Fresh CI on the rebased head also passed Linux tests/lint and Windows/macOS Clippy. No additional VM smoke was performed for this revision.

Verification

  • Full maple-agent-app suite passes (1446 passed in the main binary, 0 failed, 3 ignored); cargo fmt --check clean; no clippy diagnostics in the changed file. All startup/guarded state tests pass, plus a new unit test pinning the one-shot growth rule (fires only when a status exists, exactly once, preserving a user's width).
  • Live, on a debug build against a held host: the before/after captures above. Geometry measured by pixel scan in all three states × German, where the display headline wraps to two lines:
    • incompatible-host: fits 440px with a 29px bottom margin, and does not grow (no status);
    • guarded stop after a failed retry (status + details pane, the largest stack): fits 520px with a 29px margin;
    • restart-failure status: the window grows once to 480px and holds a 27px margin — before the fix this state clipped the action row to a 1px margin.
  • Review round (tri-model + clean-context reviewer): the fixture env is now compiled behind debug assertions, the palette resolves from the OS appearance every frame with appearance observers on both windows, the guarded path initializes the locale state, a long raw diagnostic scrolls within a 120px cap instead of pushing the actions out, the growth is a one-shot latch rather than a per-frame resize, the action row wraps, and a repeated stop attempt clears the stale failure status.
  • Not checked: Windows and Linux (the same renderer serves them; the Linux early-failure path now also gets the bundled fonts and OS-following appearance), and the light theme (the window resolves the OS appearance; captures are dark).

matthewrball and others added 3 commits November 13, 2026 15:07
The review round (tri-model advisors plus a clean-context reviewer)
confirmed the fixture could fire in release builds, the palette never
resolved outside the main window's render, and the guarded path never
initialized the locale; a long diagnostic could push the actions out,
the status growth re-checked its bounds every frame, and several states
kept stale or contradictory text.

- Gate the MAPLE_DEBUG_STARTUP_ERROR fixture behind debug assertions,
  matching the Quit prompt's debug loop.
- Resolve the OS appearance palette in StartupError::render and observe
  appearance changes in both failure windows.
- Initialize the locale in the guarded path; the standalone window falls
  back to the system locale, and the PR no longer claims otherwise.
- Cap the failure passage at 120px with a scroll so long diagnostics
  cannot clip the action row; wrap the action row.
- Replace the per-frame resize with a one-shot, width-preserving
  growth latch pinned by a unit test.
- Clear the previous failure status when a new stop attempt starts.
@AnthonyRonning
AnthonyRonning force-pushed the ux/startup-error-dialog branch from 3f81e38 to 099aa67 Compare November 13, 2026 23:24
@AnthonyRonning
AnthonyRonning enabled auto-merge (squash) November 13, 2026 23:31
@AnthonyRonning
AnthonyRonning merged commit b1ecb77 into master Nov 14, 2026
23 checks passed
@AnthonyRonning
AnthonyRonning deleted the ux/startup-error-dialog branch November 14, 2026 02:44
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.

2 participants