Skip to content

feat: apps screen entry and sidebar app switcher - #187

Merged
NagariaHussain merged 2 commits into
developfrom
feat/apps-screen-entry
Aug 28, 2026
Merged

feat: apps screen entry and sidebar app switcher#187
NagariaHussain merged 2 commits into
developfrom
feat/apps-screen-entry

Conversation

@NagariaHussain

@NagariaHussain NagariaHussain commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Why?

Hive was not registered on the site's apps screen, so it did not show up on /apps or 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?

  1. Hive is listed on the apps screen: title "Hive", route /hive, app mark logo, permission-gated.
  2. The sidebar header dropdown gains a "Switch app" submenu listing the site's other apps, plus Desk.

How?

  • add_to_apps_screen in hooks.py, gated by has_hive_access (bwh_hive/bwh_hive/permissions.py): Administrator, System Manager, Hive Team and Hive Client see the row; nobody else does.
  • The logo is copied to bwh_hive/public/images/hive-mark.svg so it is served from /assets/bwh_hive/. The Vite build output under bwh_hive/public/frontend/ is gitignored and cannot be the source.
  • The switcher reads 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 client-side, and only for System Managers — a client user would land on a permission error. is_system_manager rides along in the boot dict rather than costing a request.

Ported as-is from the same pattern in VMS.

Testing

  • frappe.apps.get_apps returns the Hive row on pms.localhost; the logo URL returns 200.
  • New Playwright spec 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

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-apps

greptile-apps Bot commented Aug 28, 2026

Copy link
Copy Markdown

Greptile Summary

The PR registers Hive on Frappe’s apps screen and adds an app-switching submenu to Hive’s sidebar.

  • Adds a role-gated apps-screen entry and static Hive mark asset.
  • Exposes System Manager status through boot data for Desk visibility.
  • Loads installed apps into the sidebar and adds end-to-end coverage for switching to Desk.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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
@NagariaHussain NagariaHussain changed the title feat: list Hive on the site's apps screen feat: apps screen entry and sidebar app switcher Aug 28, 2026
@NagariaHussain
NagariaHussain merged commit ce9a854 into develop Aug 28, 2026
4 of 5 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.

1 participant