Skip to content

feat: add banking app screen hook#369

Open
barredterra wants to merge 1 commit into
version-16-hotfixfrom
v16-hotfix-app-screen
Open

feat: add banking app screen hook#369
barredterra wants to merge 1 commit into
version-16-hotfixfrom
v16-hotfix-app-screen

Conversation

@barredterra
Copy link
Copy Markdown
Member

@barredterra barredterra commented May 21, 2026

Summary

  • Add an apps-screen entry for the banking app.
  • Route the app card to the v16 desk path for the banking sidebar.

Test plan

  • pre-commit run ruff --files banking/hooks.py
  • pre-commit run ruff-format --files banking/hooks.py

Greptile Summary

This PR adds an apps-screen entry for the ALYF Banking app by introducing the add_to_apps_screen hook and an app_home variable pointing to the v16 workspace sidebar route.

  • Adds app_home = "/desk/alyf-banking" to define the default landing route for the banking sidebar, and reuses it in the new add_to_apps_screen list so the banking tile routes correctly.
  • The logo path (/assets/banking/images/logo.png) resolves to an existing asset, and app_name/app_title are used by reference so they stay in sync with the top-level declarations.

Confidence Score: 4/5

Safe to merge; the change is small and isolated to hook registration with no impact on existing functionality.

The change is minimal — two new module-level declarations in hooks.py. The logo asset already exists, variables are referenced correctly, and the target route matches the Workspace Sidebar record. The only open question is whether the apps-screen tile should carry a has_permission check to avoid showing it to users without banking access.

No files require special attention beyond the optional has_permission consideration in banking/hooks.py.

Important Files Changed

Filename Overview
banking/hooks.py Adds app_home variable and add_to_apps_screen hook to register the banking app on Frappe's apps screen; logo path resolves correctly, no breaking changes to existing hooks.

Sequence Diagram

sequenceDiagram
    actor User
    participant AppsScreen as Frappe Apps Screen
    participant Hook as add_to_apps_screen hook
    participant BankingApp as Banking App (/desk/alyf-banking)

    User->>AppsScreen: Open apps screen
    AppsScreen->>Hook: Load app entries
    Hook-->>AppsScreen: "{name:"banking", logo, title:"ALYF Banking", route:"/desk/alyf-banking"}"
    AppsScreen-->>User: Render Banking tile
    User->>AppsScreen: Click Banking tile
    AppsScreen->>BankingApp: Navigate to /desk/alyf-banking
    BankingApp-->>User: Workspace Sidebar (ALYF Banking)
Loading

Fix All in Cursor

Reviews (1): Last reviewed commit: "feat: add banking app screen hook" | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

Comment thread banking/hooks.py
Comment on lines +10 to +17
add_to_apps_screen = [
{
"name": app_name,
"logo": "/assets/banking/images/logo.png",
"title": app_title,
"route": app_home,
}
]
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Missing has_permission guard on apps-screen entry

Without a has_permission callable, the Banking app card is shown to every authenticated user on the apps screen — including users who have no banking-related roles or permissions. Frappe's add_to_apps_screen hook supports an optional has_permission dotted-path string (e.g. "banking.hooks.has_banking_permission") that lets you hide the tile for users who shouldn't see it.

Fix in Cursor

@barredterra barredterra force-pushed the v16-hotfix-app-screen branch from 595d2dd to 309a844 Compare May 21, 2026 12:22
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