feat: hide help menu based on enterprise config directive#2018
Merged
feat: hide help menu based on enterprise config directive#2018
Conversation
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>
e756de1 to
1c2ac98
Compare
Contributor
There was a problem hiding this comment.
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_MENUand gateHelpDropdownrendering inTopNavviacanShow(...). - 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. |
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
HELP_MENUpermission key to gate the?help icon visibilityHelpDropdowninTopNavusingcanShow(PERMISSION_KEYS.HELP_MENU)When the enterprise config server sets
help_menu.value: false, the help menu is hidden. Defaults to visible when unset ortrue.Refs: stacklok/stacklok-enterprise-platform#416
Test plan
pnpm run lintpassespnpm run type-checkpasses?icon visible in OSS build?icon hidden when enterprise config setshelp_menu: false🤖 Generated with Claude Code