feat: apps screen entry and sidebar app switcher - #187
Merged
Conversation
Register the app with `add_to_apps_screen` so Hive appears on /apps and in other apps' app switchers, gated by `has_hive_access` so only System Managers, Hive Team and Hive Client users see the row. The logo lives in the app's own public folder rather than the Vite build output, which is gitignored. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014AupF7Eoc6JnGv1gaiQY6G
Greptile SummaryThe PR registers Hive on Frappe’s apps screen and adds an app-switching submenu to Hive’s sidebar.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| bwh_hive/bwh_hive/permissions.py | Adds an apps-screen visibility predicate covering Administrator and the established Hive and System Manager roles. |
| bwh_hive/hooks.py | Registers Hive’s title, route, logo, and permission callback with Frappe’s apps screen. |
| bwh_hive/www/hive.py | Adds a boot-time System Manager flag used to conditionally expose Desk. |
| frontend/src/components/shell/AppSidebar.vue | Fetches the site’s registered apps and presents them through a nested sidebar switcher while excluding Hive itself. |
| frontend/src/composables/useSession.ts | Exposes the boot-time System Manager flag as shared computed session state. |
| e2e/tests/app-switcher.spec.ts | Covers switcher visibility, current-app exclusion, installed-app labels, and Desk navigation. |
Reviews (2): Last reviewed commit: "feat: add an app switcher to the sidebar..." | Re-trigger Greptile
The header dropdown gains a "Switch app" submenu built from `frappe.apps.get_apps`, so it tracks whatever the site has installed without a Hive-side registry. Hive itself is filtered out. Desk is not on the apps screen, so it is added by hand — only for System Managers, since a client user would land on a permission error. The flag rides along in the boot dict rather than costing a request. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014AupF7Eoc6JnGv1gaiQY6G
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.
Why?
Hive was not registered on the site's apps screen, so it did not show up on
/appsor in the app switcher of other Frappe UI apps on the same site — and Hive's own sidebar had no way to switch to another app either.What?
/hive, app mark logo, permission-gated.How?
add_to_apps_screeninhooks.py, gated byhas_hive_access(bwh_hive/bwh_hive/permissions.py): Administrator, System Manager, Hive Team and Hive Client see the row; nobody else does.bwh_hive/public/images/hive-mark.svgso it is served from/assets/bwh_hive/. The Vite build output underbwh_hive/public/frontend/is gitignored and cannot be the source.frappe.apps.get_apps, so it tracks whatever the site has installed without a Hive-side registry. Hive itself is filtered out.is_system_managerrides along in the boot dict rather than costing a request.Ported as-is from the same pattern in VMS.
Testing
frappe.apps.get_appsreturns the Hive row onpms.localhost; the logo URL returns 200.e2e/tests/app-switcher.spec.ts— opens the header dropdown, checks Desk and the site's other apps are offered, checks Hive is not, and follows the Desk row. Passing.🤖 Generated with Claude Code
https://claude.ai/code/session_014AupF7Eoc6JnGv1gaiQY6G