Repository navigation
Prayer spaces are manageable from the console - #7
Open
IbraTech04 wants to merge 2 commits into
Open
IbraTech04 wants to merge 2 commits into
IbraTech04 wants to merge 2 commits into
Conversation
The page was read-only, and its own doc comment said so: "the backend exposes GET /api/minbar/prayer-spaces and nothing to write with... a space can only be changed by editing the database directly." NOTES-FOR-BACKEND.md called it the single biggest hole. The backend now has admin CRUD, so this closes it. The page loads the admin list — every space, unfiltered — rather than the audience-scoped endpoint the app uses, because a console editing the sisters' musallah has to be able to open it whoever is signed in. The audience control stays as a client-side filter, now defaulting to All. **Type and audience are different questions**, and the form says so instead of leaving an operator to guess. Type is what kind of room it is: the label on the card and the filter on the map. Audience is who it is listed to. They agree for a gendered musallah and diverge for everything else — a multifaith room and a reflection bay are both shown to everyone. On create, audience follows the type until the operator overrides it; on edit it never moves on its own, so relabelling a sisters-only bay cannot quietly publish it to the whole campus. **Saves send only what changed.** The form diffs against a record refetched when the editor opens, so "I fixed a typo in step 3" is a patch to step 3 and not a full overwrite of somebody else's concurrent edit. Coordinates are handled as the pair the API treats them as: both or neither, emptying both sends `clearCoordinates` rather than silently dropping the edit, and a space without a pin says so plainly on the card and in the detail view rather than showing blanks — the app cannot navigate to it. Writes are gated on the new `board:prayerspace:write`. An account with only `board:content:read` gets the read-only view it has today, with the write affordances absent rather than disabled. The route guard is widened alongside the nav entry, since hiding a link is not authorization. Also here: `TopBar.jsx` loses a dead `production` variable that was failing lint. `npm run typecheck`, `npm run lint` and `npm run api:check` all pass. Create, edit, delete and the type→audience derivation verified against a live backend. Note for review: this repo's working tree carries a large, unrelated, uncommitted console rewrite, and several files here (`shell/nav.js`, `shell/TopBar.jsx`, `services/MinbarService.js`) belong to it — they appear as new because they have never been committed. This branch is a slice on top of that work and will not build against `develop` until the rest of it lands. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
lensbridgefrontend | 6f3421b | Commit Preview URL Branch Preview URL |
Sep 10 2026, 04:55 PM |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on LensBridge/LensBridgeBackend#16, which adds the CRUD this drives.
The page was read-only, and its own doc comment said so: "the backend exposes
GET /api/minbar/prayer-spacesand nothing to write with… a space can only be changed by editing the database directly."NOTES-FOR-BACKEND.md§1 called it the single biggest hole. This closes it, and that section is removed.What changed
The page loads the admin list — every space, unfiltered — rather than the audience-scoped endpoint the app uses, because a console editing the sisters' musallah has to open it whoever is signed in. The audience control stays, now as a client-side filter defaulting to All.
Type and audience are different questions, and the form says so instead of leaving an operator to guess. Type is what kind of room it is: the label on the card and the filter on the map. Audience is who it is listed to. They agree for a gendered musallah and diverge for everything else. On create, audience follows the type until the operator overrides it; on edit it never moves on its own, so relabelling a sisters-only bay cannot quietly publish it to the whole campus.
Saves send only what changed. The form diffs against a record refetched when the editor opens, so "I fixed a typo in step 3" is a patch to step 3 and not a full overwrite of somebody else's concurrent edit.
Coordinates are handled as the pair the API treats them as: both or neither, emptying both sends
clearCoordinatesrather than silently dropping the edit, and a space without a pin says so plainly rather than showing blanks — the app cannot navigate to it.The step-by-step preview is preserved. That is what the page was already good for: it renders what a student walking to Jummah would be shown, so a wrong entrance or a stale walk time is visible here rather than reported from the hallway.
Authorization
Writes gated on the new
board:prayerspace:write. An account with onlyboard:content:readgets the read-only view it has today, with write affordances absent rather than disabled. The route guard inApp.jsxis widened alongside the nav entry, since hiding a link is not authorization.Testing
npm run typecheck,npm run lintandnpm run api:checkall pass.Driven in Chrome against a live backend: the unfiltered list, the detail view, a real create (including watching audience derive from type), a patch, a delete, and the resulting rows landing in the audit log with the right actor and target.
This repo's working tree carries a large, unrelated, uncommitted console rewrite —
src/components/ui/,src/components/shell/, most ofsrc/pages/, and several services exist nowhere in git, on any branch. Some files in this diff (shell/nav.js,shell/TopBar.jsx,services/MinbarService.js) belong to that work and appear as new here only because they have never been committed.This branch is therefore a slice on top of uncommitted work and will not build against
developuntil the rest of that rewrite lands. I deliberately did not sweep ~100 files of unrelated authorship into this commit.schema.d.tsalso carries a large regeneration diff: the committed spec was stale against the backend well beyond this feature.Also included:
TopBar.jsxloses a deadproductionvariable that was failing lint.🤖 Generated with Claude Code