Skip to content

feat(locations): materializer allowlist picker with drift badges + saved-state banner#1007

Open
caseylocker wants to merge 1 commit into
masterfrom
feature/materializer-allowlist-picker
Open

feat(locations): materializer allowlist picker with drift badges + saved-state banner#1007
caseylocker wants to merge 1 commit into
masterfrom
feature/materializer-allowlist-picker

Conversation

@caseylocker

@caseylocker caseylocker commented Jul 7, 2026

Copy link
Copy Markdown

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 existing updateSyncConfig PUT. 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 into dropbox-sync-actions.js, cache into the existing dropboxSyncState slice, reconciliation inlined in location-list-page.js as 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 uses trim().toUpperCase().toLowerCase() — the closest zero-dependency approximation, exact for ASCII and realistic non-ASCII (ß, ligatures). It diverges on the dotless-ı class: JS folds ı to i, Python keeps them distinct. Consequence in the worst case (a stored name containing ı whose live type now spells it i, 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:

  • (a) Accept the approximation with the bounded-but-real blind spot, recorded as a dated SDS amendment.
  • (b) Require exact parity — swap 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_enabled Synchronization 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

  • Full suite: 142 suites / 1242 tests green (allowlist test file: 91).
  • Convention pass per skills/react-frontend.md § summit-admin Conventions: global-overlay loading (no per-slice loading), Promise.resolve() thunk guards, constants from utils/constants.js, MUI + sx for the new section, single-brace i18n, no snapshots.
  • Local smoke against a local materializer running the fix room report #25 backend: GET → select → Save → re-GET round-trip and empty-selection gating verified in-browser. IDP scope path (dropbox-materializer/read write on the show-admin client) untested locally; covered by the staging walk.

Summary by CodeRabbit

  • New Features

    • Added a new Dropbox sync allowlist experience for media upload types, including loading, retry, and save controls.
    • Improved the sync panel to show current allowlist status, selected items, and available options.
  • Bug Fixes

    • Better handles renamed, missing, duplicated, or otherwise changed media type entries.
    • Prevents duplicate selections and keeps saved settings consistent when updating sync configuration.
    • Improves error handling and retry behavior when allowlist data cannot be loaded.

@coderabbitai

coderabbitai Bot commented Jul 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7d49f9c2-648b-4f62-a0e0-594bc0babbe6

📥 Commits

Reviewing files that changed from the base of the PR and between 8f4158a and 96a59f6.

📒 Files selected for processing (7)
  • src/actions/__tests__/dropbox-sync-actions.test.js
  • src/actions/dropbox-sync-actions.js
  • src/i18n/en.json
  • src/pages/locations/__tests__/location-list-page-allowlist.test.js
  • src/pages/locations/location-list-page.js
  • src/reducers/__tests__/dropbox-sync-reducer.test.js
  • src/reducers/locations/dropbox-sync-reducer.js

📝 Walkthrough

Walkthrough

Adds a Dropbox Materializer allowlist feature: a new Redux thunk (getAllMediaUploadTypesForAllowlist) with paginated fetching and stale-invocation guarding, reducer state for allowlist options/errors, a location-list-page.js reconciliation UI (normalize/validate/reconcile stored vs current media upload types), i18n strings, and extensive tests.

Changes

Materializer Allowlist Feature

Layer / File(s) Summary
Allowlist fetch action
src/actions/dropbox-sync-actions.js, src/actions/__tests__/dropbox-sync-actions.test.js
Adds paginated getAllMediaUploadTypesForAllowlist thunk with sequence-based supersession guards, pLimit fan-out fetching, and new action constants; extensively tested for pagination, stale-invocation, and error behavior.
Reducer state
src/reducers/locations/dropbox-sync-reducer.js, src/reducers/__tests__/dropbox-sync-reducer.test.js
Extends DEFAULT_STATE with materialized_media_upload_types and allowlistOptions; adds cases for request/receive/error allowlist actions with matching tests.
Page reconciliation logic and state wiring
src/pages/locations/location-list-page.js
Adds normalizeName, isValidEntry, reconcileAllowlist helpers and case/badge mappings; rewires component state to derive stored rows and selection sets, wires new dispatch prop.
Sync panel UI
src/pages/locations/location-list-page.js, src/i18n/en.json
Renders allowlist banner, error/retry alert, checkbox lists with chips/remove buttons, and Save button; adds supporting i18n strings.
UI and reconciliation tests
src/pages/locations/__tests__/location-list-page-allowlist.test.js
Adds decision-table tests for reconciliation cases, panel rendering, save payload correctness, interaction semantics, error gating, and banner regression tests.

Estimated code review effort: 4 (Complex) | ~75 minutes

Possibly related PRs

  • fntechgit/summit-admin#833: Builds on the existing Dropbox sync actions/reducer/UI structure by extending it with updateSyncConfig forwarding and the new allowlist fetching/reconciliation flow.

Suggested reviewers: smarcet

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: a materializer allowlist picker with drift badges and a saved-state banner for Locations.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/materializer-allowlist-picker

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 dropboxSyncState to store materialized_media_upload_types and allowlist option fetch state (options + error).
  • Implements getAllMediaUploadTypesForAllowlist to 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.

Comment thread src/pages/locations/location-list-page.js Outdated
Comment thread src/pages/locations/location-list-page.js
@caseylocker caseylocker force-pushed the feature/materializer-allowlist-picker branch from f667a66 to 5060ed2 Compare July 7, 2026 19:53
@caseylocker caseylocker requested a review from Copilot July 7, 2026 19:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Comment thread src/pages/locations/location-list-page.js
@caseylocker caseylocker force-pushed the feature/materializer-allowlist-picker branch from 5060ed2 to ba3cd40 Compare July 7, 2026 20:29
…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>
@caseylocker caseylocker force-pushed the feature/materializer-allowlist-picker branch from ba3cd40 to 96a59f6 Compare July 7, 2026 20:49
@caseylocker caseylocker marked this pull request as ready for review July 8, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants