Repository navigation
fix(web): hydrate ManyToOneRef labels for groups and SearchFilter preview - #601
Conversation
Show DisplayName for *Ref groupbys (e.g. CompanyId/LanguageId) via batch Search after readGroup, keeping group keys as bare ids.
Batch-resolve manytoone/manytooneref ids for the filter editor preview while keeping stored condition values as bare ids.
Reviewer's GuideAPIExpose the relation-label cache composable and its dependencies for SearchFilter preview hydration.
ImplementationCentralize batched relation-record loading and filter relation ID collection, signatures, cache keys, and preview formatting.
Reuse the batch loader for record hydration and hydrate ManyToOneRef labels in grouped results without changing group keys or non-Ref labels.
UIUse the relation-label cache to render manytoone and manytooneref preview values with DisplayName when available, falling back to IDs.
TestsVerify SearchFilter preview hydration, missing-record fallback, and existing event behavior.
Exercise cache hydration, stale-generation handling, replacement and clearing, and refresh error handling.
Verify readGroup label hydration for flat and nested Ref groups, fallback behavior, and preservation of ordinary ManyToOne labels.
Cover shared batch loading behavior, chunking and failure handling, and temporal group alias normalization.
Test relation ID extraction and collection, stable batch signatures, preview formatting, and cache-key generation.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
- Replace filter label cache on each draft batch (evict stale ids) - Chunk Ref DisplayName Search IN lists; only patch Ref raw.labels - Cover empty-cache clear, catch path, and non-id preview values
PR Code Suggestions ✨Explore these optional code suggestions:
|
Keep earlier Search chunks when a later chunk fails, and avoid double-collect / unhandled rejection in the filter label watcher.
|
Evaluated the optional suggestions in #601 (comment):
Pushed as |
PR Code Suggestions ✨Explore these optional code suggestions:
|
Recollect filter ids in the watch callback so batch matches signature, and always record an empty lookup map when store creation fails.
|
Evaluated #601 (comment):
Pushed as |
PR Code Suggestions ✨Explore these optional code suggestions:
|
User description
Summary
readGroupvia sharedbatchLoadRefRecordsByModel, keeping group keys as bare ids.Test plan
./choysum test typecheck web./choysum test unit web --fe./choysum test e2e web./choysum test e2e auth/web/auth/usersgroup by Company / Language — headers show namesSummary by Sourcery
Hydrate ManyToOneRef labels across grouped results and SearchFilter previews without altering stored query IDs.
Bug Fixes:
Enhancements:
Tests:
PR Type
Bug fix, Enhancement, Tests
Description
Hydrate ManyToOneRef group labels after readGroup via shared batch loader
Show relation DisplayName in SearchFilter preview with short-lived cache
Extract shared relation utilities and refactor executor hydration
Add unit tests for group hydrate, filter ids, cache staleness, preview
File Walkthrough
5 files
Add preview DisplayName hydration testsTest label cache hydration and stale generationsTest readGroup ManyToOneRef label hydrationTest batch ref record loading utilityTest filter relation id collection helpers5 files
Export new relation label cache composableAdd short-lived filter relation label cache composableHydrate group ref labels and share batch loaderAdd shared batch ref record loaderAdd filter relation id collection and preview helpers1 files
Resolve relation DisplayName in filter previewSummary by CodeRabbit