Skip to content

Fix goal mode layout overflow and active-step rendering - #315

Merged
TheGreatAxios merged 3 commits into
mainfrom
cl-5343-fix-goal-mode-layout-overflow-and-active-step-rendering
Aug 5, 2026
Merged

Fix goal mode layout overflow and active-step rendering#315
TheGreatAxios merged 3 commits into
mainfrom
cl-5343-fix-goal-mode-layout-overflow-and-active-step-rendering

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • Constrain GoalView / TaskView to terminal width so long briefs and Work step titles truncate instead of colliding with chrome or neighboring lines
  • Collapse phase trail to the current phase on narrow terminals; clear the one-shot Goal set. banner once goal UI is live
  • Keep Work progress as a single non-overprinting heading (Work 3/11) so labels no longer merge into active step text

Acceptance (CL-5343)

  • Goal brief wraps/truncates within available width without overlapping Work checklist or footer
  • Active Work step clearly indicated and fully readable (no Work03/11 character collision)
  • Long step titles truncate predictably without garbling glyph/prefix
  • Goal set. disappears after goal UI is shown
  • Phase indicator remains readable on narrow terminals

Test plan

  • bun run typecheck
  • bun run build
  • bun test tests/unit/tui/goal-view.test.tsx tests/unit/tui/task-view.test.tsx src/tui/commands/goal.test.ts (21 pass)
  • Manual: /goal with a long brief; confirm Work list stays scannable while a step is active

Closes CL-5343

Constrain GoalView and TaskView to terminal width so long briefs and
Work step titles truncate instead of colliding with chrome. Collapse
the phase trail on narrow terminals, clear the "Goal set." banner once
goal UI is live, and keep Work progress as a single non-overprinting
heading.

Closes CL-5343
@linear-code

linear-code Bot commented Aug 5, 2026

Copy link
Copy Markdown

CL-5343

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Code review (parent — multi-agent fleet unavailable)

Verdict: approve with watch items (goal-mode layout)

Strengths

  • Dedicated goal-view + tests address overflow, active step, and Goal set dismiss path.
  • Scoped to goal/task presentation rather than broad TUI rewrite.

Watch

  • Goal plan/impl/review chrome on very narrow terminals — re-check after merge with CL-5341 reflow patterns if shared chrome is reused.
  • “Goal set” dismiss: confirm it clears when leaving goal mode and does not reappear on scroll-only updates.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Review — approve

Solid layout fix for CL-5343. Width constraints + single-node Work heading address the collision classes cleanly, and the unit tests pin the regressions that matter (Work 3/11, glyph/title separation, narrow brief).

Correctness

  • Banner → exact "Goal set." + clear once Goal chrome is live is right; multi-line banner was blowing the 1-row commandMessagePresent budget.
  • HeaderRow / CriterionRow / TaskRow flex shrink pattern is the right Ink approach for truncate-end under pressure.
  • Small intentional polish: cancelled Work rows now dim+strikethrough (aligned with acceptance criteria). Fine if deliberate.

Non-blocking notes

  • PhaseTrail narrow collapse uses useTerminalSize().columns, not the GoalView container width. In a split pane on a wide terminal the full trail may still render inside a narrow column. Acceptable for v1; worth knowing if split Goal chrome is common.
  • One-frame flash of Goal set. before the effect clears is expected.

Tests — good coverage of the failure modes. Manual long-brief check still open in the PR body.

Merge conflicts — clean vs main; no overlap with #316/#317.

Verdict: approve (merge when ready)

The first-line clamp dropped /goal status, pause/resume, and already-active
guidance. Render every line and reserve chrome rows to match.
@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Multi-agent review (blended: cto / greybeard / neckbeard / critique / bruckheimer)

Verdict: Approve (after post-review fix)

Fixed from review

  • Restored multi-line commandMessage rendering (first-line clamp had dropped /goal status, pause/resume, and already-active guidance).
  • Chrome budget now reserves commandMessageRows equal to actual line count.

Remaining non-blocking notes

  • goalChromeRowCount still uses a 40-col wrap estimate; fine for now.
  • "Goal set." still briefly flashes before clear-on-active effect — acceptable.

Ready for human review/merge.

@TheGreatAxios

Copy link
Copy Markdown
Collaborator Author

Hard review (greybeard + CTO)

Verdict: APPROVE

Greybeard

Chrome accounting now matches multi-line command banners; Goal chrome is width-constrained with truncate; active criterion is explicit; “Goal set.” is one-shot and clears when GoalView is live. This fixes the real overflow stack (banner + brief + Work) instead of painting over it.

CTO

Scope is right-sized for the bug. Tests cover banner text and goal-view behavior. Merge independently of the rest of the ship set.

No blockers.

Rules of Hooks: the hook must run on every render even when
status is inactive or cleared, so a later active mount keeps
stable hook order.
@TheGreatAxios
TheGreatAxios merged commit 9cd7a1a into main Aug 5, 2026
1 check passed
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