Skip to content

Temporary hide settings page - #47

Merged
LuisSchweinberger merged 1 commit into
robotik-challenge-mainfrom
hide-settings-from-sidebar
May 29, 2026
Merged

Temporary hide settings page#47
LuisSchweinberger merged 1 commit into
robotik-challenge-mainfrom
hide-settings-from-sidebar

Conversation

@LuisSchweinberger

Copy link
Copy Markdown
Collaborator

This pull request introduces a temporary feature flag to disable the settings page until authentication is properly implemented. The main changes add a DISABLE_SETTINGS environment variable, which, when set, hides the settings page from both navigation and direct access.

Feature flag for disabling settings page:

  • Added a new DISABLE_SETTINGS environment variable to the environment configuration and initial values (src/lib/env/MnestixEnv.ts, src/app/EnvProvider.tsx). [1] [2] [3]
  • Updated the settings page to redirect to the homepage if DISABLE_SETTINGS is true, preventing direct access (src/app/[locale]/settings/page.tsx). (src/app/[locale]/settings/page.tsxR27-R31)
  • Modified the main menu to hide the settings navigation link when DISABLE_SETTINGS is true (src/layout/menu/MainMenu.tsx).

Developer notes:

Copilot AI review requested due to automatic review settings May 27, 2026 14:38

Copilot AI 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.

Pull request overview

This PR adds a temporary environment-driven feature flag to hide the Settings page until authentication is implemented, removing it from navigation and preventing direct access.

Changes:

  • Introduces a DISABLE_SETTINGS env variable and exposes it via the client env context.
  • Hides the Settings menu entry when the flag is enabled.
  • Redirects away from /settings when the flag is enabled.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/lib/env/MnestixEnv.ts Adds DISABLE_SETTINGS to the public env surface and parses it from process.env.
src/app/EnvProvider.tsx Adds DISABLE_SETTINGS to the client-side initial env values.
src/layout/menu/MainMenu.tsx Conditionally removes the Settings navigation item when the flag is enabled.
src/app/[locale]/settings/page.tsx Redirects users away from the Settings page when the flag is enabled.
Comments suppressed due to low confidence (1)

src/layout/menu/MainMenu.tsx:126

  • New behavior hides the settings entry when env.DISABLE_SETTINGS is true, but the existing component tests for MainMenu only assert that /settings is present for admins. Please add/update a test case in MainMenu.spec.tsx that sets DISABLE_SETTINGS: true in the mocked env and asserts the settings menu item is not rendered.
    // HACK: Temporary workaround to hide the settings page until auth is implemented correctly.
    if (checkIfRouteIsAllowed('/settings') && !env.DISABLE_SETTINGS) {
        const settingsMenu = {
            label: t('settings'),
            to: '/settings',
            icon: <Settings data-testid="settings-menu-icon" />,
        };
        basicMenu.push(settingsMenu);
    }

Comment thread src/app/[locale]/settings/page.tsx
Comment thread src/lib/env/MnestixEnv.ts
Comment thread src/lib/env/MnestixEnv.ts
Comment thread src/lib/env/MnestixEnv.ts
@LuisSchweinberger
LuisSchweinberger merged commit a4b6f4c into robotik-challenge-main May 29, 2026
11 checks 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