Repository navigation
fix(ui): settings modal unsaved-changes guard, Back navigation, compact Members pager and consistency fixes - #37904
Conversation
…nsistency fixes - Platform Settings forms ask before Esc, close, the sidebar, breadcrumbs or Cancel drop unsaved edits (shared useUnsavedExitGuard + UnsavedChangesPrompt, also used by Personas) - Opening a Platform Settings view pushes history, leaving an editor replaces, so browser Back returns to Platform Settings instead of closing the modal - Members Users, Admins and Online Users use the numbered pager, reaching any page through the cursor-paged API (useCursorPageJump) - Timestamps use formatDateTimeLong; empty cells use NO_DATA_PLACEHOLDER - Access Token empty state uses the shared placeholder - Custom Properties entity pages use the solid header icon - Audit Logs content lines up with the other pages
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
- useUnsavedChangesPrompt wraps the shared guard and prompt for a form - ProfilePage guards every panel's breadcrumbs once; panels pass plain navigation, so Discard never asks twice - Bots, Access Control (role, policy, rule), Alerts, Custom Properties (add, edit), Personas, Members (user, team), Intake Forms, Applications config and Change Password ask before Cancel, Esc, Close, the sidebar or a breadcrumb drops their edits - Nested forms (custom property edit, intake designer) report onDirtyChange
…uards - Users and Online Users ignore responses from superseded loads, so a slow page can no longer replace the page you are on; a failed page jump toasts - Platform Settings redirects run from an effect replace history, so Back does not land on a stale link and redirect again - Settings forms stay guarded while a save is pending - The Applications config form derives its unsaved state from the live data, so it reads clean again once a save updates the app
- Add forms (Bot, Role, Policy, Persona, Team, User) guard description editor and domain picker edits, which live outside the form state - The intake designer compares rows with their starting values, so an edit that was undone no longer asks
…ewer results - A superseded user search no longer clears the table or the loading state - Starting a search drops any page jump still walking (Users, Online Users)
…ne tests - useUnsavedExitGuard moves to hooks/discovery/personal-space/ - toOptionalNumber gets its JSDoc back; description-only forms describe their guard correctly; the entity-icon assertion states why it holds - Playwright: untouched Applications config, alert edit and intake forms leave without asking; an intake row toggled back reads clean; Members Users picks its page size and goes back a page with the before cursor
…uard remaining forms - Every settings panel pushes a history entry for a view the user opens, so Back returns to the list; a form returning replaces, so Back never reopens it. - Users, Admins and Online Users use the compact pager the Teams list uses; Teams paging falls back to search when the API returns no cursors. - Policy rule description/condition edits mark the form dirty. - The settings-modal SSO form asks through the unsaved-changes popover (classic SSO keeps its dialog) and compares through comparableFormData, so RJSF default filling never reads as an edit. - Glossary relation, announcement, schedule and import forms ask before leaving.
… safe Save & go
- useUnsavedChangesPrompt is a plain hook in src/hooks returning promptProps;
every form renders <UnsavedChangesPrompt {...promptProps} /> itself.
- Save & go leaves only when the editor reports the save landed.
- Every settings panel uses settingsHashOptions; returning to a list after a
delete or uninstall replaces, so Back never lands on a removed entity.
Platform Settings and Custom Properties follow the same rule.
- SSO header tabs and Change provider ask before dropping edits.
- The exit-guard slot is cleared only by the editor that holds it.
- Members cursor walks request cursors only; cursorless team pages keep the
name order.
- Records: compact Members pager (narrows the jump-by-walking record), v4
amendment to the settings history record.
- Tests for the exit guard, prompt, SSO dirty check and history helpers.
Code Review ✅ Approved 🟡 Medium risk 6 closed / 6 findingsShared unsaved-change guards and cursor-based Members pagination alter settings navigation and list loading; cursor errors could show the wrong users or page. Settings modal now guards unsaved edits across forms, keeps browser Back inside settings, and uses a compact pager on Members lists. Resolved out-of-order page fetches and a stale dirty flag after save that caused prompts on leave. No open issues remain; the stale-search, pending-walk, numbered-jump, and cursorless sort findings are closed without a fix in this PR. ✅ 6 closed✅ Bug: Out-of-order page fetches can show one page's rows under another number
✅ Bug: AppConfigForm stays dirty after a successful save, so leaving prompts
Closed: Edge Case: Stale searchUsers error/finally still clobbers the newer shared load
Closed: Edge Case: A pending page walk can overwrite search results after the user searches
Closed: Quality: Minimal Users pager drops numbered jumps the ADR and PR promise
...and 1 more closed from earlier reviews VerificationRules No rules evaluated Functional validation Not enabledAuto-approval Not enabledFor more verification details, comment OptionsDisplay: compact → Showing compact verification results. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
* fix(ui): bump @apidevtools/json-schema-ref-parser to 15.3.6 CVE-2026-15195 (prototype pollution in Pointer.set) affects every version below 15.3.6, including the 14.1.1 the UI resolved. Collate already pins 15.3.6, so this also aligns the two UIs on one major. 15.x ships an ESM `import yaml from "js-yaml"`, and js-yaml 5 has no default export, so a scoped resolution keeps js-yaml 4.3.2 under the parser only; it must stay above the bare js-yaml entry. parseSchemas.js passed its options to the $RefParser constructor, which never read them. They now go on every call, with a JSON parse plugin that drops `$id`: under 2020-12 15.x resolves $refs against `$id`, and 122 spec schemas declare an `$id` that does not match their file path, so refs fetched open-metadata.org instead of the local file. The regenerated output differs only in five ingestion schemas, where 22 bundle-internal $refs pointed through another $ref and resolved nowhere; all 22 now resolve. * test(ui): assert every local $ref in generated schemas resolves Fails on main's output with 22 dangling pointers in five ingestion schemas; also drop the now-redundant post-bundle $id strip, since the parse plugin removes $id when each file is read. * docs(decisions): record why the ref-parser js-yaml pin precedes bare js-yaml Yarn 1 applies the first matching resolution, so the scoped js-yaml 4.3.2 entry must stay above the bare js-yaml entry; package.json cannot carry that comment. The record also says when the pin can go: ref-parser 16.x depends on js-yaml ^5. * test(ui): resolve $refs the way RJSF does in the generated-schema guard URI-decode the fragment and keep empty pointer tokens, so '#/definitions//x' no longer passes against a missing empty key; cover empty, escaped and URI-encoded keys. * chore(playwright): regenerate the impact map main went stale after #37953 and #37904 changed imports without regenerating it, which fails the impact-map drift check on every PR.
Describe your changes:
These are the remaining settings-modal (AI mode) UI-review fixes. The first batch was #37878.
Related: open-metadata/openmetadata-collate#8625 (unsaved-changes guard across settings forms).
Behaviour
useUnsavedExitGuardplusUnsavedChangesPrompt, which Personas now uses too.useUnsavedChangesPrompt(guard + prompt) is wired into Bots (Add), Access Control (Add Role, Add Policy, Add/Edit Rule), Alerts (Add/Edit), Custom Properties (Add, Edit), Personas (Add), Members (Create User/Admin, Add Team), Governance (Intake Form), Applications (config) and Account (Change Password).ProfilePagenow guards every panel's breadcrumbs once (guardBreadcrumbAction), so panels pass plain navigation and Discard never asks twice.onDirtyChange(custom property edit form, intake designer). Alerts and Applications compare against what they loaded, so an untouched form never asks.beforecursor and Next itsafter;useCursorPageJumpcaches each page's paging (bounded at 100) and, when Next is pressed before a page lands, walks one page requesting cursors only. Recorded in ADR:2026-11-17-members-user-lists-use-the-compact-pager, which narrows ADR:2026-10-16-cursor-paged-lists-jump-by-walking for these lists.settingsHashOptionsinutils/SettingsHistory.utils.ts, ADR v4 amendment): opening a view pushes, leaving a form replaces, and returning to a list after a delete or uninstall replaces, so Back never lands on a removed entity.Consistency
formatDateTimeLong: Learning Resources "Updated at", the bot token "Created on", and MCP clients. Announcements stay date-only on purpose, since they are scheduled by day.NO_DATA_PLACEHOLDEReverywhere. Custom Properties used "—".px-8).Known gap: browser Back on an editor with unsaved changes still leaves without asking. The browser does not let the app intercept Back (no popstate guard), and Platform Settings now adds a history entry for each editor it opens, so Back is a more common way out than before. ADR:2026-11-12-settings-modal-views-push-history-only-when-the-user-opens-them (v3) records this.
Not changed: the Weekly emails alignment, which is expected.
Collate companion PR: Ingestion Runners
?currentPage=1, the Provisioning dark-mode empty state, SCIM/runner dates and the Billing seats bar colour.Type of change:
High-level design:
hooks/useUnsavedExitGuard.ts: registers the modal-level exit guard (Esc, Close, sidebar) while dirty and holds the in-panel exits (runGuarded). It anchors the prompt to the last pressed control.SettingsFormLayout(which every Platform Settings form renders through) uses it withform.formState.isDirty. The breadcrumbs go through the same guard.PlatformSettingsPanel.onNavigatepushes unlessisLeavingEditor(current, next).hooks/paging/useCursorPageJump.ts: a bounded per-page paging cache (100 entries, as inuseCursorPagedList), pluscursorFor(target, current)andreset().Tests:
Use cases covered
beforecursor.Unit tests
SettingsFormLayout.test.tsx,useCursorPageJump.test.ts,toSettingsHistoryView,SettingsHistory.utils.test.ts(push vs replace rule,replaceoption),useUnsavedExitGuard.test.ts,UnsavedChangesPrompt.test.tsx,useSsoFormDirty.test.ts, Previous-with-beforeand stale-page tests inMembersUsersPanel.test.tsx.setHashcall,SsoConfigureForm(popover; untouched new provider leaves without asking),GovernanceGlossaryFormPage.Playwright (run locally against this branch,
--no-deps)SettingsUnsavedChanges.spec.ts,ProfilePlatformSettings.spec.ts,ProfileMembers.spec.ts: 47 passed, 0 failed, 0 flaky (1.6m).ProfilePlatformSettings.spec.ts› "lineage: asks before leaving unsaved edits, and only Discard drops them".ProfilePlatformSettings.spec.ts› "browser Back walks the opened views and never reopens a saved form".SettingsUnsavedChanges.spec.ts› untouched Applications config / alert edit / undone intake edit leave without asking.ProfileMembers.spec.ts› "Should ask before a breadcrumb or Cancel drops a typed team".ProfileMembers.spec.ts› Admins Next/Previous and Users "go back a page with the before cursor" for the compact pager.yarn lint:playwright: 0 errors.Recording
settings-modal-behaviour.webm
Screenshots
Unsaved changes prompt (sidebar switch on a dirty Lineage form)

Any settings form: Add Role asks before Cancel drops the typed name

Members › Users: compact pager

Members › Admins

Members › Online Users

Access Token empty state: shared placeholder

Custom Properties › Tables: solid header icon, "--" for empty cells

Audit Logs: lines up with the other pages

Learning Resources: long date format

Bot token "Created on": long date format

🤖 Generated with Claude Code
Summary by Gitar
latestLoadIdRefThis will update automatically on new commits.


Confidence Score: 5/5
The changes appear safe to merge, with no new actionable issue confirmed.Summary
The PR shares unsaved-change prompts across settings forms and makes settings navigation follow one history rule.
Diagram
%%{init: {'theme': 'neutral'}}%% flowchart TD A[User leaves a settings form] --> B{Unsaved edits?} B -->|No| C[Navigate] B -->|Yes| D[Show prompt] D -->|Continue editing| E[Keep form open] D -->|Discard| C D -->|Save and go in Personas| F{Save succeeds?} F -->|No| E F -->|Yes| C C --> G[Replace history when leaving a form]Reviews (15) · Last reviewed commit: "chore: drop an unrelated api-reference r..." · Reviewed by Greptile