Skip to content

CPLAT-11489: number keys select the day pane's kind tabs - #158

Merged
gavin-jeong merged 1 commit into
masterfrom
CPLAT-11489-daypane-tab-digits
Aug 14, 2026
Merged

gavin-jeong merged 1 commit into
masterfrom
CPLAT-11489-daypane-tab-digits

Conversation

@gavin-jeong

Copy link
Copy Markdown
Collaborator

JIRA: https://sendbird.atlassian.net/browse/CPLAT-11489

Follow-up to #157, which made the daily "Produced" pane tabbed by kind. The tabs shipped reachable only by tab / shift+tabthe number keys did nothing at all, which is the first thing anyone tries on a tab bar with four labels on it.

  [All 24]  PRs 20   Jira 3   Plans 1
Produced (24)  ↵:jump to first mention  o:open  y:copy  x:actions

Pressing 1, 2, 3, 4 here was a no-op.

Why they were dead

The digits are bound to session preview modes (preview:conv, preview:refs, …). A day row has no preview modes — updateSessionPreview() routes it to updateDayPreview without ever consulting sessPreviewMode — so handleShortcutKey deliberately swallowed them:

if isPreviewModeCmd(cmdName) && !a.rowSupportsPreviewModes() {
    return a, nil, true
}

That swallow was correct when it was written: firing a preview-mode switch on a day row changed hidden state and repainted nothing, so the digits looked broken, and letting them fall through to the list scrolled the cursor instead — a second surprise on top of the first. But once the pane grew a tab bar, the row did have an axis for the digits to address, and the swallow was the only thing standing between them.

The fix

On a day-pane row the digits are re-pointed at that pane's kind tabs, positionally over the bar as rendered: 1 is All, and the rest follow what is on screen.

Positional rather than a fixed digit→kind table, because dayOutputTabsFor builds the bar per scope — it drops kinds the day produced none of, and keeps the active kind even when the day has none of it (the stickiness that makes date-to-date comparison work). Both of those shift every later tab's slot. A fixed table would point the digits at labels that are not there; in the bar above, a hardcoded 4 would mean Artifacts, which this day did not produce, while the user is looking at Plans in the 4th slot.

The interception lives at the existing swallow in handleShortcutKey, not as a pre-empt in the key dispatcher, so a digit the user has rebound to something else is still honored. A digit that addresses no tab (0, 9, anything past the bar) keeps the original swallow — falling through to the list would bring back exactly the cursor-scroll surprise the swallow exists to prevent.

cycleDayOutputTab and the new selectDayOutputTab now share setDayOutputTabKind, which owns the four things a tab switch has to do: reset the cursor (every row action resolves through dayOutputsCursor into the filtered slice), clear the preview cache key, repaint the owning scope, and scroll to top. Re-selecting the tab you are already on returns early rather than jumping the cursor to the top of a list that did not change.

Hints

The pane footer and the focused-preview hint line now read 1-9/tab:kind. The ? overlay's Shortcuts section previously listed the preview modes, then — after the row-aware filter — listed nothing on a day row; it now names the actual tabs (1:all 2:prs 3:jira 4:plans) via dayOutputTabHint(), built from the same bar the digits address.

Testing

gofmt and go vet clean; full suite green.

New tests, all driving the real key path (app.Update) rather than the handler, since the digits are intercepted in the shortcut layer long before any day-pane handler runs:

test what it pins
TestDayPreviewDigitsSelectTabsPositionally the reported bug — fixture is the screenshot's exact shape (All / PRs / Jira / Plans, no Artifacts), so 4 must reach Plans even though Plans is 5th in dayOutputTabOrder
TestDayPreviewDigitsFollowTheStickyBar the one trap in a positional mapping: an active-but-empty kind stays in the bar and shifts every later slot
TestDayPreviewOutOfRangeDigitIsSwallowed 0 / 9 must not fall through and move the list cursor
TestSessionRowDigitsStillSwitchPreviewMode the other half — on a session row the digits still select preview modes (5 → refs)

On a day row the digits were bound to preview modes the pane cannot show,
so handleShortcutKey swallowed them and 1/2/3/4 did nothing at all. They
now address the tab bar positionally — 1 is All, and the rest follow the
bar as rendered, since dayOutputTabsFor drops kinds the scope produced
none of (a fixed digit-to-kind table would point at labels that are not
on screen).
@Kairo-Kim Kairo-Kim added the auto-review/approved Auto-approved by the Slack auto-reviewer bot label Aug 14, 2026

@jinsekim jinsekim left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM!

@upwind-code-us

upwind-code-us Bot commented Aug 14, 2026

Copy link
Copy Markdown

Upwind Upwind Code Scan - ⚠️ Deploy with Caution

2 newly introduced vulnerabilities · 0 resolved · 2 total in this PR vs the default branch

🔶 1 High | 🟢 1 Low


🔶 High · 1 finding
CVE Package Version Fix
CVE-2026-56852 golang.org/x/text v0.3.8 0.39.0

🟢 Low · 1 finding
CVE Package Version Fix
CVE-2026-39824 golang.org/x/sys v0.42.0 0.44.0

View full analysis in Upwind Console

Scan completed in 4m 26s

Scan history (2 scans)
Commit Scanned at New Resolved Net
79c30a3 2026-08-14 08:14 UTC
79c30a3 < 2026-08-14 08:14 UTC +2 0 +2

Last scanned: 79c30a3 · 2026-08-14 08:14 UTC

@upwind-code-us

upwind-code-us Bot commented Aug 14, 2026

Copy link
Copy Markdown

Upwind Upwind IaC Scan - ✅ Proceed with Deployment

0 newly introduced misconfigurations · 0 resolved · 0 total in this PR vs main

View full analysis in Upwind Console →

Scan completed in 1m 57s

Scan history (1 scan)
Commit Scanned at New Resolved Net
79c30a3 < 2026-08-14 08:14 UTC 0 0 0

Last scanned: 79c30a3 · 2026-08-14 08:14 UTC

@gavin-jeong
gavin-jeong merged commit 4b6005f into master Aug 14, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-review/approved Auto-approved by the Slack auto-reviewer bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants