Skip to content

fix: context picker selected row disappears in short IDE terminals #212

@nathanhuh

Description

@nathanhuh

Summary

When running unic inside an IDE integrated terminal with a shorter visible pane, the context picker selected/highlighted row can appear to disappear. The context list still renders, but the active selection is not visually obvious, making navigation confusing.

A screenshot is available from the original report and can be attached to this issue if needed.

Observed behavior

  • Open unic in an IDE terminal pane.
  • Navigate to the context picker.
  • The context table renders, but the highlighted/selected element is not visible or is clipped/too low contrast.
  • The footer help bar remains visible.
Image

Suspected cause

The context picker size is derived from Bubbletea terminal dimensions, not a hardcoded screen size, but the current calculations appear too optimistic for short terminal panes:

  • internal/app/context_table.go
    • contextTableHeight(terminalHeight) = max(terminalHeight-10, 3)
    • table still reserves at least 3 rows plus panel/header/footer chrome
  • internal/app/styles.go
    • fitToHeight() truncates overflowing views from the middle to keep top and footer visible
  • internal/app/context_table.go
    • selected row style uses foreground color 170 on background 236, which may have poor contrast in some IDE terminal themes

Desired behavior

  • The currently selected context row should remain visible in short IDE terminal panes.
  • The selected row should be visually obvious across common terminal themes.
  • The help bar should remain visible without clipping the active table selection.

Acceptance criteria

  • Reproduce with a short terminal height similar to an IDE integrated terminal.
  • Adjust context picker/table height calculation so the rendered view fits without hiding the selected row.
  • Ensure selected row styling remains high contrast in dark IDE terminals.
  • Add or update tests around compact context picker height/rendering.
  • Verify make test and make build pass.

References

  • internal/app/context_table.go
  • internal/app/styles.go
  • internal/app/screen_context.go

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions