Skip to content

feat: hide help menu based on enterprise config directive#2018

Merged
peppescg merged 2 commits intomainfrom
feat/help-menu-config
Apr 16, 2026
Merged

feat: hide help menu based on enterprise config directive#2018
peppescg merged 2 commits intomainfrom
feat/help-menu-config

Conversation

@peppescg
Copy link
Copy Markdown
Collaborator

Summary

  • Add HELP_MENU permission key to gate the ? help icon visibility
  • Conditionally render HelpDropdown in TopNav using canShow(PERMISSION_KEYS.HELP_MENU)
  • Add unit tests for both visible and hidden states

When the enterprise config server sets help_menu.value: false, the help menu is hidden. Defaults to visible when unset or true.

Refs: stacklok/stacklok-enterprise-platform#416

Test plan

  • pnpm run lint passes
  • pnpm run type-check passes
  • TopNav tests pass (12/12 including 2 new)
  • Manual: verify ? icon visible in OSS build
  • Manual: verify ? icon hidden when enterprise config sets help_menu: false

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings April 16, 2026 13:18
@peppescg peppescg self-assigned this Apr 16, 2026
peppescg and others added 2 commits April 16, 2026 15:21
Add HELP_MENU permission key and conditionally render HelpDropdown
in TopNav based on the permission, following the same pattern as
SETTINGS_REGISTRY_TAB and PLAYGROUND_MENU.

Refs: stacklok/stacklok-enterprise-platform#416

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Verify HelpDropdown is shown by default and hidden when
HELP_MENU permission is disabled, matching the existing
PLAYGROUND_MENU test pattern.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@peppescg peppescg force-pushed the feat/help-menu-config branch from e756de1 to 1c2ac98 Compare April 16, 2026 13:22
@github-actions github-actions Bot added size/XS and removed size/S labels Apr 16, 2026
Copy link
Copy Markdown
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

Adds a new permissions gate intended to allow enterprise configuration to hide the TopNav help menu, and updates related UI/tests. Also changes the Settings “Registry” tab behavior from “hidden when disabled” to “visible but read-only”.

Changes:

  • Add PERMISSION_KEYS.HELP_MENU and gate HelpDropdown rendering in TopNav via canShow(...).
  • Change Settings “Registry” tab from permission-hidden to always visible, with read-only behavior enforced inside RegistryTab/RegistryForm.
  • Add/adjust unit tests for TopNav help visibility and Registry tab read-only behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
renderer/src/common/contexts/permissions/permission-keys.ts Adds HELP_MENU permission key for gating UI features.
renderer/src/common/components/layout/top-nav/index.tsx Conditionally renders HelpDropdown based on HELP_MENU permission.
renderer/src/common/components/layout/top-nav/tests/top-nav.test.tsx Adds tests asserting Help button is shown/hidden based on HELP_MENU.
renderer/src/common/components/settings/tabs/settings-tabs.tsx Removes permission filtering for the Registry tab (now always present).
renderer/src/common/components/settings/tabs/tests/settings-tabs.test.tsx Updates test to expect Registry tab visible but read-only when permission is disabled.
renderer/src/common/components/settings/registry/registry-tab.tsx Introduces read-only mode based on SETTINGS_REGISTRY_TAB permission.
renderer/src/common/components/settings/registry/registry-form.tsx Implements read-only behavior by disabling fields and hiding action buttons.
renderer/src/common/components/settings/tabs/tests/registry-tab.test.tsx Wraps tests with PermissionsProvider and adds read-only regression test.

Comment thread renderer/src/common/contexts/permissions/permission-keys.ts
@peppescg peppescg linked an issue Apr 16, 2026 that may be closed by this pull request
5 tasks
Copy link
Copy Markdown
Collaborator

@samuv samuv left a comment

Choose a reason for hiding this comment

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

⛓️

@peppescg peppescg merged commit ad592e6 into main Apr 16, 2026
19 checks passed
@peppescg peppescg deleted the feat/help-menu-config branch April 16, 2026 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: support hiding Help menu via PermissionProvider

3 participants