Skip to content

fix(ios): restore panel buttons after leaving pan mode with a panel shown - #140

Merged
g4rb4g3 merged 2 commits into
masterfrom
fix/carplay-panel-pan-buttons
Oct 16, 2026
Merged

g4rb4g3 merged 2 commits into
masterfrom
fix/carplay-panel-pan-buttons

Conversation

@g4rb4g3

@g4rb4g3 g4rb4g3 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • When a map panel is shown, MapTemplate now gives the bar and map buttons back to the topmost panel on invalidate, instead of skipping the update. The panel still owns those buttons while it exists.

Problem

  • Symptom: with a map panel on screen, leaving pan mode leaves the pan-mode buttons behind (empty header with a back button, map buttons without the pan button).
  • Root cause: _invalidate() skipped applying any buttons while a panel existed, so nothing replaced the pan-mode state. Theme changes had the same gap.
  • Reproduced on iOS 27 (iPhone) with the CarPlay Simulator.

Test plan

  • Tested on CarPlay (CarPlay Simulator, iOS 27 iPhone)

Checklist

  • yarn lint:auto-play and yarn typecheck:auto-play pass

🤖 Generated with Claude Code (Claude Opus 5.5)

…hown

While a map panel was on screen, MapTemplate._invalidate() skipped applying
buttons entirely, so dismissing the panning interface left the pan-mode
header and map buttons behind. Hand the buttons back to the topmost panel
instead, keeping the rule that a panel owns the bar/map buttons while it
exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@g4rb4g3

g4rb4g3 commented Oct 16, 2026

Copy link
Copy Markdown
Contributor Author

@claude please review

@claude

claude Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Claude finished @g4rb4g3's task in 1m 25s —— View job


Review of PR #140

  • Gather context (diff, MapTemplate.swift, AutoPlayMapPanelDelegate.swift, AutoPlayInterfaceController)
  • Analyse the change for bugs / thread-safety / docs drift
  • Post review

No significant issues found.

Checked specifically:

  • Thread safety: _invalidate() is @MainActor, and AutoPlayInterfaceController is a @MainActor class, so reading panelTemplateIds synchronously there is fine — same pattern reapplyPanelBarIfVisible already uses.
  • Pan-mode exit: mapTemplateDidDismissPanningInterface → invalidate() now reaches the panel branch and hands the bar/map buttons back to the topmost panel; applyPanelHeaderActions clears or replaces the pan-mode backButton as expected. automaticallyHidesNavigationBar / hidesButtonsWithNavigationBar correctly stay false while a panel exists.
  • Trait change: traitCollectionDidChange → super → invalidate() now re-parses the panel's buttons with the new trait collection, closing the theme gap mentioned in the description.
  • Edge case: if the top panel's template is no longer in the store, try? swallows the error and nothing is applied — but handlePanelPopped removes the navigation entry before the store entry, so panelTemplateIds.last can't point at a removed template.
  • Docs: no public API, host-app setup or documented behaviour changed; docs/templates.md's description of panel header actions still holds. PR description is appropriately brief.

@github-actions

Copy link
Copy Markdown
Contributor

No significant issues found.

@g4rb4g3
g4rb4g3 merged commit 52e8ed6 into master Oct 16, 2026
3 checks passed
@g4rb4g3
g4rb4g3 deleted the fix/carplay-panel-pan-buttons branch October 16, 2026 17:30
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.

1 participant