Skip to content

feat: show air raid in a collapsible panel - #134

Merged
KochiyaOcean merged 1 commit into
masterfrom
feat/air-raid-collapse
Aug 9, 2026
Merged

feat: show air raid in a collapsible panel#134
KochiyaOcean merged 1 commit into
masterfrom
feat/air-raid-collapse

Conversation

@KochiyaOcean

Copy link
Copy Markdown
Member

Problem

When an air raid (land base defense) happens, Prophet replaced the whole fleet display with the air raid view — the sortie fleet was hidden until the next node.

Change

The battle area render is extracted into a local renderArea(baseDefense) helper, so the same layout code draws either battle. When a raid is in progress the component now renders:

  • an "Air Defense" panel — a clickable header over a Blueprint Collapse, open by default — containing the land base squads vs. the raid enemies, the raid's air force counts, and its rank/formation/air-control line;
  • below it, the regular fleet view, unchanged: sortie fleet, title, TP, and NextSpotInfo (including the "Heavy Bomber Defense" note).

Details:

  • Air force counts are attached only to the battle they belong to, so the sortie fleet title no longer shows base-defense air power.
  • NextSpotInfo is no longer duplicated — the panel shows only the raid's BattleInfo.
  • id="overview-area" stays on the single outer div so it isn't emitted twice.
  • The panel header is keyboard-operable (Enter/Space) with aria-expanded/aria-controls; a single rotated caret keeps the label from shifting on toggle.
  • Added the Air Defense i18n key to en-US and ko-KR — ja-JP, zh-CN and zh-TW already had it.

The non-air-raid path is behavior-preserving: every parameterized expression reduces to its previous form when baseDefense === Boolean(isBaseDefense).

Testing

tsc --noEmit and eslint pass. Not yet exercised against a live raid in poi.

🤖 Generated with Claude Code

Copilot AI lite review requested due to automatic review settings August 9, 2026 07:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the battle overview UI so that when a land-base air raid occurs, the air-raid details are shown in a collapsible “Air Defense” panel while keeping the sortie fleet view visible below, instead of replacing it entirely.

Changes:

  • Refactors battle-area rendering into a shared renderArea(baseDefense) helper to render either the air-raid or sortie layout consistently.
  • Adds a collapsible “Air Defense” panel (keyboard-operable with ARIA attributes) shown during base defense, with the sortie fleet view rendered underneath.
  • Adds the Air Defense i18n key to en-US and ko-KR.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/views/battle-view-area.tsx Adds collapsible air-raid panel + shared renderer so raid and sortie areas can be shown together.
assets/i18n/ko-KR.json Adds Korean translation for Air Defense.
assets/i18n/en-US.json Adds English translation for Air Defense.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +226 to +227
const [airRaidOpen, setAirRaidOpen] = useState(true)
const toggleAirRaid = () => setAirRaidOpen((open) => !open)
Comment thread src/views/battle-view-area.tsx Outdated
Comment on lines +421 to +423
<Collapse isOpen={airRaidOpen} keepChildrenMounted>
<div id="air-raid-body">{renderArea(true)}</div>
</Collapse>
Air raid info used to replace the sortie fleet display entirely, hiding
the fleet for the duration of the raid. Extract the battle area render
into renderArea(baseDefense) so the land base defense can be drawn in a
collapsible panel (open by default) above the regular fleet view, which
now stays visible throughout.

The raid's air force counts and BattleInfo stay scoped to the panel; the
sortie area keeps showing NextSpotInfo as it does on any other node.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@KochiyaOcean
KochiyaOcean force-pushed the feat/air-raid-collapse branch from f2de85c to 4545c3f Compare August 9, 2026 08:00
@KochiyaOcean
KochiyaOcean merged commit 282420b into master Aug 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants