Skip to content

fix: permission-aware mutation UX — hide/disable controls in read-only simulations (#127, #128)#136

Closed
wilhel1812 wants to merge 20 commits intomainfrom
issue/127-128-readonly-mutation-ux
Closed

fix: permission-aware mutation UX — hide/disable controls in read-only simulations (#127, #128)#136
wilhel1812 wants to merge 20 commits intomainfrom
issue/127-128-readonly-mutation-ux

Conversation

@wilhel1812
Copy link
Copy Markdown
Owner

Summary

  • Add canMutateActiveSimulation(), countNonEditableResourceIds(), and getMutationPermissionMessage() shared helpers in src/lib/editAccess.ts
  • Gate all simulation-scoped mutation buttons in Sidebar with disabled={!canMutateSimulation} + permission-aware error messages
  • Independent fork actions (Save a Copy, New Simulation, Add Site to Library) gated on canCreateOwnedResources — allowed even in read-only simulations
  • Convert Radio & Model section, Results section, and Link Modal to informational text in read-only mode
  • Hide Link section action buttons entirely when not writable
  • Collaborator picker in Resource Details Access section hidden when not writable
  • MapView: gate site click endpoint mutations, MQTT duplicate buttons, discovery library/MQTT markers, and visible sites dropdown on canPersist
  • npm test (126 tests ✓) and npm run build (✓)

Closes #127. Closes #128.

- Replace branchy cartoThemedTint with typed Record<UiColorTheme> map
- Add satisfies guard so missing themes fail at compile time
- Add yellow tint values (yolk orange shift)
- Add basemap.test.ts covering all themes light/dark
- Add Theme + Basemap Integration Checklist to AGENTS.md
Keep the unread badge visible on the user chip for all users while consolidating full notification content in User Settings. Add credentials-included notifications fetch and coverage tests for client request/options normalization.
@wilhel1812
Copy link
Copy Markdown
Owner Author

Closing this historical stacked PR to reduce branch debt. The 0.10.0 release is out, and this scope should be re-planned as a fresh, focused PR when resumed.

@wilhel1812 wilhel1812 closed this Mar 23, 2026
@wilhel1812 wilhel1812 deleted the issue/127-128-readonly-mutation-ux branch March 23, 2026 10:19
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.

UI polish: hide non-functional mutation actions in read-only simulations UI polish: permission-aware error messaging for blocked simulation edits

1 participant