3.4 KiB
Installed Apps Modal Actions Design
Background
The installed-apps modal currently renders each installed app row with display information and an uninstall button only. It no longer exposes any path to launch an installed app or open that app's detail modal.
As a result:
- Users cannot launch apps from the installed-apps manager.
- Clicking apps that are already listed in the store no longer opens their detail view from that manager.
The parent app already has working handlers for both behaviors:
openDownloadedApp(pkgname, origin)for launchingopenDetail(app)for showing app details
The regression is therefore in the modal interaction layer rather than in the launch backend itself.
Goals
- Restore a direct “open app” action in the installed-apps modal.
- Restore a “view details” action for installed apps that can be matched to store detail data.
- Reuse the existing parent handlers instead of creating a second launch/detail path.
- Keep uninstall behavior unchanged.
- Keep the change local to the installed-apps modal and its parent wiring.
Non-Goals
- Do not redesign the whole installed-apps UI.
- Do not change uninstall flow.
- Do not add a brand new launcher backend.
- Do not change app-detail modal behavior itself.
Recommended Approach
Add two explicit actions to each installed-app row:
打开- always available for installed apps, routed to the existing launch handler.查看详情- available only when the app has enough store metadata to open a meaningful detail modal.
The modal emits these actions upward, and App.vue wires them to the existing parent methods. This restores behavior with minimal code movement and avoids duplicating launch or detail logic.
UI Behavior
Open action
- Every installed app row gets an
打开button. - Clicking it emits the installed app object upward.
- The parent maps this to
openDownloadedApp(app.pkgname, app.origin).
Detail action
- Installed apps that can be resolved to a store-backed detail view get a
查看详情button. - The modal should treat an app as detail-capable when its data is sufficient for the existing
openDetailpath, specifically when:- it has a non-
unknowncategory, or - it already carries enough store-backed fields to be opened meaningfully by the current parent logic.
- it has a non-
- Clicking it emits the app upward.
- The parent maps this to
openDetail(app).
Uninstall action
- The existing
卸载button remains unchanged.
Event Contract
InstalledAppsModal.vue should expose two additional emits:
open-appopen-detail
App.vue should listen to both and route them to existing functions, not wrappers with new behavior.
Data Flow
refreshInstalledApps()continues building the installed app list.- Each installed app row decides whether the detail action is available.
- Modal emits the chosen action with the clicked app.
- Parent receives the event and invokes the existing launch/detail flow.
Testing
Add focused unit coverage for the modal:
- It renders the
打开button for installed items. - It renders the
查看详情button only when the app is detail-capable. - It emits
open-appwhen the open button is clicked. - It emits
open-detailwhen the detail button is clicked.
The tests do not need to re-test the internals of openDownloadedApp() or openDetail(); they only need to prove the modal restores the event path correctly.