Skip to content

Feature/add quit keymaps hint to window#97

Closed
Necrom4 wants to merge 2 commits intojanosmiko:mainfrom
Necrom4:feature/add-quit-keymaps-to-window
Closed

Feature/add quit keymaps hint to window#97
Necrom4 wants to merge 2 commits intojanosmiko:mainfrom
Necrom4:feature/add-quit-keymaps-to-window

Conversation

@Necrom4
Copy link
Copy Markdown

@Necrom4 Necrom4 commented Apr 30, 2026

Summary

Add [y] yes [n] no hint to "Quit lfk?" window.

The window wasn't intuitive to me at first, there was a blank space on the lower half, it almost felt like there was a hint supposed to be there, so I added it. Without it one would the typicals like q/y but may not see (like I did) that there was a dark hint on the bottom bar saying to press Enter.

Type of change

  • feat: new user-facing feature
  • fix: bug fix
  • refactor: code change that neither fixes a bug nor adds a feature
  • docs: documentation only
  • test: add or update tests
  • chore: maintenance (dependencies, tooling)
  • perf: performance improvement
  • ci: CI/CD configuration

Related issue

Changes

  • Add hint under Quit window title
  • Modify test accordingly

Testing

  • go build ./... succeeds
  • go test ./... passes
  • golangci-lint run passes
  • Manually verified against a real cluster (when behavior changed)

