Skip to content

[CSM][Web] Align QuickNav search palette with customer-portal's style - #1174

Merged
cloby99 merged 3 commits into
wso2-open-operations:mainfrom
Rashmika998:feature/csm-quicknav-search-parity
Jul 19, 2026
Merged

[CSM][Web] Align QuickNav search palette with customer-portal's style#1174
cloby99 merged 3 commits into
wso2-open-operations:mainfrom
Rashmika998:feature/csm-quicknav-search-parity

Conversation

@Rashmika998

@Rashmika998 Rashmika998 commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Restyles the header QuickNav/search palette (Cmd+K) to visually match customer-portal's search dropdown, while keeping csm-portal's extra command-palette behavior (Pinned/Recent/Pages sections, keyboard navigation, Cmd+K shortcut).
  • Case results (live search, and Pinned/Recent entries snapshotted from the case detail page) now render as rich cards with severity/status/case-type chips and updated/assignee metadata, reusing the existing SeverityChip/StateChip components.
  • Swaps the Dialog for Modal + a plain Paper (both from @wso2/oxygen-ui) so the theme's translucent "acrylic" background applies automatically — matching the glassy look of customer-portal's dropdown instead of Dialog's more opaque default styling.
  • Adds a skeleton loading state for the "Cases" section and an illustrated empty state; hides the "Pages" section on the empty-query default view (still matches when typed); fixes an autofocus race that required a second click before typing worked; widened the search trigger.

Test plan

  • tsc -b --noEmit passes
  • eslint passes on all touched/new files
  • vitest run passes (useRecentViews.test.ts, updated for the per-user storage key)
  • vite build succeeds
  • Manually verified in the running app: Cmd+K palette opens, case search shows rich cards, Pinned/Recent cases show the same rich card, glassy background renders correctly, autofocus works on first click, Pages hidden until typing

🤖 Generated with Claude Code

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features

    • Enhanced quick navigation with rich case cards (severity, state/work state, type, updated time, and assignee).
    • Added “no results” empty-state illustration and quick-nav result skeletons.
    • Added reusable work-state chip and persisted richer case metadata for recents/pins.
  • Bug Fixes

    • Recent views are now stored separately per signed-in user.
    • Improved quick-navigation focus behavior when opening.

Restyles the header quick-nav/search palette to match customer-portal's
search dropdown while keeping csm-portal's extra command-palette behavior
(pinned/recent/pages sections, keyboard nav, Cmd+K):

- Cases (live search, plus Pinned/Recent entries snapshotted from the case
  detail page) render as rich cards with severity/status/case-type chips
  and updated/assignee metadata, reusing SeverityChip/StateChip.
- Swaps the Dialog for Modal + a plain Paper so the theme's translucent
  "acrylic" background applies, matching the glassy look of customer-portal's
  dropdown instead of Dialog's more opaque default.
- Adds skeleton loading and an illustrated empty state; hides the "Pages"
  section on the empty-query default view; fixes input autofocus.
- Scopes the recent-views localStorage cache to the signed-in user's ID
  token `sub` claim and wipes it on explicit sign-out (manual + idle
  timeout), so a previous user's recent/pinned cases can't leak to the
  next person signing in on a shared machine.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9bd6bf93-9bd2-4d93-be2a-992224ac8031

📥 Commits

Reviewing files that changed from the base of the PR and between 95b30ba and c2c1d16.

📒 Files selected for processing (9)
  • apps/csm-portal/webapp/src/components/WorkStateChip.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseDetail.ts
  • apps/csm-portal/webapp/src/features/csm-cases/api/useQuickCaseSearch.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNav.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.ts
🚧 Files skipped from review as they are similar to previous changes (5)
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/api/useQuickCaseSearch.ts
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNav.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.ts

📝 Walkthrough

Walkthrough

Quick case search and recent views now preserve enriched case metadata for rich quick-navigation cards. Recent-view storage is scoped per signed-in user, QuickNav gains card, loading, focus, and modal updates, work-state rendering is shared, and a reusable no-results SVG icon is added.

Changes

Case navigation experience

Layer / File(s) Summary
Enriched case-hit contract
apps/csm-portal/webapp/src/features/csm-cases/api/useQuickCaseSearch.ts, apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCaseDetail.ts, apps/csm-portal/webapp/src/features/csm-cases/types/csmCases.ts, apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
Case search and recorded case views now carry severity, state, type, timestamps, identifiers, and assignee metadata.
User-scoped recent-view storage
apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.ts, apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.test.ts, apps/csm-portal/webapp/src/layouts/AppLayout.tsx
Recent case snapshots are stored per signed-in user, synchronized on identity changes, migrated from the pending bucket, cleared on sign-out, and wired into the application layout.
Rich quick-navigation rendering
apps/csm-portal/webapp/src/features/csm-recent/components/QuickNav.tsx, apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx, apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavResultSkeleton.tsx
QuickNav renders enriched case cards for search, recent, and pinned results, with loading skeletons, focus handling, revised empty states, and a Modal-based layout.
Shared case status presentation
apps/csm-portal/webapp/src/components/WorkStateChip.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx
Work-state chip styling and labels are centralized and used in case-list rows.

Search empty-state illustration

Layer / File(s) Summary
No-results SVG component
apps/csm-portal/webapp/src/components/empty-state/SearchNoResultsIcon.tsx
Adds an accessible inline SVG component with configurable SVG properties and gradient-based illustration content.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant QuickNav
  participant QuickCaseSearch
  participant RecentViews
  participant QuickNavCaseCard
  User->>QuickNav: open and enter query
  QuickNav->>QuickCaseSearch: search cases
  QuickCaseSearch-->>QuickNav: enriched QuickCaseHit results
  QuickNav->>RecentViews: load recent and pinned case snapshots
  RecentViews-->>QuickNav: caseHit data
  QuickNav->>QuickNavCaseCard: render matching case cards
  User->>QuickNavCaseCard: select case
Loading

Possibly related PRs

Suggested labels: Type/New Feature, Type/Improvement

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description covers summary and testing, but most required template sections are missing or unfilled. Add the required template sections: Purpose, Goals, Approach with UI screenshot/GIF, User stories, Release note, Documentation, Automation tests, Security checks, and the remaining items.
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: aligning the QuickNav search palette with customer-portal styling.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/csm-portal/webapp/src/features/csm-cases/api/useQuickCaseSearch.ts`:
- Around line 88-94: Update the case mapping in useQuickCaseSearch to derive
state through uiStateFromBe instead of casting c.state directly. Pass the
backend state and relevant work-state data required by uiStateFromBe so
normalized status values, including work_in_progress, are preserved for
quick-search cards.

In
`@apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx`:
- Around line 85-92: Update the case-type Chip render in QuickNavCaseCard to
require both hit.caseType and a defined CASE_TYPE_LABEL[hit.caseType] value
before rendering. Mirror the existing guard used by CsmCaseDetailPage while
preserving the current chip props and label behavior for supported case types.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: a8634d55-f5d4-475d-852f-0b2f99805409

📥 Commits

Reviewing files that changed from the base of the PR and between 3331822 and 95b30ba.

📒 Files selected for processing (9)
  • apps/csm-portal/webapp/src/components/empty-state/SearchNoResultsIcon.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/api/useQuickCaseSearch.ts
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNav.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavResultSkeleton.tsx
  • apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.test.ts
  • apps/csm-portal/webapp/src/features/csm-recent/hooks/useRecentViews.ts
  • apps/csm-portal/webapp/src/layouts/AppLayout.tsx

Comment thread apps/csm-portal/webapp/src/features/csm-recent/components/QuickNavCaseCard.tsx Outdated
- Map /cases/search's raw state through uiStateFromBe instead of a direct
  cast, so quick-search cards normalize status the same way the rest of
  the app does and don't miss the work_in_progress work-state badge.
- Guard the case-type chip on both hit.caseType and a defined
  CASE_TYPE_LABEL entry, mirroring the existing guard in
  CsmCaseDetailPage.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>

@shayanmalinda shayanmalinda left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed the QuickNav palette restyle. The Modal+Paper swap, per-user recent-views scoping, and rich case cards all look solid; leaving a few findings — a skeleton/results overlap during background refetches, the lifecycle of the .pending recent-views bucket, a duplicated work-state chip, and two smaller nits.

Comment thread apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx Outdated
- Skip the "Cases" skeleton during a background refetch of already-visible
  results (a stale-but-cached query re-run no longer renders two "Cases"
  headers at once).
- Scope every useRecentViews/useRecordRecentView call site to resolve its
  own active-user key instead of relying on one component elsewhere in the
  tree having already done so — activeUserKey is a per-tab JS variable, so
  a component mounted first (or the only one mounted in a fresh tab) could
  otherwise get stuck reading the "pending" bucket indefinitely while the
  real data sat under the correct per-user key.
- Migrate any views recorded before identity resolved (the "pending"
  bucket) into the resolved user's bucket instead of stranding them.
- Extract WorkStateChip (mirroring SeverityChip/StateChip) to remove the
  duplicated inline work-state Chip between CasesList and QuickNavCaseCard.
- Re-indent the Modal/Paper wrapper block in QuickNav.tsx.
- Add CsmCaseDetail.assigneeName (raw assignee name, no "Unassigned"
  fallback) so the quick-nav case-hit snapshot no longer infers "no
  assignee" by string-comparing against a display label.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants