Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
bfb8090
feat(mobile): Implement mobile UI
El-Magico777 Feb 11, 2026
fded6b6
feat(mobile): Mobile lobby industrial styling
El-Magico777 Feb 16, 2026
63a25b3
feat(mobile): tune zoom controls for touch usability
El-Magico777 Feb 16, 2026
74d48eb
fix(i18n): resolve public lobby map names via GameMapType
El-Magico777 Feb 18, 2026
abd0200
feat(mobile): landscape and portrait lobby UI
El-Magico777 Feb 17, 2026
06f899c
docs(mobile): update architecture and feature matrix for lobby UI, zoโ€ฆ
El-Magico777 Feb 19, 2026
772c0b2
Mobile UI: state-driven loading/spectator/dead visibility
El-Magico777 Feb 21, 2026
49578ed
Mobile lobby: Map carousel, default closed extra settings, responsiveโ€ฆ
El-Magico777 Feb 21, 2026
be893a4
Add extra-large viewport size class for tablets
El-Magico777 Feb 21, 2026
ff56a70
Polish mobile action grid metal styling and unified sheen
El-Magico777 Feb 22, 2026
f1c4a6f
Force English default locale on mobile devices
El-Magico777 Feb 22, 2026
a04d259
Fix mobile save replay flow and modal actions
El-Magico777 Feb 22, 2026
59a1104
fix(desktop): align map card colors with lobby frame palette on PC
El-Magico777 Feb 22, 2026
e9982e5
feat(mobile): add unit selection and redirection via Action Grid
El-Magico777 Feb 22, 2026
5d9bd8a
docs(mobile): update architecture, feature matrix, and action grid caโ€ฆ
El-Magico777 Feb 22, 2026
60d24ec
feat(mobile): add research completion percentages to toast and tab
El-Magico777 Feb 22, 2026
5ccf0b0
fix(mobile): show naval assault when land attack is also available
El-Magico777 Feb 22, 2026
f4058d7
fix: mobile spawn tap interception beneath top bar in landscape
El-Magico777 Feb 22, 2026
3bc263e
feat: show mobile attack troop amount on attack actions
El-Magico777 Feb 22, 2026
e7abb3b
feat: show attack troop amount in mobile economy slider
El-Magico777 Feb 22, 2026
5ed1b9e
feat: move mobile attack bubbles above action grid
El-Magico777 Feb 22, 2026
6f3de7b
feat: align mobile top-bar side cutouts on wider screens
El-Magico777 Feb 22, 2026
ed82900
feat: align mobile settings sidebar with responsive top-offset system
El-Magico777 Feb 22, 2026
c04bb93
feat: mobile intel panel tablet improvements
El-Magico777 Feb 22, 2026
88b187c
fix: make mobile stack-size labels refresh immediately in stack mode
El-Magico777 Feb 23, 2026
d79a739
fix: decouple mobile research priority overlays from attack bar
El-Magico777 Feb 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 0 additions & 63 deletions .github/copilot-instructions.md

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ out/
static/
coverage/
TODO.txt
PROGRESS.md
resources/images/.DS_Store
resources/.DS_Store
.env*
Expand All @@ -13,3 +14,4 @@ errors.txt
Project_Info.md
commands.sh
gemini/
.github/copilot-instructions.md
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ Until then, open issues, submit pull requests, or join the discussion [on Discor
- `src/scripts` โ€“ Dev or build-time scripts
- `resources/` โ€“ Static assets (flags, fonts, icons, maps, sprites, images)
- `tests/` โ€“ Unit and integration tests for client, core logic, and utilities
- `docs/mobile/` โ€“ Mobile UI documentation (see below)

---

## ๐Ÿ“ฑ Mobile UI Docs

Touch-first mobile layer built with Lit web components under `src/client/mobile/`.

- [Architecture](docs/mobile/MOBILE-ARCHITECTURE.md) โ€” component map, activation lifecycle, event bus, file inventory
- [Feature Matrix](docs/mobile/MOBILE-FEATURE-MATRIX.md) โ€” desktop โ†’ mobile parity table, HUD layout, z-index map
- [Gestures & Haptics](docs/mobile/MOBILE-GESTURES-HAPTICS.md) โ€” gesture detection config, haptic patterns, usage by area
- [Action Grid Catalog](docs/mobile/MOBILE-ACTION-GRID-CATALOG.md) โ€” tile category resolution, full action tables per context

---

Expand Down
196 changes: 196 additions & 0 deletions docs/mobile/MOBILE-ACTION-GRID-CATALOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,196 @@
# Mobile Action Grid Catalog

> Last updated: 2026-02-22

Complete action inventory for `MobileActionGrid`, sourced directly from code.

Related docs: [Architecture](MOBILE-ARCHITECTURE.md) ยท [Feature Matrix](MOBILE-FEATURE-MATRIX.md) ยท [Gestures & Haptics](MOBILE-GESTURES-HAPTICS.md)

---

## Category Resolution

`MobileActionGrid.determineTileCategory()` maps each tile tap to one of these categories:

| Category | Condition |
| ------------------------- | -------------------------------------------------------------- |
| `spawn-phase` | Game in spawn phase |
| `own-land` | Own tile, land (includes shore โ€” shore uses same land actions) |
| `own-shore` | Own tile, shoreline (delegates to own-land actions) |
| `own-water` | Own tile, water |
| `enemy-can-attack` | Enemy/player tile, `canAttack` is true |
| `enemy-can-boat-attack` | Enemy/player land tile, reachable by transport ship only |
| `enemy-no-attack` | Enemy/player tile, no ground or boat attack possible |
| `neutral-can-attack` | Neutral tile, ocean (ship building) or land with `canAttack` |
| `neutral-can-boat-attack` | Neutral land tile, reachable by transport ship only |

Own-land/own-shore/own-water also append a **Stack Mode toggle** at the end of the actions list.

All categories (except spawn-phase) also prepend **Unit Selection actions** when a selectable unit (Warship, Submarine, Fighter Jet, Artillery) is within 40px screen distance of the tap position.

---

## Actions by Category

### Spawn Phase

| Action | ID | Priority | Condition |
| ---------- | ------- | -------- | ----------------- |
| Spawn Here | `spawn` | high | Unowned land tile |

---

### Unit Selection (All Categories)

When tapping near a player-owned selectable unit (within 40px screen distance), a "Select [Unit]" action is prepended to the grid. This works on **all** tile categories โ€” own, enemy, or neutral โ€” because units can be on any tile (e.g. ships on unowned ocean, jets over enemy land).

| Action | ID | Priority | Condition |
| ------------------ | ----------------------------- | -------- | ---------------------------------- |
| Select Warship | `unit:select:Warship:<id>` | high | Own Warship within 40px of tap |
| Select Submarine | `unit:select:Submarine:<id>` | high | Own Submarine within 40px of tap |
| Select Fighter Jet | `unit:select:FighterJet:<id>` | high | Own Fighter Jet within 40px of tap |
| Select Artillery | `unit:select:Artillery:<id>` | high | Own Artillery within 40px of tap |

After selecting a unit, the action grid closes and a **floating banner** appears ("๐Ÿ“ [Unit] selected โ€” tap to redirect โœ•"). Tapping any valid tile immediately emits the corresponding `Move*IntentEvent`. Artillery has an additional range check. Tapping โœ• cancels selection.

---

### Own Land / Own Shore

All unlocked land structures. Disabled (greyed) if gold insufficient. Research-locked structures hidden until prerequisite unlocked.

| Action | ID | Priority | Requirement |
| --------------- | ---------------------- | -------- | ------------------------------ |
| Port | `build:Port` | high | Nearby ocean shore (โ‰ค10 tiles) |
| City | `build:City` | high | โ€” |
| Factory | `build:Factory` | high | โ€” |
| Defense Post | `build:DefensePost` | normal | โ€” |
| Airfield | `build:Airfield` | high | โ€” |
| Hospital | `build:Hospital` | normal | `HospitalResearch` |
| Missile Silo | `build:MissileSilo` | normal | `NuclearFission` |
| Research Lab | `build:ResearchLab` | normal | โ€” |
| Academy | `build:Academy` | normal | โ€” |
| SAM Launcher | `build:SAMLauncher` | normal | โ€” |
| Doomsday Device | `build:DoomsdayDevice` | normal | `DoomsdayDeviceResearch` |
| Artillery | `build:Artillery` | normal | Factory + `ArtilleryResearch` |
| Fighter Jet | `build:FighterJet` | normal | Airfield + `JetEngines` |
| Stack Mode | `mode:stack-toggle` | โ€” | Always (last item) |

Port only appears when a BFS within 10 tiles finds an owned ocean-shore tile.

---

### Own Water

| Action | ID | Priority | Requirement |
| ----------- | ------------------- | -------- | -------------------------- |
| Port | `build:Port` | high | Nearby ocean shore (โ‰ค10) |
| Warship | `build:Warship` | high | Owns a Port |
| Submarine | `build:Submarine` | high | Port + `SubmarineResearch` |
| Fighter Jet | `build:FighterJet` | normal | Airfield + `JetEngines` |
| Stack Mode | `mode:stack-toggle` | โ€” | Always (last item) |

---

### Enemy โ€” Can Ground Attack

| Action | ID | Priority | Requirement |
| ---------------- | -------------------------- | -------- | ----------------------------------- |
| Ground Attack | `attack:ground` | high | Troops > 0 |
| Paratroopers | `attack:airstrike` | normal | Airfield + `JetEngines` |
| Bomber Run | `attack:bomber` | normal | Airfield + at war |
| Fighter Jet | `build:FighterJet` | normal | Airfield + `JetEngines` |
| Request Peace | `diplomacy:request-peace` | normal | At war with target |
| Break Alliance | `diplomacy:break-alliance` | normal | Allied with target |
| Propose Alliance | `diplomacy:propose-ally` | normal | Neutral relationship |
| Declare War | `attack:declare-war` | normal | Not at war |
| Atom Bomb | `attack:nuke-atom` | normal | Silo + `NuclearFission` + 5K gold |
| H-Bomb | `attack:nuke-hbomb` | normal | Silo + `ThermonuclearStaging` + 15K |
| MIRV | `attack:nuke-mirv` | normal | Silo + `MIRVTechnology` + 50K |

---

### Enemy โ€” Can Boat Attack

| Action | ID | Priority | Requirement |
| ---------------- | -------------------------- | -------- | ----------------------------------- |
| Naval Assault | `attack:naval` | high | Troops > 0 |
| Paratroopers | `attack:airstrike` | normal | Airfield + `JetEngines` |
| Bomber Run | `attack:bomber` | normal | Airfield + at war |
| Request Peace | `diplomacy:request-peace` | normal | At war with target |
| Break Alliance | `diplomacy:break-alliance` | normal | Allied with target |
| Propose Alliance | `diplomacy:propose-ally` | normal | Neutral relationship |
| Declare War | `attack:declare-war` | normal | Not at war |
| Atom Bomb | `attack:nuke-atom` | normal | Silo + `NuclearFission` + 5K gold |
| H-Bomb | `attack:nuke-hbomb` | normal | Silo + `ThermonuclearStaging` + 15K |
| MIRV | `attack:nuke-mirv` | normal | Silo + `MIRVTechnology` + 50K |

---

### Enemy โ€” No Attack Possible

Diplomacy + air + nukes only. Peace and alliance are promoted to high priority.

| Action | ID | Priority | Requirement |
| ---------------- | -------------------------- | -------- | ----------------------------------- |
| Paratroopers | `attack:airstrike` | **high** | Airfield + `JetEngines` |
| Bomber Run | `attack:bomber` | **high** | Airfield + at war |
| Request Peace | `diplomacy:request-peace` | **high** | At war with target |
| Propose Alliance | `diplomacy:propose-ally` | **high** | Neutral relationship |
| Break Alliance | `diplomacy:break-alliance` | normal | Allied with target |
| Declare War | `attack:declare-war` | normal | Not at war |
| Atom Bomb | `attack:nuke-atom` | normal | Silo + `NuclearFission` + 5K gold |
| H-Bomb | `attack:nuke-hbomb` | normal | Silo + `ThermonuclearStaging` + 15K |
| MIRV | `attack:nuke-mirv` | normal | Silo + `MIRVTechnology` + 50K |

---

### Neutral โ€” Can Attack (Land)

| Action | ID | Priority | Requirement |
| ------ | --------------- | -------- | ----------- |
| Attack | `attack:ground` | high | Troops > 0 |

---

### Neutral โ€” Can Attack (Ocean)

| Action | ID | Priority | Requirement |
| ----------- | ------------------ | -------- | -------------------------- |
| Port | `build:Port` | high | Nearby ocean shore (โ‰ค10) |
| Warship | `build:Warship` | high | Owns a Port |
| Submarine | `build:Submarine` | high | Port + `SubmarineResearch` |
| Fighter Jet | `build:FighterJet` | normal | Airfield + `JetEngines` |

---

### Neutral โ€” Boat Attack

| Action | ID | Priority | Requirement |
| ------------- | -------------- | -------- | ----------- |
| Naval Assault | `attack:naval` | high | Troops > 0 |

---

## Grid Layout

- Bottom-anchored sheet, max 60vh, auto-fill grid with 65px min column width
- High-priority items sorted first
- Top row items auto-expand to fill incomplete rows (percentage-based column spans)
- Disabled tiles: greyed + reason text
- Locked tiles: hidden (research-locked structures not shown until prerequisite met)
- Nukes: only shown when silo + research + gold requirements are all met
- Diplomacy: exactly one of peace/alliance/break-alliance shown based on current relationship; declare-war shown when not at war
- 300ms debounce prevents accidental backdrop closure
- Haptic: `TAP` on valid action, `ERROR` on disabled/locked

---

## Stack Mode

When stack mode is toggled ON:

- Action grid collapses to a single full-width "Stack ON" toggle button
- Map taps upgrade the nearest stackable structure within hit radius (28px screen, 72px sticky)
- Stackable types: City, Port, Airfield, Hospital, Academy, ResearchLab, Factory, MissileSilo, SAMLauncher
- Sticky targeting remembers the last upgraded structure for easier repeated taps
Loading
Loading