86 lines
3.2 KiB
Markdown
86 lines
3.2 KiB
Markdown
---
|
|
id: PLN-0163
|
|
ticket: hub-suspended-game-kill-affordance
|
|
title: Render Hub Suspended Game Kill Control
|
|
status: done
|
|
created: 2026-07-05
|
|
ref_decisions: [DEC-0040]
|
|
tags: [hub, lifecycle, game, ui]
|
|
---
|
|
|
|
## Briefing
|
|
|
|
DEC-0040 requires the Hub to show a red bottom-right control when a `Game` cartridge is resident/suspended, displaying only the game title and killing the game immediately on click.
|
|
|
|
## Objective
|
|
|
|
Render and handle the Hub suspended-game kill control using the lifecycle operation from PLN-0164.
|
|
|
|
## Dependencies
|
|
|
|
- Source decision: DEC-0040.
|
|
- Depends on PLN-0164 for the callable resident-game termination operation.
|
|
|
|
## Scope
|
|
|
|
- Show a red box in the bottom-right of the Hub only when a `Game` is resident/suspended.
|
|
- Render only the suspended game's title in that box.
|
|
- Register a click/hitbox for the box.
|
|
- On click, call the canonical resident-game termination operation.
|
|
- Keep the Hub active after the click.
|
|
- Remove the indicator immediately after the resident game is no longer present.
|
|
|
|
## Non-Goals
|
|
|
|
- Do not add confirmation or two-click arming.
|
|
- Do not show shell/system apps in this control.
|
|
- Do not redesign the Hub layout beyond the minimal bottom-right control.
|
|
- Do not add save-state or suspend-state management.
|
|
|
|
## Execution Method
|
|
|
|
1. Identify the Hub rendering and input code.
|
|
- Primary target: `crates/console/prometeu-system/src/programs/prometeu_hub/prometeu_hub.rs`.
|
|
- Determine how Hub cards/buttons currently compute layout and hit testing.
|
|
|
|
2. Add resident-game status to the Hub view model.
|
|
- Read only `Game` resident/suspended state.
|
|
- Include the game title needed for display.
|
|
- Keep the value absent for shell/system apps and for no resident game.
|
|
|
|
3. Render the kill control.
|
|
- Position it in the bottom-right of the internal viewport.
|
|
- Use a red filled box with restrained dimensions.
|
|
- Draw only the game title.
|
|
- Keep the text inside the box for long titles by truncating or fitting according to existing Hub text conventions.
|
|
|
|
4. Add click handling.
|
|
- Use the box hit region.
|
|
- On click, call the resident-game termination operation from PLN-0164.
|
|
- Do not navigate away from Hub.
|
|
- Ensure the next Hub frame no longer renders the control when the resident game is gone.
|
|
|
|
## Acceptance Criteria
|
|
|
|
- [ ] The control appears in Hub only while a `Game` resident/suspended game exists.
|
|
- [ ] The control displays only the game title.
|
|
- [ ] The control is visually red and placed in the bottom-right of the Hub.
|
|
- [ ] Clicking the control kills the resident game immediately.
|
|
- [ ] The Hub remains in Hub after the click.
|
|
- [ ] The control disappears after the game is killed.
|
|
- [ ] Shell/system apps do not appear in this control.
|
|
|
|
## Tests
|
|
|
|
- Hub render/unit test for presence when a resident `Game` exists.
|
|
- Hub render/unit test for absence when no resident game exists.
|
|
- Hub render/unit test for absence for non-Game app modes.
|
|
- Hub click/hitbox test proving the termination operation is invoked.
|
|
- Test for long title handling if existing Hub layout tests cover text bounds.
|
|
|
|
## Affected Artifacts
|
|
|
|
- `crates/console/prometeu-system/src/programs/prometeu_hub/prometeu_hub.rs`
|
|
- Any Hub facade/view-model modules used by the program
|
|
- Hub rendering/input tests
|