Skip to content

Therapy: list the Review sign-off queue for site administrators only - #3514

Merged
gitar-bot[bot] merged 3 commits into
mainfrom
claude/admin-role-access-k6ghqt
Oct 13, 2026
Merged

gitar-bot[bot] merged 3 commits into
mainfrom
claude/admin-role-access-k6ghqt

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Oct 13, 2026 •

Copy link
Copy Markdown
Owner

User description

Summary

  • Before: every reader saw the "Review queue" link (the Therapy sign-off queue) on the Therapy search page.
  • After: only a site administrator sees that link. The route itself is unchanged, and the server still refuses a sign-off from anyone else.
  • How: the search page checks isAdministratorUser on the signed-in session before rendering the link. The registry entry also gets audience: "administrators", so every navigation consumer that filters by audience agrees. An earlier commit wired the top bar's page list too. It is reverted because Therapy has a results surface, so that list never shows Therapy's pages (Codex review).

Verification

  • Checks run: npx vitest run tests/therapy-compact-row.dom.test.tsx tests/mode-secondary-navigation.test.ts gave "Tests 66 passed (66)". This covers new administrator and reader cases for the link and for the navigation filter. npm run typecheck passed, and eslint and prettier are clean on the changed files. Browser tests and the bundle budget are left to CI.

Risk and rollout

  • Risk: low. The change affects navigation visibility only. A reader who isn't an administrator can still open /therapy-compass/review directly.
  • Rollback: revert the PR.
  • Provider or production effects: none.

Notes

🤖 Generated with Claude Code

https://claude.ai/code/session_01VRAKeUNKFmnQHMbMmnHWDW


CodeAnt-AI Description

Show Therapy review queue links only to site administrators

What Changed

  • The Review queue link on the Therapy search page is now visible only to site administrators.
  • Therapy navigation lists the Review page only for site administrators. The page itself remains directly accessible to all users.

Impact

✅ Fewer review links for non-administrator readers
✅ Review queue remains easy for administrators to find
✅ Direct access to the review page is unchanged

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

The owner's account now carries the site administrator role, so the queue's
page-list entry can be limited to administrators. The route still opens for
anyone and the server still refuses sign-offs from non-administrators.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRAKeUNKFmnQHMbMmnHWDW
@supabase

supabase Bot commented Oct 13, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@greptile-apps greptile-apps Bot 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.

BigSimmo has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🤖 CodeAnt AI — Review Status

Status Commit Started (UTC) Finished (UTC)
✅ Incremental review completed 2d2733a Oct 13, 2026 · 09:13 09:13
✅ Reviewed your PR e417201 Oct 13, 2026 · 05:53 05:57

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@coderabbitai

coderabbitai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 73cbe9b1-b21b-4b85-b027-a9ea20637986
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-13T05:57:26.745059Z e417201 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@claude

claude Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude encountered an error after 2s —— View job


I'll analyze this and get back to you.

@codeant-ai codeant-ai Bot added the size:S This PR changes 10-29 lines, ignoring generated files label Oct 13, 2026
@qodo-code-review

Copy link
Copy Markdown
Contributor

PR Summary by Qodo

Show Therapy Review in the page list only to administrators

✨ Enhancement 🧪 Tests 🕐 10-20 Minutes

Grey Divider

AI Description

• Limit the Therapy Review page-list entry to site administrators.
• Pass the signed-in user's administrator status to the page-list filter; routes and sign-off
 permissions remain unchanged.
• Test that the Review entry is hidden from non-administrators and shown to administrators.
Diagram

graph TD
  Session["Signed-in session"] --> Role["Administrator check"] --> Filter["Visibility filter"] --> List["Pages sheet"]
  Registry["Therapy page registry"] --> Filter
  Filter --> Hidden["Review omitted"]
Loading
High-Level Assessment

Using the existing audience filter and administrator claim check is the smallest consistent change. Route-level gating was not chosen because this change concerns navigation visibility, not access to the route; server-side sign-off authorization remains in place.

Files changed (3) +17 / -4

Enhancement (2) +9 / -4
master-search-header.tsxFilter the page list by administrator status +5/-1

Filter the page list by administrator status

• Reads administrator status from the signed-in session and passes it to the existing page-list visibility filter.

src/components/clinical-dashboard/master-search-header.tsx

mode-secondary-navigation.tsMark Therapy Review as administrator-only +4/-3

Mark Therapy Review as administrator-only

