Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions ui/src/Sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@ const Sidebar: React.FC<{ isFips?: boolean }> = ({ isFips = false }) => {
const isImportItem =
item.key && (item.key.includes("/import") || item.key.includes("/import-") || item.label === "Import");

// // Handle disabled state based on access rights
if (isCreateItem || isImportItem) {
const isProduction = import.meta.env.MODE === 'production';
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This introduces single quotes for the MODE comparison, but the UI is formatted with Prettier configured for double quotes (ui/.prettierrc.json sets singleQuote: false). This will cause pnpm run check (prettier --check) to fail unless the string literal is switched to double quotes (or the file is reformatted).

Suggested change
const isProduction = import.meta.env.MODE === 'production';
const isProduction = import.meta.env.MODE === "production";

Copilot uses AI. Check for mistakes.

// Handle disabled state based on access rights
if (isProduction && (isCreateItem || isImportItem)) {
Comment on lines +46 to +47
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The inline comment "Handle disabled state based on access rights" is now slightly inaccurate because the disabled state is only applied in production. Update the comment to reflect the production-only behavior to avoid confusion during local development/debugging.

Copilot uses AI. Check for mistakes.
newItem.disabled = !hasCreateAccess;
Comment on lines +44 to 48
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

isProduction is invariant for all menu items but is recomputed inside items.map(...) (and again for each recursive child). Consider computing it once outside processItems (or at least once per processMenuItems call) to avoid unnecessary repeated work and to make the intent clearer.

Copilot uses AI. Check for mistakes.
}

Expand Down
Loading