Repository navigation
perf(people): load independent role-modal catalogs concurrently - #939
Conversation
This comment has been minimized.
This comment has been minimized.
Architecture Data flow Review 1 finding · reviewed
|
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Concurrent catalog loading and validation frontend/js/ui.js, tests/browser/run_work_role_editor_selftest.js |
prepareRoleModal starts the People and Work catalog reads together and retains each catalog’s fallback. Browser tests check completion, projected selections, fallback fetches, focused Work selection, and Person-route selection. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Other
Possibly related issues
- [Roadmap] Application Performance, Scalability & Regression Benchmarks #765 — Covers targeted performance work; this change tests concurrent role-modal catalog reads.
- E2E completion tracker: correctness flakes, CI cost and targeted performance #740 — Tracks performance profiling and request-concurrency work; this change tests the concurrency behavior without reporting a measured end-to-end improvement.
Suggested reviewers: cursoragent
Merge Risk: 
Minimal · up to 60cdd
-
No actionable issue is identified with the concurrent catalog loading change. Complete the stated quality checks and maintainer approval before merging.
Pre-merge checks: 
7 · 
1
-
Failed checks: 1 warning Passed checks: 7 passed-
Full details: Description check
-
Explanation
The description provides a detailed summary, motivation, scope boundaries, validation plan, related issue reference, risks, and merge requirements. It does not use the template headings consistently and omits the checklist, but the required information is mostly present and the description is directly relevant.
Full details: Prks Engineering Invariants
-
Explanation
PASS. The PR changes only
prepareRoleModalrequest timing and keeps the existing People/Work projections, fallbacks, preselection, and modal generation handling. The applicablefrontend/AGENTS.mdrules require the legacy runtime ownership, the single People offline helper, and preserved role-modal ownership/lifecycle checks; the diff satisfies these rules. The added harness uses the existing safe loader and does not execute user query text or add a new dynamic-execution path. No conflicting requirement appears inAGENTS.md,README.md, orSECURITY.md.
Full details: Ui Design Contract
-
Explanation
The change only schedules the existing People and Work catalog reads concurrently. It does not add or alter modal markup, controls, styles, focus behavior, Escape handling, or selection patterns.
openModal('role-modal')still keeps the modal inert untilprepareRoleModal()completes, and the initializer retains the existing comboboxes, preselection, fallbacks, and modal lifecycle. This is consistent with DESIGN.md’s shared dialog and combobox contracts (lines 888–894 and 912). The added harness also verifies catalog fallbacks and Person/Work preselection.
Full details: Offline And Sync Coherence
-
Explanation
PASS. The PR changes only the scheduling of two existing disposable read-throughs in
prepareRoleModal()(frontend/js/ui.js:1904-1918). It does not change durable operations, cache keys, service-worker behavior, projection overlays, or sync acknowledgement rules. The existing People helper still uses the singlepeople:indexprojection, and the runtime still applies its cache/unavailable and reconnect generation checks. The existing per-catalog network fallbacks remain unchanged. Regression coverage checks concurrent starts, waiting for both results, unavailable-catalog fallbacks, focused Work fallback, Person preselection, and no fallback for valid projections (tests/browser/run_work_role_editor_selftest.js:98-187). Existing offline role E2E coverage warms the caches, exercises the modal while offline, and verifies reconnect synchronization (tests/e2e/test_work_people_offline.py:61-74, 188-240). This remains coherent with the current rollout and local-first invariants.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 3 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 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.
Comment @coderabbitai help to get the list of available commands.
This comment has been minimized.
This comment has been minimized.
|
@coderabbitai review |
✅ Action performed
|
Evidence from #740
The merged manual browser profiler #40274409331 passed all three isolated measured Chromium runs for each of the two offline Person scenarios. Whole-test medians: Create 15.188s, Edit 13.308s. Role-link intervals: Create 8.108s / Edit 7.824s, dominated by Work navigation (3.238s / 3.336s) and Link-modal opening (4.423s / 3.254s). Role save + durable queue confirmation was only ~0.048s. Exact causality within
link_modalwas not instrumented.One narrow, testable cause
In
frontend/js/ui.js,prepareRoleModal()previously awaitedprksOfflinePeopleFetch()before initiatingprksOfflineWorksBrowseFetch(). These are independent, separately validated offline-capable catalog reads. When transport falls back offline, serialized waits can lengthen Link-modal readiness. Start both independent reads withPromise.all, then keep the existing fallback tofetchPersons/fetchWorks, People overlays, Work/Person preselection, search, credit picker, modal generation fence and error handling unchanged. No global retry/connectivity policy, cache-coherence or authorization change; no removal of UI assertions. This is a targeted optimization hypothesis, not a proven measured speedup yet.Extend the existing browser-free Node work-role-editor UI harness, which already loads the real
ui.js, to assert that both catalog requests start immediately and the projected Work/People selections remain intact. Keep its existing owner/epoch regression checks. No new dynamic-code-execution test, new workflow, or default CI cost.Validation and release gate
Require exact-head unit/API, full E2E, static/CodeQL and review checks to pass before merge; leave unmerged pending maintainer approval. Run the existing input-free manual
e2e-offline-person-profile.ymlon this PR branch after green CI and compare stage medians against baseline (4.423s create / 3.254s edit forlink_modal, 15.188s / 13.308s whole). Do not infer a universal speedup from separate runner results. Work navigation remains a second, independently measured bottleneck; do not add speculative fixes to this PR. Refs #740.SonarCloud follow-up
The initial independent Node test dynamically evaluated an extracted function, causing SonarCloud's new-code security finding (unsafe dynamic code execution). Removed that test file and moved the concurrency assertion into PRKS's existing Node UI harness, which already loads
ui.js; no new dynamic evaluation was added. Updated head2c72b63; exact-head quality gates and E2E are rerunning. Do not merge if SonarCloud or required CI remains red.Summary by CodeRabbit