Repository navigation
feat(mecatui): migrate effort picker to a bounded modal surface - #2266
Conversation
Address #2170 alongside surface ownership tracked by #2237. Share bounded navigation translation with Memory and Sessions. Co-authored-by: Mecatl <[email protected]>
Implementation plan archive
Amendments: user documentation was trimmed to omit duplicated UI instructions; standing authoring guidance/site exclusions were extracted to #2267, which merged. The operator then requested a smaller content-sized Effort card measured from the entire list and fixed chrome, with stable dimensions during browsing. This is the reviewed design snapshot with approved scope/sizing amendments, including planning-time facts and intended verification. Actual completed gate/review results are reported in the PR description; plan text does not establish runtime behavior. No plan content was omitted or redacted. Effort bounded surface planSlug: 2170-effort-surface Proposal only; no implementation authority. New plan for one slice of #1742 and #2237, implementing #2170. No branch or PR exists for this slug at planning time. Keep this file ignored and uncommitted. Goal and decisionsMake Preserve F7 and Documentation amendmentThe user requested concise user docs: use tech-writer and omit instructions readers can infer or already see in UI hints/help. Keep non-obvious wheel/selection semantics and remove duplicated Effort navigation walkthroughs. The standing authoring contract migration to scoped Established seams
Proposed contractsShared navigation, not a shared controllerIntroduce a small UI-package helper for pure translation from Use it in Effort and replace the equivalent switches in Memory and the normal Sessions inventory. Preserve caller ordering: Close, tab/filter/action eligibility, compact/loading guards and focus policies remain local. Memory's pending-detail cancellation/generation logic still runs when navigation matches. Sessions' non-inventory paths remain untouched. Update the symbol-home guard if A similarly small UI wheel-to-line-move helper may be shared between Effort and Memory, since both already/now ignore nonvertical wheel directions; it only translates explicit wheel Up/Down. Do not change other wheel callers' semantics as collateral work. No mandatory broad call-site sweep or generic list/detail abstraction. Effort ownership and root intentAllocate the picker as a pointer-owned surface installed in On a usable Enter, emit the selected effort value through a narrow intent. Root constructs the existing The six item IDs are their tier labels; display text excludes cursor/current marker padding. Current status is Geometry and interactionParent owns card framing/centering and clamps outer width to the offered terminal width. The 128-cell limit is a ceiling, not a target: derive Effort's preferred outer width from all six complete row labels plus cursor/status gutter, title, captured hints, optional warning, and the actual frame. Do not measure just the visible rows. Keep outer width and height stable during keyboard/wheel browsing at a fixed offer, while adapting to terminal resize. This follows the general content-sizing guidance in docs/tui.md; it is not an Effort-only exception. Surface Render measures the offered content width/height each time, including wrapped title/warning/hints/legend, before allocating list rows. Fit every physical row to offered width. Reserve overflow via the existing list view with indicators; do not subtract indicators twice or hand-roll cursor windows. Standard row styles are spinner for selected and muted otherwise, via Honor At short but usable sizes, show a bounded subset including overflow and reveal the cursor on opening/navigation. Preserve manual wheel window position on ordinary renders; keyboard navigation re-reveals selection. On resize, follow existing bounded geometry/anchor behavior and ensure keyboard navigation reveals selection at the new offer. If full measured chrome plus a valid list row cannot fit, use the established unframed, width-clipped close-only compact fallback. On zero offer return no body/regions and invalidate usable geometry. At compact/zero geometry consume non-close keys/wheel without navigation or activation, especially Enter after a previously usable offer. Close remains available even when it cannot be displayed. Parent prepares Render before input, so resize-before-next-View cannot use stale geometry. Use configured Up/Down and page/top/end bindings; all other nonaction keys are swallowed. Vertical wheel scrolls only the list window, never selects/applies or scrolls the hidden conversation; horizontal wheel is inert. No click regions in this slice. Visible hints use captured key markings and only available actions, not hard-coded default chords. List selection may remain outside the manually wheeled window; Enter still applies that selected tier when the layout is usable, consistent with selection-versus-scroll separation. Observable acceptance
Implementation tasks
Verification and deliveryFocused commands (do not use an end-anchored test regex that silently excludes named subcases): go test ./cmd/mecatui/ui -run 'Test(Effort|MecatuiEffort|Surface|Modal|UserModel|MecatuiSessionsBoundedList)' -count=1
go test ./cmd/mecatui/ui/internal/bounded -count=1
go test ./cmd/mecatui/ui -count=1Include new helper/geometry tests explicitly if their names fall outside that regex. Use existing UI fakes; keep tests offline and explicit test-owned storage/config where composition is exercised. Keep Integrating agent owns one Run initial implementation panel-review against the implementation branch's recorded start commit captured when plan-implement creates the branch, not moving main. No future OID is invented here. Fixes get targeted incremental review against the last reviewed candidate; rebasing requires a separate explicit user request and reassessment of review scope. When PR creation is separately authorized, link #2170 and #2237 and report bounded progress to #1742 without closing the broader trackers. Preserve a full publishable plan in one identifiable PR conversation comment following plan-implement's archival procedure; verify identity/privacy/conflict/completeness/readback and record comment URL/ID in ignored run metadata, not in the copied plan. Before PR-ready handoff report whether it matches the latest plan. Planning creates no comment/PR and grants no push/merge/monitoring authority. Decisions, risks, and reviewNo unresolved user-facing decision at draft time: the user confirmed standard navigation and consistency/reuse. Shared helper extraction is bounded to genuinely equivalent mappings; private signatures/file names need no human decision. Keybinding overlap precedence, wrapped warning geometry, indicator reservation, and intent/close ordering are the main implementation risks; their production-seam tests are required above. Captured warning/current inputs deliberately do not refresh while the surface is open. Plan-review completed with a fresh-context read-only critic. One important geometry clarification was found and corrected: capacity-one overflow belongs in existing header space, not additional indicator rows. The same reviewer rechecked the amendment and found no remaining concrete correctness gaps. No unresolved blockers or human decisions remain. Reviewer used the supplied inline design because ignored scratch files were unavailable in its checkout; source boundaries were inspected, but implementation/tests were not run by the reviewer. Favorable document review is not runtime verification or permission to implement. |
Trim Effort navigation prose already explained by UI hints and retain only the non-obvious wheel selection behavior. Keep authoring rules in user-docs/_README.md, discoverable through the root agent instructions. Co-authored-by: Mecatl <[email protected]>
Keep the Effort user-documentation trimming here; move standing authoring instructions into a separate PR based on main. Co-authored-by: Mecatl <[email protected]>
Measure the effort picker using every tier and fixed chrome, keep its dimensions stable during browsing, and document card width limits as ceilings rather than target sizes. Co-authored-by: Mecatl <[email protected]>
Summary
/effortto the shared modalsurfacecontract, keeping fork-resume and session effects root-owned through a narrow selection intent.bounded.ListandpresentListRow, independent cursor/current markers, a content-sized card measured from the complete inventory and chrome, stable dimensions while browsing, resize selection reveal, and safe close-only/zero-size behavior.docs/tui.md: width limits are ceilings, not mandatory sizes.Standing authoring instructions and Docusaurus exclusions were extracted to #2267, which has merged. This PR contains no authoring-policy changes.
Closes #2170.
Advances #1742 (bounded browsing) and #2237 (surface ownership); neither parent tracker is complete. Click-to-select, other UI migrations, and #1485 are out of scope.
Verification
task testtask test:racetask linttask docsgo run ./cmd/mecademo— verified tool call, permission ask/approval, and final resultAggregate test gates passed with shorter system temporary paths after managed temporary paths exceeded Linux's Unix-socket pathname limit. Initial lint and review findings were corrected and rechecked, not waived.
The earlier documentation-only follow-up passed
task docs,task site:build, and a focused editorial review. The content-sized card refinement passed the aggregate gates above and an incremental four-axis review. After test-only assertion strengthening, the full UI/bounded suites, focused sizing race tests, and lint were rerun successfully; product code, contributor guidance, and golden were unchanged by that assertion follow-up.Implementation plan
Full reviewed implementation plan, archived in one conversation comment and verified against the latest local plan by readback and SHA-256. The plan remains ignored and uncommitted locally.