feat: add Christmas Easter egg with ⌘⇧J keyboard shortcut#223
Conversation
A festive sheet overlay with animated snowflakes, a Christmas tree, and a Postgres-themed holiday message. Triggered by pressing ⌘⇧J anywhere in the app. The menu item is hidden to keep it a proper Easter egg. Implements: #222
Review Summary by QodoAdd Christmas Easter egg with animated snowflakes
WalkthroughsDescription• Add festive Christmas Easter egg overlay with animated snowflakes • Implement ⌘⇧J keyboard shortcut to trigger Easter egg • Display ASCII Christmas tree with Postgres-themed holiday message • Hide menu item to maintain Easter egg secrecy Diagramflowchart LR
A["User presses ⌘⇧J"] -- "triggers" --> B["AppState.isShowingChristmasEasterEgg"]
B -- "shows" --> C["ChristmasEasterEggView"]
C -- "displays" --> D["Animated Snowflakes"]
C -- "displays" --> E["ASCII Christmas Tree"]
C -- "displays" --> F["Holiday Message"]
File Changes1. Tusk/AppState.swift
|
Code Review by Qodo
Context used✅ Tickets:
🎫 Add an Easter egg to this application. 1. ⌘⇧J doesn’t toggle flag
|
| Button("") { | ||
| appState.isShowingChristmasEasterEgg = true | ||
| } | ||
| .keyboardShortcut("j", modifiers: [.command, .shift]) | ||
| .opacity(0) | ||
| .allowsHitTesting(false) | ||
| .accessibilityHidden(true) |
There was a problem hiding this comment.
1. ⌘⇧j doesn’t toggle flag 📎 Requirement gap ≡ Correctness
The hidden ⌘⇧J command sets appState.isShowingChristmasEasterEgg to true instead of toggling it true/false. This violates the requirement that the shortcut toggles visibility year-round and prevents using the shortcut to dismiss once shown.
Agent Prompt
## Issue description
The hidden ⌘⇧J command currently sets `appState.isShowingChristmasEasterEgg = true` instead of toggling it, violating the requirement that the shortcut flips the boolean.
## Issue Context
Compliance requires the hidden menu item under `CommandGroup(replacing: .help)` to toggle `appState.isShowingChristmasEasterEgg` (true/false).
## Fix Focus Areas
- Tusk/Views/Main/TuskCommands.swift[47-53]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
| .sheet(isPresented: $appState.isShowingChristmasEasterEgg) { | ||
| ChristmasEasterEggView() | ||
| } |
There was a problem hiding this comment.
2. Conflicting sheet presentations 🐞 Bug ☼ Reliability
ContentView now has an additional independent `.sheet(isPresented: $appState.isShowingChristmasEasterEgg)` alongside existing sheets, and ⌘⇧J sets that boolean unconditionally. Triggering ⌘⇧J while another sheet is already presented can cause competing sheet states (queued/ignored presentation), making the Easter egg appear at unexpected times or not appear when invoked.
Agent Prompt
### Issue description
The app can end up with multiple sheet states active at once (`isAddingConnection`, `editingConnection`, and now `isShowingChristmasEasterEgg`). SwiftUI sheet presentation is not designed for multiple simultaneous sheet presenters on the same window, so presentation can become queued/ignored/unexpected.
### Issue Context
⌘⇧J is available “anywhere in the app,” including while other sheets are open.
### Fix Focus Areas
- Tusk/Views/ContentView.swift[19-29]
- Tusk/Views/Main/TuskCommands.swift[47-50]
### Suggested fix
Implement one of the following:
- **Single source of truth for modals**: replace the multiple `.sheet` modifiers with a single `.sheet(item:)` driven by an `enum ActiveModal: Identifiable` in `AppState` (cases for add/edit/christmas), and set that enum from commands.
- **Guard the shortcut**: in the ⌘⇧J action, only set `isShowingChristmasEasterEgg = true` if no other modal state is active (e.g., `!isAddingConnection && editingConnection == nil && createTableTarget == nil && !isImportingPgpass`). Optionally, clear/close other sheets before opening the Easter egg if that’s acceptable.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
A festive sheet overlay with animated snowflakes, a Christmas tree, and a Postgres-themed holiday message. Triggered by pressing ⌘⇧J anywhere in the app. The menu item is hidden to keep it a proper Easter egg.
Implements: #222