• Adds the administrators audience to the Review entry. The entry remains registered in the More group, so its route and page identification are unchanged.

src/lib/mode-secondary-navigation.ts

Tests (1) +8 / -0
mode-secondary-navigation.test.tsCover Review visibility for both administrator states +8/-0

Cover Review visibility for both administrator states

• Tests that the visibility filter omits Review for non-administrators and includes it for administrators.

tests/mode-secondary-navigation.test.ts

@gitar-bot
gitar-bot Bot enabled auto-merge (squash) October 13, 2026 05:54
gitar-bot[bot]
gitar-bot Bot previously approved these changes Oct 13, 2026

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR (configure)

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🏁 CodeAnt Quality Gate Results

Commit: 2d2733a0
Scan Time: 2026-10-13 09:46:26 UTC

✅ Overall Status: PASSED

Quality Gate Details

Quality Gate Status Details
Secrets ✅ PASSED 0 secrets found
Duplicate Code ✅ PASSED 0.0% duplicated
SAST ✅ PASSED No security issues
Bugs ✅ PASSED Rating S: No bugs
IAC ✅ PASSED No IAC issues

View Full Results

@codspeed

codspeed Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 2 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 1 benchmark has no flame graph

The flamegraph could not be generated because too much time was spent in runtime internals, making the visualization not useful for performance analysis.

✅ 8 untouched benchmarks


Comparing claude/admin-role-access-k6ghqt (2d2733a) with main (a09d17a)

Open in CodSpeed

@qodo-code-review

qodo-code-review Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can turn these tips off under Display > Comment parts

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Previous reviews

Review updated until commit 05859a7 ⚖️ Balanced

Results up to commit e417201 ⚖️ Balanced


No changes from previous review

Grey Divider

Qodo Logo

@qodo-code-review

Copy link
Copy Markdown
Contributor

Qodo Fixer

No findings are available for this PR yet. Findings appear here once Qodo has reviewed the PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e417201367

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@codeant-ai

codeant-ai Bot commented Oct 13, 2026

Copy link
Copy Markdown

CodeAnt Nitpicks

1 code suggestion

1. For administrators, this exposes Review in More, whose fixed hint says “Moving to their own modes”; Review is an existing Therapy page, so that explanation is false.

Possible bug · src/components/clinical-dashboard/master-search-header.tsx:1402

@codeant-ai

codeant-ai Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

CodeAnt PR Risk: Medium Risk

  • The PR needs attention before merging because the review route remains directly accessible to non-admins.
  • The UI hides the link, but the stated server restriction only denies sign-off; verify that non-admins cannot view the queue contents.

Assessed commit: 2d2733a0396d

…ors only

Therapy has a results surface, so the top bar's page list never lists its
pages; the header wiring had no effect and is reverted. The link on the
Therapy search page is where readers actually reach Review, so that is
what is now limited to administrators.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VRAKeUNKFmnQHMbMmnHWDW

@gitar-bot gitar-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Gitar has auto-approved this PR (configure)

@qodo-code-review

Copy link
Copy Markdown
Contributor

Code review by qodo was updated up to the latest commit 05859a7

@qodo-code-review

qodo-code-review Bot commented Oct 13, 2026 •

Copy link
Copy Markdown
Contributor

No code changes since the last review — review skipped

Qodo Logo

@codeant-ai codeant-ai Bot added size:M This PR changes 30-99 lines, ignoring generated files and removed size:S This PR changes 10-29 lines, ignoring generated files labels Oct 13, 2026
@gitar-bot

gitar-bot Bot commented Oct 13, 2026

Copy link
Copy Markdown
Contributor
Code Review ✅ Approved

🟡 Medium risk · Hiding the Therapy Review queue link from non-administrators could make the queue harder for them to discover; direct-route access and sign-off authorization remain unchanged.

Restricts the Therapy search page's "Review queue" link and the registry navigation entry to site administrators by checking isAdministratorUser on the session and setting audience: "administrators". The route and server-side sign-off checks are unchanged. No issues found.

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Approved

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Counting what did not apply, without listing it.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@gitar-bot
gitar-bot Bot merged commit f4bcb55 into main Oct 13, 2026
41 of 42 checks passed
@gitar-bot
gitar-bot Bot deleted the claude/admin-role-access-k6ghqt branch October 13, 2026 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🟠 Medium blast radius size:M This PR changes 30-99 lines, ignoring generated files 🕐 10-20 Minutes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants