Skip to content

fix: keep context selection visible in compact terminals#214

Merged
nathanhuh merged 2 commits into
mainfrom
fix/context-picker-short-terminal
May 12, 2026
Merged

fix: keep context selection visible in compact terminals#214
nathanhuh merged 2 commits into
mainfrom
fix/context-picker-short-terminal

Conversation

@nathanhuh
Copy link
Copy Markdown
Contributor

@nathanhuh nathanhuh commented May 12, 2026

Summary

Improves the context picker in short IDE terminal panes by removing the empty filter spacer when no filter is active, which lets the picker fit without middle truncation. Also raises the selected-row contrast so the active context remains visually obvious across dark terminal themes.

Adds compact-height rendering coverage to keep the selected context and help bar visible without the truncation marker.

Related Issues

Closes #212

Validation

  • go test ./internal/app -run 'TestContextPickerKeepsSelectionVisibleInCompactTerminal|TestContextTableSelectedStyleUsesHighContrast|TestContextPickerPanelDoesNotOverflowHelpBar|TestContextPickerUsesBorderedPanelAndHelpBar'
  • make test
  • make build

Checklist

  • Scope is focused
  • Branch name follows docs/branch-naming-harness.md
  • Documentation harness reviewed (docs/documentation-harness.md)
  • README updated if user-facing behavior changed
  • Relevant docs/ pages updated if architecture, auth, config, or workflow changed
  • Tests/validation included
  • Breaking changes documented

Summary by CodeRabbit

  • Bug Fixes

    • Context filter UI no longer displays empty newlines when no filter value is present
    • Context picker preserves visibility of key UI elements in compact terminal sizes
  • Style

    • Selected context items use a higher-contrast appearance for improved readability
  • Tests

    • Added tests verifying compact-terminal visibility and the high-contrast selected style

Review Change Stack

- improve context table selected-row contrast

- avoid empty filter spacing in the context picker

- cover compact context picker rendering
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 12, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f8b67d1f-e641-4b3f-be67-1f4401ff18fb

📥 Commits

Reviewing files that changed from the base of the PR and between 34ba2f8 and 14403d1.

📒 Files selected for processing (2)
  • internal/app/context_table.go
  • internal/app/styles_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/app/context_table.go

📝 Walkthrough

Walkthrough

Extracts a dedicated high-contrast selected-row style, conditionally skips rendering an empty context filter to save vertical space, and adds tests verifying compact-terminal rendering and the selected style's colors.

Changes

Context Picker Visibility in Compact Terminals

Layer / File(s) Summary
Selected style helper and refactor
internal/app/context_table.go
Replace inline selected-cell style with contextTableSelectedStyle() and assign it to styles.Selected; style is selectedStyle with bold and foreground 255, background 57.
Conditional filter rendering
internal/app/screen_context.go
Only write the rendered filter value and extra newline when renderFilterValue(filterContexts) returns a non-empty string.
Compact terminal and style contrast tests
internal/app/styles_test.go
Add tests: one renders the context picker at 80×14 to ensure required text appears without middle truncation; another asserts contextTableSelectedStyle() equals a constructed high-contrast style (bold, fg 255, bg 57).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 In cramped IDE light I nibble a tweak,
Bold row now gleams where the shadows were meek,
I trim empty lines, keep the picker in sight,
Tests hop in to prove everything’s right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Title accurately captures the main change: preventing context selection from disappearing in compact terminals by removing empty filter spacer and improving contrast.
Description check ✅ Passed Description fully follows the template with all required sections completed, validation steps provided, and all checklist items marked as done.
Linked Issues check ✅ Passed Code changes fully address issue #212: empty filter spacer removal prevents truncation, contextTableSelectedStyle() provides high-contrast styling, and two new tests verify compact rendering and contrast.
Out of Scope Changes check ✅ Passed All changes are scoped to the context picker rendering issue: conditional filter display, contrast style helper, and corresponding test coverage with no unrelated modifications.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/context-picker-short-terminal

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@amazon-q-developer amazon-q-developer Bot left a comment

Choose a reason for hiding this comment

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

This PR successfully addresses the compact terminal visibility issue with clean, well-tested code. The refactoring improves both code organization and user experience by removing empty filter spacing and enhancing visual contrast. The changes are minimal, focused, and properly validated with appropriate test coverage.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/app/context_table.go`:
- Around line 52-56: The use of the deprecated lipgloss.Style.Copy() call in
contextTableSelectedStyle should be removed; instead create a new style by
assigning selectedStyle to a local variable (e.g., base := selectedStyle) and
then chain Bold/Foreground/Background on that variable, replacing
selectedStyle.Copy() in contextTableSelectedStyle; make the identical change in
the test expectation (the styles_test.go expectation around the previous Copy
usage) so both production and test no longer call Copy().
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 107a38b4-253e-49d6-afcf-5926e56aa17b

📥 Commits

Reviewing files that changed from the base of the PR and between 4b904d7 and 34ba2f8.

📒 Files selected for processing (3)
  • internal/app/context_table.go
  • internal/app/screen_context.go
  • internal/app/styles_test.go

Comment thread internal/app/context_table.go
- replace new lipgloss Copy usage in context selected style

- update the matching style expectation
@nathanhuh nathanhuh merged commit 0ea681c into main May 12, 2026
2 checks passed
@nathanhuh nathanhuh deleted the fix/context-picker-short-terminal branch May 12, 2026 09:26
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.

fix: context picker selected row disappears in short IDE terminals

2 participants