Skip to content

feat: add pane number hints example plugin - #106

Open
cytle wants to merge 2 commits into
stencil-hq:mainfrom
cytle:feat/pane-hints
Open

cytle wants to merge 2 commits into
stencil-hq:mainfrom
cytle:feat/pane-hints

Conversation

@cytle

@cytle cytle commented Oct 19, 2026 •

Copy link
Copy Markdown

Summary

Add a pane-hints example plugin that displays large numbers directly over panes in the active tab, including picture-in-picture panes. Press Ctrl+Cmd+G on macOS, type a number, and press Enter to focus that pane; Escape cancels. An optional tmux-style binding is documented.

The implementation maps CSS positions across all window panes so hidden tabs and parked panes do not shift the displayed numbers onto the wrong pane. It also rejects stale selections after focus or layout changes.

Related to #103. This is an SDK example/prototype, rather than the complete native feature proposed in that issue.

Screenshot

Two tiled panes and one picture-in-picture pane in a clean Tern 0.9.4 test window:

Large numbered hints directly over tiled and floating panes

Validation

  • Luau typecheck and git diff --check passed.
  • Focused isolated integration passed: shortcut, rendered hints with hidden panes, selection/cancellation, invalid numbers, other-tab and parked-pane exclusion, disappearing targets, and no selection-key leakage into the terminal.
  • Mocked shutdown timeouts verify that the test window is terminated and reaped even if graceful shutdown fails.
  • The latest full integration run passed the 12-pane, zoom, and picture-in-picture selection checks, then hit a native ctl tab 1 timeout after 20 seconds. The full run is therefore not reported as passing; the affected small-layout scenarios passed separately.

Limits

  • Uses private chrome CSS selectors and the observed session:panes() DOM ordering; these need verification after Tern upgrades.
  • Requires Enter to confirm; the public prompt API does not provide immediate single-digit selection or an automatic timeout.
  • Parked panes are excluded. Native pane-hint support would remove the private CSS dependency.

View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.

cytle added 2 commits October 19, 2026 15:19
Display large per-pane numbers with Ctrl+Cmd+G and focus by number. Account for hidden and parked DOM nodes, cancel stale selections, and document the optional tmux-style binding.

Add isolated integration checks, behavioral exclusion assertions, and forced cleanup coverage. Luau typecheck and focused integration passed. Full integration passed through 12-pane, zoom and PiP checks but encountered a native ctl tab switch timeout.
@cytle

cytle commented Oct 19, 2026

Copy link
Copy Markdown
Author

Would you prefer pane-number navigation to become a built-in action, alongside session switching and directional pane focus, rather than remain an example plugin?

This PR demonstrates the interaction, but a native implementation could avoid the private CSS/DOM-order dependency and support immediate selection without Enter.

I found the public SDK and examples in this repository, but could not find the Tern application source (where built-in commands such as switch_session are implemented). Is that source available in another repository, or is it currently private? If external contributions to the application are possible, could you point me to the repository and contribution workflow? Otherwise, I would be happy to adapt this prototype to the supported SDK approach you recommend.

Related: #103.

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.

1 participant