Checklist

  • Commits follow conventional commit style (feat:, fix:, refactor:, docs:, test:, chore:, perf:, ci:)
  • README / docs/ updated when user-visible behavior or config changed
  • docs/keybindings.md and the in-app help screen updated when keybindings changed
  • No secrets, tokens, or personal data included in diffs, logs, or screenshots
  • PR is opened from a feature branch on my fork (not from my fork's main)

Screenshots / recordings

@Necrom4 Necrom4 requested a review from janosmiko as a code owner April 30, 2026 07:22
@janosmiko
Copy link
Copy Markdown
Owner

Hi @Necrom4 ,

Thanks for your first contribution.
There's an already closed PR for this request. I want to keep the UI clean and keep the hotkeys on the hint bar.
#80

image

@janosmiko janosmiko closed this Apr 30, 2026
@Necrom4
Copy link
Copy Markdown
Author

Necrom4 commented Apr 30, 2026

Understandable, I recommend you make a smaller window and center the text then! Also document that "y" can be used to quit, but most people can also guess that.

Btw thx for this amazing tool, been recommending it to everyone I work with, never expected such a young/partially-ai-generated tool to already be so solid on its start and basically (finally) replace k9s for me, I never found it intuitive and lfk solves this for me and offers more, love it!

Just wish it continues being contributed to regularly so that we know it's still alive, improving and solving bugs.

@janosmiko
Copy link
Copy Markdown
Owner

Thanks @Necrom4 ,

I like those ideas better, I'll figure out something. Thanks for the kind words. ❤️

janosmiko added a commit that referenced this pull request Apr 30, 2026
…test

Three confirm-overlay renderer comments and one test comment pointed at
a "UI conventions" section in CONTRIBUTING.md that was intentionally not
added on this branch. Drop the references; keep the rule and the PR
#80/#97 history note in place so future contributors still understand
why inline `[y] yes [n] no` text shouldn't come back.

While here, tighten TestOverlayHintBar_ConfirmDialogsAdvertiseYAndN.
The previous loop checked for plain "n" / "y" substrings, which were
already satisfied by "Enter" and "cancel" — so removing `Esc/n` from
the hint bar would not have failed the test it was written to guard.
The check now matches the slash-grouped form (Enter/y, Esc/n) with
reverse-order tolerance, locking in the contract the test name claims.

Minor: collapse the four-line var/assign block at the top of
TestQuitOverlayCentersTextOnMiddleRow into a single := initializer.
janosmiko added a commit that referenced this pull request Apr 30, 2026
Quit overlay shrinks to a 5-row box (border / pad / "Quit lfk?" / pad /
border) with the question on the middle row. lipgloss `Height(N)` counts
inner+padding (not border), so the renderOverlayContent arithmetic is
qh=3 → outer 5; the renderer's own Align(Center, Center) handles the
vertical placement. Closes the floating-text-above-empty-space look that
prompted PRs #80 and #97.

Inline `[y] yes [n] no` text is removed from the paste confirm overlay,
and the paste case is added to overlayHintBarDialog so all confirms keep
their keymap in the bottom hint bar — the single source of truth that
#80 and #97 were trying to bypass. CONTRIBUTING.md gains a UI Conventions
section spelling out the rule so the same PR doesn't keep coming back.

Tests pin the visual contract:
- TestQuitOverlayCentersTextOnMiddleRow walks the rendered frame and
  asserts the question sits on row offset 2 of the 5-row dialog.
- TestRenderQuitConfirmOverlay/production 26x1 inner subtests pin the
  exact dimensions used by the production caller.
- TestRenderPasteConfirmOverlayHasNoInlineKeyHints fails fast if anyone
  re-adds inline `[y]/[n]` text to the paste body.
janosmiko added a commit that referenced this pull request Apr 30, 2026
The confirm overlay handlers (handleConfirmOverlayKey,
handleQuitConfirmOverlayKey, handlePasteConfirmKey, the bookmark
delete confirms) all accept "y"/"Y" as confirm and "n"/"N" as cancel,
but the bottom hint bar only listed Enter and Esc. Users who reach for
y/n had to read source — and the gap was exactly what PRs #80 and #97
tried to fix by adding inline `[y] yes [n] no` text inside the dialog.

Promote y/n to first-class hints. The confirm/quit/paste dialogs and
both bookmark delete confirms now show:

  Enter/y: <action>  |  Esc/n: cancel

Slash-grouped pairs follow the existing convention used elsewhere
(e.g. "q/Esc", "j/k", "ctrl+d/u"). q is the only confirm/cancel alias
still left unadvertised — it's a power-user shortcut without a
universal expectation, unlike y/n on a yes/no prompt.

CONTRIBUTING.md UI Conventions section updated: y/n are now
"advertised alongside Enter/Esc" rather than "unadvertised aliases".
The closing note about #80/#97 remains so future contributors
understand why the hints live in the bar, not in the overlay body.

Tests:
- TestOverlayHintBar_ConfirmDialogsAdvertiseYAndN locks the contract:
  every confirm-style overlay (overlayConfirm, overlayQuitConfirm,
  overlayPasteConfirm, bookmarkModeConfirmDelete, …DeleteAll) must
  surface Enter, Esc, y, n in the rendered hint bar. Substring checks
  rather than exact form so a future "y/Enter" rename still passes.
- Existing TestOverlayHintBar_ReturnsNonEmpty unchanged: substring
  assertions on "Enter" still match the new "Enter/y" form.
janosmiko added a commit that referenced this pull request Apr 30, 2026
…test

Three confirm-overlay renderer comments and one test comment pointed at
a "UI conventions" section in CONTRIBUTING.md that was intentionally not
added on this branch. Drop the references; keep the rule and the PR
#80/#97 history note in place so future contributors still understand
why inline `[y] yes [n] no` text shouldn't come back.

While here, tighten TestOverlayHintBar_ConfirmDialogsAdvertiseYAndN.
The previous loop checked for plain "n" / "y" substrings, which were
already satisfied by "Enter" and "cancel" — so removing `Esc/n` from
the hint bar would not have failed the test it was written to guard.
The check now matches the slash-grouped form (Enter/y, Esc/n) with
reverse-order tolerance, locking in the contract the test name claims.

Minor: collapse the four-line var/assign block at the top of
TestQuitOverlayCentersTextOnMiddleRow into a single := initializer.
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.

2 participants