KEMBAR78
Simplify JWT form by trean · Pull Request #301 · qdrant/qdrant-web-ui · GitHub
Skip to content

Conversation

@trean
Copy link
Contributor

@trean trean commented Jul 11, 2025

Before: After:
image image

@trean trean requested review from Copilot and generall July 11, 2025 16:07
Copy link
Contributor

Copilot AI left a 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 new HeaderTableCell

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

Comment on lines 15 to 18
if (globalAccess) {
setValue('r');
} else if (manageAccess) {
setValue('rw');
Copy link

Copilot AI Jul 11, 2025

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.

Suggested change
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 && (
Copy link

Copilot AI Jul 11, 2025

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.

Suggested change
{collections.length && (
{collections.length > 0 && (

Copilot uses AI. Check for mistakes.


function Jwt() {
const headerHeight = 64;
// const headerHeight = 64;
Copy link

Copilot AI Jul 11, 2025

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.

Suggested change
// const headerHeight = 64;

Copilot uses AI. Check for mistakes.

@generall generall merged commit dd3afe4 into master Jul 15, 2025
1 check passed
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.

2 participants