feat(locations): materializer allowlist picker with drift badges + saved-state banner#1007
feat(locations): materializer allowlist picker with drift badges + saved-state banner#1007caseylocker wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughAdds a Dropbox Materializer allowlist feature: a new Redux thunk ( ChangesMaterializer Allowlist Feature
Estimated code review effort: 4 (Complex) | ~75 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
This PR adds a “materialized media upload types” allowlist picker to the Locations → Synchronization Settings panel, backed by Redux state and a new paged fetch action for MediaUploadTypes, plus UI reconciliation badges and a saved-state banner.
Changes:
- Extends
dropboxSyncStateto storematerialized_media_upload_typesand allowlist option fetch state (options + error). - Implements
getAllMediaUploadTypesForAllowlistto fetch MediaUploadTypes (paged + concurrency-limited), guarded against stale/superseded invocations. - Adds the allowlist picker UI + reconciliation helpers to
location-list-page.js, with extensive unit and component tests plus i18n strings.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/reducers/locations/dropbox-sync-reducer.js | Adds allowlist options sub-state and materialized_media_upload_types default to the dropbox sync reducer. |
| src/reducers/tests/dropbox-sync-reducer.test.js | Adds reducer tests covering the new allowlist actions and persisted allowlist field behavior. |
| src/pages/locations/location-list-page.js | Implements the allowlist picker UI, reconciliation logic, and saved-state banner on the Locations page. |
| src/pages/locations/tests/location-list-page-allowlist.test.js | Adds thorough unit/component tests for reconciliation cases, UI behavior, gating, and regression coverage. |
| src/i18n/en.json | Adds UI strings for allowlist section labels, badges, banner text, and error/retry copy. |
| src/actions/dropbox-sync-actions.js | Adds paged allowlist options fetch thunk with stale-invocation guards and global overlay loading. |
| src/actions/tests/dropbox-sync-actions.test.js | Adds action tests for paging, ordering, stale-guard behavior, loading bracketing, and error paths. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
f667a66 to
5060ed2
Compare
5060ed2 to
ba3cd40
Compare
…ved-state banner
Checkbox-group picker on the Locations sync panel selecting which MediaUploadTypes
participate in the Dropbox materializer, saved as {id, name} pairs via updateSyncConfig.
- paginate-to-completeness aggregator with two-tier staleness guard (seq+summit commits,
seq-only loading) and pLimit fan-out
- dropboxSyncState gains allowlistOptions + materialized_media_upload_types default
- reconciliation named exports per the SDS rename-handling decision table (cases 0-8),
drift badges, saved-state banner, error/Retry state, MUI primitives
- stable empty-array fallbacks so out-of-contract sync-config responses cannot crash the page
SDS: ftn-docsnsklz sds/dropbox-materializer-participating-types-allowlist.md (amended 2026-07-06)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
ba3cd40 to
96a59f6
Compare
ref: https://app.clickup.com/t/86b9y4k8t
What
Adds the materializer allowlist picker to the Locations page Synchronization Settings panel: a checkbox-group selecting which MediaUploadTypes participate in the Dropbox materializer, saved as
{id, name}pairs through the existingupdateSyncConfigPUT. Includes drift-badge reconciliation against the live type list (rename/recreate/storage-change/invalid cases 0–8 per the SDS decision table), a saved-state banner, and an inline error/Retry state.Spec:
ftn-docsnsklz/sds/dropbox-materializer-participating-types-allowlist.md(incl. the 2026-07-06 amendment consolidating plumbing into existing domain files with global-overlay loading).Scope note (7 files, test-dominated, single concern)
Per
process/ai-assisted-development-workflow.md: 7 files changed, no new source files — aggregator intodropbox-sync-actions.js, cache into the existingdropboxSyncStateslice, reconciliation inlined inlocation-list-page.jsas named exports. The only new file is the test file (location-list-page-allowlist.test.js). ~2,100 insertions, the large majority test code.Ruling requested: casefold approximation (blocking question for reviewer)
SDS:618 requires the UI's name-normalization key-space to equal the worker's Python
strip().casefold(). JavaScript has no built-in casefold; this PR usestrim().toUpperCase().toLowerCase()— the closest zero-dependency approximation, exact for ASCII and realistic non-ASCII (ß, ligatures). It diverges on the dotless-ı class: JS foldsıtoi, Python keeps them distinct. Consequence in the worst case (a stored name containingıwhose live type now spells iti, same id): the UI classifies it Case 1 (no badge) and the Case-2 save-time rename repair never triggers, so the worker keeps skipping those uploads; worker-side diagnostics MAY surface it but are not guaranteed. The divergence is documented at the normalization site and pinned by a dedicated test.Options:
normalizeName's body for a vendored Unicode fold table (single-owner design; nothing else changes).UX question: no UI path from one saved type back to zero (non-blocking, product call)
As specced (SDS:686), Save is disabled when the effective selection is empty, so an admin who has saved ≥1 type cannot shrink the allowlist to zero through this UI — the sanctioned off-path is the
dropbox_sync_enabledSynchronization toggle, and the helper text says so. Field-testing feedback: unchecking or removing the last type silently deactivates Save with no adjacent explanation, which reads as a broken button rather than a guarded contract. If this should change (e.g. tooltip on the disabled Save explaining the rule, or allowing an explicit empty save behind a confirm), it needs a product ruling + SDS amendment; the current implementation follows the spec as written. Suggestion: When the effective selection hits zero and there are stored/visible rows (i.e. the user just unchecked or removed the last type — not the pristine never-configured state), render a small Alert severity="info" above the Save button: "At least one type must stay selected. To stop file sync for this summit, turn off Synchronization above." Save stays disabled.Merge gating
Merge only AFTER dropbox-materializer PR #25 deploys — the picker saves a key (
materialized_media_upload_types) that the pre-#25 materializer ignores. Draft until then.Testing
skills/react-frontend.md§ summit-admin Conventions: global-overlay loading (no per-slice loading),Promise.resolve()thunk guards, constants fromutils/constants.js, MUI +sxfor the new section, single-brace i18n, no snapshots.dropbox-materializer/read writeon the show-admin client) untested locally; covered by the staging walk.Summary by CodeRabbit
New Features
Bug Fixes