Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
31ce709
Update Gitignore
El-Magico777 Feb 23, 2026
bb75286
feat(mobile): Implement mobile UI
El-Magico777 Feb 11, 2026
86fd65c
feat(mobile): Mobile lobby industrial styling
El-Magico777 Feb 16, 2026
4d5583d
feat(mobile): tune zoom controls for touch usability
El-Magico777 Feb 16, 2026
c2648a5
fix(i18n): resolve public lobby map names via GameMapType
El-Magico777 Feb 18, 2026
93f1d0f
feat(mobile): landscape and portrait lobby UI
El-Magico777 Feb 17, 2026
e5389d3
docs(mobile): update architecture and feature matrix for lobby UI, zoโ€ฆ
El-Magico777 Feb 19, 2026
62ea467
Mobile UI: state-driven loading/spectator/dead visibility
El-Magico777 Feb 21, 2026
49a173e
Mobile lobby: Map carousel, default closed extra settings, responsiveโ€ฆ
El-Magico777 Feb 21, 2026
10b297b
Add extra-large viewport size class for tablets
El-Magico777 Feb 21, 2026
60a25ff
Polish mobile action grid metal styling and unified sheen
El-Magico777 Feb 22, 2026
1ffc26d
Force English default locale on mobile devices
El-Magico777 Feb 22, 2026
37072b0
Fix mobile save replay flow and modal actions
El-Magico777 Feb 22, 2026
50b3e92
fix(desktop): align map card colors with lobby frame palette on PC
El-Magico777 Feb 22, 2026
34fcda5
feat(mobile): add unit selection and redirection via Action Grid
El-Magico777 Feb 22, 2026
058830f
docs(mobile): update architecture, feature matrix, and action grid caโ€ฆ
El-Magico777 Feb 22, 2026
9ccbf7e
feat(mobile): add research completion percentages to toast and tab
El-Magico777 Feb 22, 2026
a02a24f
fix(mobile): show naval assault when land attack is also available
El-Magico777 Feb 22, 2026
d30c699
fix: mobile spawn tap interception beneath top bar in landscape
El-Magico777 Feb 22, 2026
92d2f04
feat: show mobile attack troop amount on attack actions
El-Magico777 Feb 22, 2026
53119ff
feat: show attack troop amount in mobile economy slider
El-Magico777 Feb 22, 2026
06526f0
feat: move mobile attack bubbles above action grid
El-Magico777 Feb 22, 2026
01fdb79
feat: align mobile top-bar side cutouts on wider screens
El-Magico777 Feb 22, 2026
ec7274c
feat: align mobile settings sidebar with responsive top-offset system
El-Magico777 Feb 22, 2026
81e2ce8
feat: mobile intel panel tablet improvements
El-Magico777 Feb 22, 2026
db2a639
fix: make mobile stack-size labels refresh immediately in stack mode
El-Magico777 Feb 23, 2026
8904cda
fix: decouple mobile research priority overlays from attack bar
El-Magico777 Feb 23, 2026
655e9b0
fix: align SendBoatAttackIntentEvent call to current constructor signโ€ฆ
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/
progress.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