-
Notifications
You must be signed in to change notification settings - Fork 115
Simplify JWT form #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify JWT form #301
Conversation
trean
commented
Jul 11, 2025
| Before: | After: |
|---|---|
![]() |
![]() |
There was a problem hiding this comment.
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 refactors the JWT generation UI by simplifying the layout and access controls using a slider and a table, removing the old result form and dead code.
- Wraps the form in a centered frame and removes the dual-pane layout
- Replaces checkbox toggles and a modal with a slider (
StyledSlider) and per-collection table (JwtPerCollection) - Removes
JwtResultForm, cleans up imports, and exports a newHeaderTableCell
Reviewed Changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pages/Jwt.jsx | Refactored page layout to CenteredFrame, removed JwtResultForm and dead code |
| src/components/JwtSection/JwtResultForm.jsx | Removed unused ESLint comment |
| src/components/JwtSection/JwtPerCollection.jsx | Added new CollectionAccessToggle table for per-collection access |
| src/components/JwtSection/JwtForm.jsx | Switched to slider-based access control and integrated JwtPerCollection |
| src/components/Common/TableWithGaps.jsx | Added HeaderTableCell export |
| src/components/Common/StyledSlider.jsx | Introduced StyledSlider for access level marking |
| src/components/Collections/CollectionsList.jsx | Updated import to use HeaderTableCell |
| if (globalAccess) { | ||
| setValue('r'); | ||
| } else if (manageAccess) { | ||
| setValue('rw'); |
Copilot
AI
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The effect prioritizes globalAccess over manageAccess, but when manageAccess is true, globalAccess is also true, so write access ('rw') never gets set. Swap the checks to handle manageAccess first.
| if (globalAccess) { | |
| setValue('r'); | |
| } else if (manageAccess) { | |
| setValue('rw'); | |
| if (manageAccess) { | |
| setValue('rw'); | |
| } else if (globalAccess) { | |
| setValue('r'); |
Copilot uses AI. Check for mistakes.
| </Box> | ||
| </Box> | ||
|
|
||
| {collections.length && ( |
Copilot
AI
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using collections.length && ... renders 0 when the list is empty. Change this to collections.length > 0 && ... to avoid outputting a zero.
| {collections.length && ( | |
| {collections.length > 0 && ( |
Copilot uses AI. Check for mistakes.
|
|
||
| function Jwt() { | ||
| const headerHeight = 64; | ||
| // const headerHeight = 64; |
Copilot
AI
Jul 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Remove this commented-out headerHeight constant since it is no longer used and clutters the code.
| // const headerHeight = 64; | |
Copilot uses AI. Check for mistakes.

