Skip to content

[CSM Portal] case-detail review follow-ups: severity columns, tag filter, inline watchers, tasks tab - #1221

Merged
Rashmika998 merged 3 commits into
wso2-open-operations:dev-app-csm-portalfrom
rksk:cstools-review-followups-v2
Jul 24, 2026
Merged

[CSM Portal] case-detail review follow-ups: severity columns, tag filter, inline watchers, tasks tab#1221
Rashmika998 merged 3 commits into
wso2-open-operations:dev-app-csm-portalfrom
rksk:cstools-review-followups-v2

Conversation

@rksk

@rksk rksk commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Purpose

Further review follow-ups on the recently-merged CSM portal case-feature work (#1216-#1219): several project-owner review comments on the shipped feature set.

Goals

  • Remove the Severity column from the SRA and Engagements list views (Severity is a support-case concept that doesn't apply there); the main case list keeps it.
  • Remove the tags filter from the case list for now, keeping the underlying tag-search infrastructure intact for the case-detail tag picker and a possible future return.
  • Move watchers add/remove to be fully inline in the case detail's Related tab, retiring the separate popup dialog.
  • Hide the Tasks tab in case detail for now, without removing the underlying task feature or its create action.
  • Make the case-detail tag picker search-and-select only — tags are a curated, pre-existing vocabulary, not free text, so remove the "create a new tag" fallback.

Approach

Rebased directly onto the latest main (after #1219 merged) and resolved a real merge conflict against a concurrently-merged colleague PR that independently added an equivalent hideSeverityColumn prop to the same shared list component for Service Requests — combined both conditions into one clean implementation rather than keeping a duplicate. Everything else follows this codebase's existing component/hook conventions.

User stories

As a CS engineer, I want list views to only show columns relevant to that record type, a simpler inline way to manage watchers without a popup, and a tag picker that reflects the platform's actual curated tag vocabulary rather than implying free-form tagging.

Release note

Removes the Severity column from SRA/Engagements lists, removes the case-list tags filter (temporarily), makes watcher management fully inline on the case detail Related tab, hides the Tasks tab for now, and restricts tag entry to search-and-select.

Documentation

N/A — internal tool, no external product docs affected.

Automation tests

  • Unit tests: updated/added for the severity-column toggle, the watcher inline-editing interaction, and the tag picker's select-only behavior, following this codebase's existing test conventions.
  • Integration tests: N/A beyond the unit level, consistent with existing coverage.

Security checks

  • Followed secure coding standards: yes
  • Ran FindSecurityBugs plugin and verified report: N/A (TypeScript codebase — pnpm lint run clean)
  • Confirmed no keys/passwords/tokens/usernames/secrets committed: yes

Samples

N/A

Related PRs

Follow-up to #1216, #1217, #1218, #1219 (all merged).

Migrations (if applicable)

N/A

Test environment

Node/pnpm (as pinned by this repo), macOS, verified via npx tsc -b, pnpm build, npx vitest run, pnpm lint.

Learning

N/A

Summary by CodeRabbit

  • New Features

    • Manage case watchers directly in the Related tab with inline search, add/remove actions, and cancel—without using a separate dialog.
    • Hide the Severity column for engagements and security reports.
  • Updated Experience

    • Case tags are now chosen only from matching suggestions; free-text tag creation is no longer available.
    • The Tasks tab is hidden from the case details tab bar.
  • Bug Fixes

    • Disabled tag-based filtering in case search and URL filters so tag selections no longer affect results.

rksk added 2 commits July 24, 2026 09:45
… watchers, tasks tab

- Hide the Severity column on the SRA (Security Center) and Engagements list
  views via a new CasesList `hideSeverityColumn` prop, threaded through
  CsmIssuesView; the main case list keeps it.
- Stop wiring the case-list tag filter (TagsMultiSelect) into CasesFilterBar,
  the URL params, and the /cases/search payload for now — the component and
  its search infra stay in place for the case-detail "Add tag" picker and a
  possible future reinstatement.
- Replace the watchers "Manage watchers" dialog (WatchersDialog, now removed)
  with inline add/remove directly in the case detail Related tab: chips get a
  delete affordance, and an "Add watcher" toggle reveals an inline
  search-and-pick panel. The action bar's "Manage watchers" item now jumps to
  the Related tab instead of opening a dialog.
- Hide the case-detail "Tasks" tab from the visible tab bar for now (flagged
  via a `hidden` marker on its TAB_DEFS entry) without deleting the
  underlying tasks feature/data; the task-create flow no longer switches to
  the now-hidden tab.
Tags are a curated, pre-existing vocabulary, not free text -- remove the
freeSolo/create-new-tag fallback from AddTagDialog. A tag can only be
added by selecting a search result; typing alone (with no selection) no
longer enables Add tag.
@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR replaces free-text case tag creation with curated selection, removes case-list tag filtering, moves watcher management into the Related tab with inline search and patching, hides the Tasks tab, and adds severity-column controls for engagements and security reports.

Changes

Tag selection and case filtering

Layer / File(s) Summary
Curated tag picker
apps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.test.tsx
AddTagDialog now requires selecting a non-duplicate existing suggestion; free-text and Enter-based creation are removed and tests cover the updated behavior.
Case filter removal
apps/csm-portal/webapp/src/features/csm-cases/components/CasesFilterBar.tsx, apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts, apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.test.ts, apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.ts
Tag state, URL parameters, active-filter counting, query caching, and /cases/search payload wiring no longer include tags.

Inline watcher management

Layer / File(s) Summary
Inline watcher picker
apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.test.tsx
WatchersWidget now searches users inline, filters existing watchers, supports add/remove actions, handles cancellation and loading states, and is covered by interaction tests.
Case detail watcher integration
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.tsx
Watcher management routes to Related, updates watchList through case patches, and removes the dialog-based flow.

Case detail and issue-list presentation

Layer / File(s) Summary
Hidden tabs and severity-column control
apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsx, apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx, apps/csm-portal/webapp/src/features/csm-engagements/pages/CsmEngagementsPage.tsx, apps/csm-portal/webapp/src/features/csm-security-center/pages/CsmSecurityCenterPage.tsx
The Tasks tab is hidden and task creation no longer navigates to it; engagements and security reports hide the Severity column through the new shared prop.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CsmCaseDetailPage
  participant WatchersWidget
  participant useSearchUsers
  participant CasesAPI

  User->>CsmCaseDetailPage: Choose Manage watchers
  CsmCaseDetailPage->>WatchersWidget: Render Related tab watcher controls
  User->>WatchersWidget: Search for a watcher
  WatchersWidget->>useSearchUsers: Query debounced input
  useSearchUsers-->>WatchersWidget: Return user candidates
  User->>WatchersWidget: Select or remove watcher
  WatchersWidget->>CsmCaseDetailPage: Emit watcher change
  CsmCaseDetailPage->>CasesAPI: PATCH case watchList
  CasesAPI-->>CsmCaseDetailPage: Return patch result
Loading

Possibly related PRs

Suggested labels: Type/Improvement

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 63.64% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title is specific and matches the main change set: case-detail follow-ups for severity, tags, inline watchers, and the tasks tab.
Description check ✅ Passed The description covers purpose, goals, approach, testing, and release notes; only a few template sections are omitted.
✨ 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: 1

🧹 Nitpick comments (1)
apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx (1)

384-458: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Gate the watcher picker query until a search term is entered.

search starts as "", so mounting the picker immediately issues the users search with only active: true and a broad limit: 8. If active users are returned, the empty-state hint never appears. Since useSearchUsers does not expose an enabled option, either add that support and pass enabled: search.length > 0, or bypass the query/clear candidates while search is empty.

🤖 Prompt for 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.

In
`@apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx`
around lines 384 - 458, Gate the watcher picker’s useSearchUsers request until
search contains a non-empty term. Prefer adding and wiring an enabled option
through useSearchUsers with enabled set from search.length > 0; otherwise bypass
the query and ensure candidates is empty while search is blank, preserving the
existing loading, error, and no-match states for active searches.
🤖 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/pages/CsmCaseDetailPage.tsx`:
- Around line 1068-1113: Update onAddWatcher and onRemoveWatcher so rebuilding
watchList preserves existing email-less watchers by retaining their stable id or
userName in the PATCH payload. Apply the same preservation logic to both
handlers, and when removing a watcher that cannot be represented safely in the
full-list update, surface the existing error path instead of silently dropping
it.

---

Nitpick comments:
In
`@apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx`:
- Around line 384-458: Gate the watcher picker’s useSearchUsers request until
search contains a non-empty term. Prefer adding and wiring an enabled option
through useSearchUsers with enabled set from search.length > 0; otherwise bypass
the query and ensure candidates is empty while search is blank, preserving the
existing loading, error, and no-match states for active searches.
🪄 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 Plus

Run ID: 5ffb8eff-67f4-4a43-a7e7-64cfaee77d2b

📥 Commits

Reviewing files that changed from the base of the PR and between f2cc68c and 95ff245.

📒 Files selected for processing (16)
  • apps/csm-portal/webapp/src/features/csm-cases/api/useGetCsmCases.ts
  • apps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/AddTagDialog.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseActionBar.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CaseDetailWidgets.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CasesFilterBar.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CasesList.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/CsmIssuesView.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/pages/CsmCaseDetailPage.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.test.ts
  • apps/csm-portal/webapp/src/features/csm-cases/utils/casesFiltersUrl.ts
  • apps/csm-portal/webapp/src/features/csm-engagements/pages/CsmEngagementsPage.tsx
  • apps/csm-portal/webapp/src/features/csm-security-center/pages/CsmSecurityCenterPage.tsx
💤 Files with no reviewable changes (2)
  • apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.test.tsx
  • apps/csm-portal/webapp/src/features/csm-cases/components/WatchersDialog.tsx

The watcher PATCH resubmits the full watch list as an array of emails
(ServiceNow's watch_list only round-trips as EmailString[]), so a watcher
with no email on file has no representation in that list. Rebuilding the
list from only-emailed watchers on every add/remove silently dropped
those users from the case's watch list. Block the mutation and surface
an error instead of silently losing watchers.
@rksk

rksk commented Jul 24, 2026

Copy link
Copy Markdown
Contributor Author

@coderabbitai resume

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Reviews resumed.

@rksk
rksk changed the base branch from main to dev-app-csm-portal July 24, 2026 05:33
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.

2 participants