Skip to content

refactor(tui): drop dead notice field, dedupe helpers - #1405

Merged
TheGreatAxios merged 1 commit into
mainfrom
cl-10529-tui-xs
Oct 12, 2026
Merged

TheGreatAxios merged 1 commit into
mainfrom
cl-10529-tui-xs

Conversation

@TheGreatAxios

Copy link
Copy Markdown
Collaborator

Summary

  • NoticeState drops its dead interrupt field: the shell writes it, composeNoticeLine never reads it
  • The byte-identical oneLine()/abbreviate() collapse helpers share one implementation
  • gapRows computes once in a shared MarkdownSplit builder used by both split paths
  • The redundant agentName !== undefined null check is gone — first derives from agentName?.[0]
  • The nested ternaries in the at-mention path lister become small if-blocks

Verification

  • bun test over the co-located suites (notice-line, copy-path, tool-formatter, tool-formatter-web-brand, markdown-parser, at-mention/list): 177 pass, 0 fail
  • bun run typecheck passes; oxfmt --check and oxlint pass on the seven changed files
  • Item 1: interrupt is unread — grep finds no state.interrupt read in composeNoticeLine or anywhere in src/tui; the field and the shell/chrome.ts assignment are removed
  • Item 2: oneLine(text, max=56) and abbreviate(value, max) are identical (replace(/\s+/g," ").trim(), then slice(0, max-1) + "…" when over max); both call sites share the same max-1 ellipsis; copy-path now calls abbreviate(payload.text, 56)
  • Item 3: splitAtSettledHeading and splitAtSettledBlock both derive firstContent from rest.findIndex((line) => line.trim().length > 0); both now build through settledSplit
  • Item 4: first = agentName?.[0], so first != null already implies a non-empty agentName; the extra agentName !== undefined check is redundant and removed (branch text unchanged)
  • Item 5: nested ternaries at list.ts:42-43 and 59-68 are replaced with behavior-identical if-blocks

Fixes CL-10529

@linear-code

linear-code Bot commented Oct 12, 2026

Copy link
Copy Markdown

CL-10529

@corbits-triage

Copy link
Copy Markdown
Contributor

No changes needed from you. A maintainer will review this pull request.

@TheGreatAxios
TheGreatAxios merged commit 40e19ce into main Oct 12, 2026
13 checks passed
@TheGreatAxios
TheGreatAxios deleted the cl-10529-tui-xs branch October 12, 2026 05:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant