Skip to content

v1.8.3#107

Merged
shouze merged 1 commit intomainfrom
release/1.8.3
Mar 9, 2026
Merged

v1.8.3#107
shouze merged 1 commit intomainfrom
release/1.8.3

Conversation

@shouze
Copy link
Contributor

@shouze shouze commented Mar 9, 2026

v1.8.3 — Fix TUI layout

Root cause

Three independent bugs in the TUI rendering pipeline:

  1. Header scrolling off screen — the title/column header row was rendered as part of the scrollable content instead of being anchored before the scroll region.
  2. Footer floating up — when the result list was shorter than the terminal height, the keyboard-shortcut bar moved up into the results area instead of staying pinned to the last row.
  3. Narrow-terminal clipping corrupting multi-byte charactersclipAnsi advanced byte-by-byte, splitting surrogate pairs / emoji at a raw byte boundary and producing garbled output.

Changes

  • src/render.ts — header anchored above scroll region; footer preceded by blank-line padding (for (let i = usedLines; i < viewportHeight; i++) lines.push("")) to fill the viewport; clipAnsi now iterates with codePointAt to advance by full Unicode code points and appends \x1b[22;39m (partial reset preserving background) instead of a full \x1b[0m; maxPathVisible and maxLeftVisible floors lowered to Math.max(1, ...); section label maxLabelChars floor lowered to Math.max(0, ...) with blank-line placeholders when 0.
  • src/render/rows.ts — new normalizeScrollOffset() pure function that decreases the scroll offset when the current position leaves blank space at the bottom of the viewport.
  • src/tui.tsnormalizeScrollOffset called in a fixed-point loop inside redraw() so the offset always fills the screen; getRepoRowIndexMap lazy O(1) Map replacing O(n) findIndex; title badge now renders as pc.bgMagenta(pc.black(pc.bold(...))) for maximum contrast.
  • docs/blog/release-v1-8-3.md + docs/blog/index.md + CHANGELOG.md — release notes.

Steps to reproduce (before the fix)

# On a terminal tall enough to show blank space below results:
github-code-search query "foo" --org myorg
# → scroll down: header disappears  
# → on a short result set: footer floats above the last line
# → on a narrow terminal with emoji in paths: garbled characters

Steps to verify (after the fix)

bun test          # 567 pass, 0 fail
bun run lint      # zero errors
bun run format:check
bun run knip
bun run build.ts

Closes #105

Copilot AI review requested due to automatic review settings March 9, 2026 04:33
@github-actions
Copy link

github-actions bot commented Mar 9, 2026

Coverage after merging release/1.8.3 into main will be

96.35%

Coverage Report
FileStmtsBranchesFuncsLinesUncovered Lines
src
   aggregate.ts100%100%100%100%
   api-utils.ts93.20%100%93.75%93.13%101–103, 65, 73, 86–87, 91–92
   api.ts94.55%100%100%93.86%318–322, 383, 400, 63–69
   cache.ts98.08%100%100%97.87%28
   completions.ts99.35%100%100%99.29%252
   group.ts100%100%100%100%
   output.ts99.12%100%94.74%99.52%58
   render.ts94.26%100%89.47%94.49%158, 182–187, 189–191, 193–194, 245–246, 267, 440–441, 523–527
   upgrade.ts88.46%100%94.44%87.89%127–128, 148–155, 158–164, 169, 174, 210–213
src/render
   filter-match.ts97.44%100%92.31%100%
   filter.ts100%100%100%100%
   highlight.ts96.63%100%90.40%99.31%284–285
   rows.ts97.58%100%100%97.44%168, 54–55
   selection.ts100%100%100%100%
   summary.ts100%100%100%100%

@github-actions
Copy link

github-actions bot commented Mar 9, 2026

🔦 Lighthouse Report

Page ⚡ Perf ♿ A11y 🛡️ BP 🔍 SEO Report
/github-code-search/getting-started/ 🟢 99 (≥97) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view
/github-code-search/ 🟢 98 (≥97) 🟢 100 (≥99) 🟢 100 (≥99) 🟢 100 (≥99) 🔗 view

Thresholds: Perf ≥ 97 · A11y ≥ 99 · BP ≥ 99 · SEO ≥ 99
commit e75843b · full workflow run

@shouze shouze self-assigned this Mar 9, 2026
@shouze shouze merged commit 642d37d into main Mar 9, 2026
19 checks passed
@shouze shouze deleted the release/1.8.3 branch March 9, 2026 04:40
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR appears intended to publish the v1.8.3 release, but the diff currently only contains the version bump + release-note documentation updates (no TUI/layout source changes are present in the provided PR files).

Changes:

  • Bump package.json version to 1.8.3.
  • Add a new blog post for the v1.8.3 release and link it from the blog index.
  • Add a v1.8.3 entry to CHANGELOG.md.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
package.json Updates the package version to 1.8.3.
docs/blog/release-v1-8-3.md Adds v1.8.3 release notes post.
docs/blog/index.md Adds v1.8.3 row linking to the new post.
CHANGELOG.md Adds v1.8.3 link/summary row.

Comment on lines 2 to 4
"name": "github-code-search",
"version": "1.8.2",
"version": "1.8.3",
"description": "Interactive GitHub code search with per-repo aggregation",
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

The PR description lists substantial changes in src/render.ts, src/render/rows.ts, and src/tui.ts, but this PR’s diff only shows a version bump + docs/changelog updates. Either include the missing source-code changes in this PR, or update the PR title/description so it accurately reflects what’s being merged.

Copilot uses AI. Check for mistakes.

## Upgrade

```sh
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

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

For consistency with the other release posts in docs/blog/, the upgrade snippet should use a bash fenced block (bash) rather than sh.

Suggested change
```sh
```bash

Copilot uses AI. Check for mistakes.
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: first visible row disappears when scrolled and cursor is on a repo row

2 participants