Skip to content

fix(customers): the sidebar's views are the Customers section, never empty - #652

Merged
JeremyFunk merged 1 commit into
mainfrom
fix/customers-sidebar-views
Nov 24, 2026
Merged

JeremyFunk merged 1 commit into
mainfrom
fix/customers-sidebar-views

Conversation

@JeremyFunk

@JeremyFunk JeremyFunk commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
  • Drop the standalone Customers row from the Customers sidebar: clicking it always landed in a view, so it never lit up
  • Rename the Views section to Customers
  • At least one view always stays in the sidebar:
    • the eye button is gone when one view is left, and PressedHideView refuses the last one
    • the list tab menu's "Hide from sidebar" is disabled for the last shown view
    • a layout hiding every view still shows the first (sidebarKeysOf)
  • Customer detail and a hidden view's list now light no sidebar row (previously the Customers row)
  • Test: customers-sidebar.test.ts covers the refused hide and the all-hidden fallback

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

Summary by CodeRabbit

  • New Features
    • The Customers sidebar now keeps at least one view visible. The final visible view can’t be hidden, and its hide control is omitted.
    • The sidebar section is labeled “Customers.”
  • Bug Fixes
    • When all configured views are hidden, a saved view remains visible; if that view is also hidden, the “Current” view appears instead.
    • List routes with a hidden view no longer show a separate fallback navigation item.

…empty

The Customers row always landed in a view, so it was never the lit row. Drop it,
name the views section Customers, and keep at least one view in the sidebar: the
last one shown can't be hidden (sidebar eye or the tab's menu), and a layout that
hides them all still shows the first.
@maple-review-bot

maple-review-bot Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Maple review

🟢 Confidence 9/10 · safe to merge. The one-view guard is pinned by the new sidebar test; the removed eye button and the disabled menu item have no test of their own.
no findings · tests partial −1 · risk medium

Drops the Customers row that never lit, renames the Views section to Customers, and keeps at least one view in the sidebar: the eye disappears on the last one, PressedHideView and the tab menu's "Hide from sidebar" refuse it, and an all-hidden layout falls back to the first view. Contained to the Customers shell.

  • sidebarKeysOf / canHideFromSidebar keep one view shown in the sidebar and list menu
  • PressedHideView returns the model untouched for the last shown view
  • sidebarViewsOf renders the fallback when every view is hidden
  • The standalone Customers row is gone; the views section is labelled Customers

a4f0ae4 · What was checked, coverage and telemetry details are on the Maple / review check. Reply "won't fix" to dismiss a finding, or mention @maple-review-bot to ask about one.

@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The customers sidebar now keeps at least one view visible. The list menu reflects whether the current view is shown and can be hidden. The separate customersList navigation item was removed.

Changes: Customers sidebar visibility

Layer / File(s) Summary
Maintain a visible customer view
apps/web-foldkit/src/customers/view-layout.ts, apps/web-foldkit/src/shell/customers-sidebar.ts, apps/web-foldkit/src/shell/customers-sidebar.test.ts
The sidebar falls back to the first view when all views are hidden. It prevents hiding the last visible view, omits that view’s hide control, and removes the separate customersList navigation item. Tests cover the fallback and the unchanged model when hiding the last view.
Connect list menu state and actions
apps/web-foldkit/src/page/customers/list/model.ts, apps/web-foldkit/src/page/customers/list/update.ts, apps/web-foldkit/src/page/customers/list/view.ts
sidebarStateOf reports whether a view is shown and can be hidden. The menu disables hiding when the shown view is the last one, and the action leaves the model unchanged in that case.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: makisuo

Merge Risk: Minimal · up to a4f0a

The Customers sidebar now always shows at least one view, and the last view can no longer be hidden. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: the Customers sidebar's views are now the Customers section and the sidebar always keeps at least one view visible. The title is specific to the changeset, and the obj…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the Customers sidebar's views are now the Customers section and the sidebar always keeps at least one view visible. The title is specific to the changeset, and the objectives confirm it matches the core fix. Note that the title's wording is a bit long at 74 characters, but it stays readable and accurate.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c08a5121-c7d6-4f8a-be79-312b8d9c6292
Commits

Reviewing files that changed from the base of the PR and between 06debc5 and a4f0ae4.

Files selected for processing: 6

  • apps/web-foldkit/src/customers/view-layout.ts
  • apps/web-foldkit/src/page/customers/list/model.ts
  • apps/web-foldkit/src/page/customers/list/update.ts
  • apps/web-foldkit/src/page/customers/list/view.ts
  • apps/web-foldkit/src/shell/customers-sidebar.test.ts
  • apps/web-foldkit/src/shell/customers-sidebar.ts

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

@github-actions

Copy link
Copy Markdown

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 76.4% 46301 / 60599
🔵 Statements 75.48% 52578 / 69656
🔵 Functions 65.09% 17528 / 26928
🔵 Branches 64.27% 26250 / 40843
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
apps/web-foldkit/src/customers/view-layout.ts 75.43% 75% 76% 73.46% 112-135, 140-144
apps/web-foldkit/src/page/customers/list/model.ts 88.64% 78.9% 85.29% 88.49% 399-403, 407, 411-417, 438, 439, 522-528, 597-599, 675-676, 678-679, 712-715, 724-725, 765, 769-773
apps/web-foldkit/src/page/customers/list/update.ts 71.89% 63.28% 65.81% 75.34% 131, 208, 256, 262, 266, 269, 289, 304, 324-325, 355, 365, 386, 397-407, 418, 420, 422, 451-455, 471-474, 490, 509, 525-529, 549, 559-562, 566-576, 583-588, 590, 595-599, 611-613, 623, 628-632, 638-644, 648-651, 657-664, 678-680, 685-689, 711-730, 751-753, 776-777, 781, 803-813, 832-834
apps/web-foldkit/src/page/customers/list/view.ts 54.47% 20.83% 42.46% 55.37% 175-180, 211-212, 250, 269-282, 286-298, 311-312, 320-321, 332-352, 356-410, 498-610, 637, 642-685, 713, 738-768, 786-792, 838, 922-930, 933
apps/web-foldkit/src/shell/customers-sidebar.ts 57.27% 34.28% 45.9% 57.89% 139, 175-178, 189, 219-220, 236-239, 256-262, 275-279, 292, 298-329, 335-336, 352-358, 361-362, 373-417, 432-504
Generated in workflow #2969 for commit a4f0ae4 by the Vitest Coverage Report Action

@JeremyFunk
JeremyFunk merged commit 8d69c57 into main Nov 24, 2026
8 checks passed
@JeremyFunk
JeremyFunk deleted the fix/customers-sidebar-views branch November 24, 2026 22:57
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