Repository navigation
feat(service): restore the personal My Open Cases by Priority widget - #1957
Merged
Merged
Conversation
…510) The analytics path resolves {current_user_id} on the 17.4.0 pin (objectstack#12230). Widget filter now scopes to owner_id; stale 'proven gap' notes in crm.app.ts and the analytics token rule in view-references.test.ts are corrected. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X8U3asekbiC7yWoEPWR4Dg
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X8U3asekbiC7yWoEPWR4Dg
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01X8U3asekbiC7yWoEPWR4Dg
os-warren
marked this pull request as ready for review
September 25, 2026 12:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #510
What this does
Restores the personal case table on the Customer Service dashboard (
service_dashboard), the card's own closing condition:open_cases_by_priority→my_open_cases_by_priority, title Open Cases by Priority → My Open Cases by Priority, filter{ is_closed: false }→{ is_closed: false, owner_id: '{current_user_id}' }(owner_id, notowner, per the card's warning);src/sales/apps/crm.app.ts(My Work group, and thenav_my_calendarnote) and from the dashboard itself;test/view-references.test.ts: the analytics-path token rule accepted date macros only; it now accepts the same user tokens as the list path, and its docblock records why.Status: complete at
5089afd3(surface extended per #510 comment 5832389289)test/dashboard-agent-global-filter.test.tsgains a viewer context and a new section 7 pinning the personal widget;test/dashboard-date-range-window.test.tsruns as a signed-in viewer withowner_idfixtures. No existing assertion was removed or loosened. The six docs pages (content/docs/analytics/dashboards*,content/docs/service/index*) name My Open Cases by Priority and say it ignores the Agent filter. Themy_open_casesdocblock insrc/service/views/case.view.tsis rewritten.filterBindings: { owner_id: false }onmy_open_cases_by_priority, measured in the console before commit:5089afd3: validate · typecheck · lint · lint:i18n-gate · hygiene · hygiene:tokens · build · test — all exit 0; 172 test files, 3687 passed, 1 skipped. CI green on this head.Two-user measurement (the acceptance step)
Local dev server on the 17.4.0 pin,
pnpm demo:staffrun, then five open cases handed out as admin:service.agentowns 3 (critical, medium, low),service.managerowns 2 (critical, medium), admin owns none; the other 25 open cases have no owner.Console door (headless Chromium, each user signed in,
service_dashboardopened, the widget'sPOST /api/v1/analytics/dataset/querycaptured). The widget rendered for each user:service.agentowner_id= A's own idservice.managerowner_id= B's own idowner_id= admin's idNote: the console substitutes the viewer's id into the filter before sending, so on this door the server receives a literal id.
Server door: the same selection replayed with the literal
{current_user_id}token, plus a team-wide control:owner_id: '{current_user_id}'{ is_closed: false }'{current_user}'misspellingFILTER_TOKEN_UNKNOWN(suggests{current_user_id})FILTER_TOKEN_UNKNOWNFILTER_TOKEN_UNKNOWNThe control shows admin's 0 is a real result: admin can see 30 open cases and owns none. A and B each saw only their own rows, and the rows differ. The generated SQL carried
owner_id = $2as a bound parameter, alongside the RLS predicate (owner_id = $5 OR id IN (...)). That RLS predicate is the actual access boundary:{current_user_id}only scopes what the widget shows.Gates at 065af37
pnpm validatepnpm typecheckpnpm lintpnpm lint:i18n-gatepnpm hygienepnpm hygiene:tokenspnpm buildpnpm testGenerated by Claude Code