Skip to content

fix(tui): omit desktop-only release highlights - #61455

Open
HaiYangBG1 wants to merge 4 commits into
anomalyco:devfrom
HaiYangBG1:tui-highlights
Open

HaiYangBG1 wants to merge 4 commits into
anomalyco:devfrom
HaiYangBG1:tui-highlights

Conversation

@HaiYangBG1

@HaiYangBG1 HaiYangBG1 commented Nov 3, 2026 •

Copy link
Copy Markdown

Issue for this PR

Fixes #61237

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The TUI's v2.2.5 highlights advertise desktop-only worktree, shell-mode and quote shortcuts. Its build currently embeds every highlight, including those whose source PRs appear only under Desktop.

Use the existing detailed release sections to exclude a highlight from the TUI only when all its extracted OpenCode PR/issue references are Desktop-only. Shared, unclassified and unlinked items stay. Filtering happens before the five-item limit. parse(notes) still returns the full list; embed() uses parse(notes, "tui"). The release-review preview in script/release.ts uses the same TUI audience so its printed list matches the build.

With the actual v2.2.5 notes, the TUI keeps Percentage Compaction Buffer and drops the two desktop-only entries. No shortcut, dialog layout or published release is changed. Missing or misclassified release details can still leave unsuitable entries visible.

How did you verify your code works?

macOS ARM64, Bun 1.4.4, frozen install, base 5c4983d5e2e2:

  • All four new regressions fail with the original parser: 5 pass / 4 fail. Restoring the fix: 9 pass / 0 fail (the full Script package suite).
  • The parser file repeated ten times with randomized order: 90 pass / 0 fail.
  • Existing TUI highlights state/dialog suites: 5 pass / 0 fail, covering update claiming, scrolling and closing.
  • Rendered the real DialogHighlights component with the actual release data at 100 and 56 columns, before/after filtering; Enter closed all four dialogs.
  • bun run check: lint has no errors (existing warnings remain), 35/35 typecheck tasks passed. git diff --check passed.

Focused commands:

cd packages/script
bun test test/highlights.test.ts
cd ../tui
bun test --timeout 30000 test/highlights.test.ts test/component/dialog-highlights.test.tsx

After the review identified the release-preview call site, I updated it and reran the Script suite (9/9 passed) and the normal pre-push check (35/35 typecheck tasks passed, cached). The release-triggering command itself was not executed.

Not verified: a complete stable Bun/Node release build, full CLI interaction in a real PTY, Linux/Windows, upstream CI, or the entire repository's test suites. The full Core suite was not rerun for this build-parser change.

Integration with #61275: that open PR adds history(), which calls parse(section). When combining the changes, use parse(section, "tui") there so each historical release is filtered before its item limit and the release-history limit. Leaving the default call would reintroduce the desktop entries. I inspected its current source at f3faae353bd5; the combined branch has not been built or tested. This PR does not implement its history navigation.

Visual

<svg xmlns="http://www.w3.org/2000/svg" width="240" height="72" viewBox="0 0 240 72" fill="none">
  <style>@keyframes keep{0%,100%{opacity:1}50%{opacity:.4}}.keep{animation:keep 2.5s ease-in-out infinite}@media(prefers-reduced-motion:reduce){.keep{animation:none}}</style>
  <g stroke="currentColor" stroke-width="2">
    <rect x="8" y="8" width="84" height="56" rx="5"/>
    <path d="M20 22h58M20 36h58" opacity=".3"/><path d="M20 50h58"/>
    <path d="M104 36h28m-7-7 7 7-7 7"/>
    <g class="keep"><rect x="144" y="19" width="88" height="34" rx="5"/><path d="M156 36h62"/></g>
  </g>
</svg>

Screenshots / recordings

The comparison uses the real component's OpenTUI test-renderer output (captureSpans()), exported to PNG with its captured text, colors and positions. These are component fixture renders, not screenshots of a released CLI or a real terminal window.

Before — 100 columns After — 100 columns
Before: component fixture at 100 columns After: component fixture at 100 columns
56-column comparison
Before After
Before: component fixture at 56 columns After: component fixture at 56 columns

Checklist

  • I have tested my changes locally within the scope above.
  • I have not included unrelated changes in this PR.

Added by the opencode bot (AI-generated).

Related: #56432

Upstream sync on 2026-11-05

Head 4c35bd6517c47b2ebec4d5c19fa4a15f93e7187a merges dev at 8a12d6b4207a2bef758a20fa922a189fe9dea78d and preserves the PR's existing behavior. The Script suite passed 9 tests and the TUI highlights suites passed 5 tests. On macOS ARM64 with Bun 1.4.4 and frozen dependencies, bun run check passed lint with no errors and all 35 typecheck tasks. The normal pre-push hook passed, and the fork branch SHA was read back after the fast-forward push.

Earlier runtime and visual evidence above remains tied to its stated commits. These local results do not establish hosted CI approval or release validation.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix works at the build-input level. I couldn't check it end to end in the TUI: builds run from source embed no highlights, so the dialog doesn't appear there.

How I checked it

  • The 4 new tests fail on the base and pass with this change. The packages/script tests and type-check pass.
  • I ran parse with and without "tui" on every release in CHANGELOG.md from v2.0.26 to v2.2.5. For v2.2.5 the TUI keeps only Percentage Compaction Buffer. Older releases drop only desktop items (e.g. Persistent Desktop Terminals, Faster Long Sessions in Desktop) and keep the shared and TUI ones.
  • Basing the filter on the detailed sections fits the release prompt, which already requires every highlight to appear in them and fixes the section names.

Public API: unchanged. The only change is an optional audience argument on an internal build-script helper.

One thing worth fixing: script/release.ts still calls parse(releaseNotes) and prints "TUI highlights will show:" with the full, unfiltered list. After this change, the preview a releaser checks before triggering the release would no longer match what the build embeds. Please switch it to parse(releaseNotes, "tui") so the preview and embed() agree.

If #61275 also lands, its history() call needs the same "tui" argument, as you noted.

Related: #56432

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The earlier point is fixed: the release preview in script/release.ts now uses parse(releaseNotes, "tui"), so it lists the same highlights the build embeds. The packages/script tests (9/9) and type-check pass at the new head. The public API is unchanged. Nothing new to raise.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit only merges dev into the branch. Your changes are the same as in the version I last reviewed, the CLI build scripts on dev still use embed(), and the packages/script tests (9/9) and type-check still pass. The public API is unchanged. Nothing new to raise.

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new commit only merges dev into the branch again. Your changes are the same as in the version I last reviewed, the CLI build scripts on dev still use embed(), and the packages/script tests (9/9) and type-check pass. The public API is unchanged. Nothing new to raise.

This branch has not been deployed

No deployments
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.

tui: "What's new" advertises desktop-only shortcuts that do nothing in the TUI

1 participant