Task #609: Per-user app enable/disable in Settings
- New `user_hidden_apps` table (userId+appId composite PK, cascade) in
lib/db/src/schema/user-hidden-apps.ts; registered in schema index;
pushed to dev DB via drizzle-kit.
- Backend (artifacts/api-server/src/routes/apps.ts):
- GET /me/apps — returns every globally-active app visible to the
user with a `hidden` flag.
- PUT /me/apps/:appId/hidden — toggles a row in user_hidden_apps,
gated by getVisibleAppsForUser + isActive so a user can't toggle
apps they can't reach.
- GET /apps (Home/Dock) now uses getVisibleNonHiddenAppsForUser so
hidden apps disappear immediately.
- lib/appsVisibility.ts: added getHiddenAppIdsForUser and
getVisibleNonHiddenAppsForUser helpers.
- OpenAPI: added /me/apps + /me/apps/{appId}/hidden, MyApp and
UpdateMyAppHiddenBody schemas; regenerated api-zod + api-client-react.
- Frontend (settings-panel.tsx): added "My apps" accordion section as
first GroupItem with MyAppsBody — Switch per app, optimistic update,
invalidates getListMyAppsQueryKey + getListAppsQueryKey so Home/Dock
refresh without reload.
- Translations: added settingsPanel.section.myApps + settingsPanel.myApps
in ar.json + en.json.
- Code review fix: /me/apps and PUT gating filter isActive even for
admins, so inactive apps don't appear in the Settings list.
- Proposed follow-up #611 (Playwright test that hidden apps disappear
from Home and Dock).
This commit is contained in:
@@ -199,6 +199,7 @@
|
||||
"settingsPanel": {
|
||||
"title": "Settings",
|
||||
"section": {
|
||||
"myApps": "My apps",
|
||||
"language": "Language",
|
||||
"notifications": "Notifications",
|
||||
"sound": "Sound",
|
||||
@@ -210,6 +211,10 @@
|
||||
},
|
||||
"sound": {
|
||||
"master": "Play notification sounds"
|
||||
},
|
||||
"myApps": {
|
||||
"loading": "Loading apps…",
|
||||
"empty": "No apps available."
|
||||
}
|
||||
},
|
||||
"notifSettings": {
|
||||
|
||||
Reference in New Issue
Block a user