Skip to content

feat: add Christmas Easter egg with ⌘⇧J keyboard shortcut#223

Open
sri-rang wants to merge 1 commit into
mainfrom
feature/issue-222-christmas-easter-egg
Open

feat: add Christmas Easter egg with ⌘⇧J keyboard shortcut#223
sri-rang wants to merge 1 commit into
mainfrom
feature/issue-222-christmas-easter-egg

Conversation

@sri-rang

@sri-rang sri-rang commented May 8, 2026

Copy link
Copy Markdown
Contributor

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

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
@qodo-code-review

Copy link
Copy Markdown

Review Summary by Qodo

Add Christmas Easter egg with animated snowflakes

✨ Enhancement

Grey Divider

Walkthroughs

Description
• 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
Diagram
flowchart 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"]
Loading

Grey Divider

File Changes

1. Tusk/AppState.swift ✨ Enhancement +1/-0

Add Easter egg state variable

• Add isShowingChristmasEasterEgg boolean state variable to track Easter egg visibility

Tusk/AppState.swift


2. Tusk/Views/About/ChristmasEasterEggView.swift ✨ Enhancement +120/-0

Create festive Christmas Easter egg view

• Create new SwiftUI view with dark blue background and animated snowflakes using Canvas and
 TimelineView
• Implement 40 procedurally-generated snowflakes with varying speeds, sizes, and opacity
• Display ASCII Christmas tree with star, green triangular sections, and brown trunk
• Show Postgres-themed holiday message with dismiss button and Escape key shortcut

Tusk/Views/About/ChristmasEasterEggView.swift


3. Tusk/Views/ContentView.swift ✨ Enhancement +3/-0

Integrate Easter egg sheet presentation

• Add sheet modifier to present ChristmasEasterEggView when isShowingChristmasEasterEgg is true

Tusk/Views/ContentView.swift


View more (1)
4. Tusk/Views/Main/TuskCommands.swift ✨ Enhancement +8/-0

Add hidden keyboard shortcut for Easter egg

• Add hidden menu button with ⌘⇧J keyboard shortcut that toggles Easter egg state
• Set button opacity to 0 and disable hit testing and accessibility to keep it hidden

Tusk/Views/Main/TuskCommands.swift


Grey Divider

Qodo Logo

@qodo-code-review

qodo-code-review Bot commented May 8, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (1)

Context used

Grey Divider


Action required

1. ⌘⇧J doesn’t toggle flag 📎 Requirement gap ≡ Correctness
Description
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.
Code

Tusk/Views/Main/TuskCommands.swift[R47-53]

+            Button("") {
+                appState.isShowingChristmasEasterEgg = true
+            }
+            .keyboardShortcut("j", modifiers: [.command, .shift])
+            .opacity(0)
+            .allowsHitTesting(false)
+            .accessibilityHidden(true)
Evidence
PR Compliance ID 8188 requires the ⌘⇧J hidden menu item to toggle (flip)
appState.isShowingChristmasEasterEgg. The new command’s action assigns true unconditionally
(appState.isShowingChristmasEasterEgg = true), so it does not toggle.

Add hidden keyboard shortcut (⌘⇧J) to toggle Easter egg
Tusk/Views/Main/TuskCommands.swift[47-53]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## 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


2. Conflicting sheet presentations 🐞 Bug ☼ Reliability
Description
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.
Code

Tusk/Views/ContentView.swift[R27-29]

+        .sheet(isPresented: $appState.isShowingChristmasEasterEgg) {
+            ChristmasEasterEggView()
+        }
Evidence
ContentView already presents two sheets driven by AppState; the PR adds a third,
independently-controlled sheet. Meanwhile, the command handler sets the new boolean without checking
whether other sheets are active, so multiple sheet conditions can be true simultaneously.

Tusk/Views/ContentView.swift[19-29]
Tusk/Views/Main/TuskCommands.swift[47-50]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### 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



Remediation recommended

3. Blank menu item row 🐞 Bug ≡ Correctness
Description
TuskCommands adds a Button("") in the Help menu and attempts to hide it with .opacity(0), but
opacity does not remove layout space, so the Help menu will still contain an empty/blank menu row.
This undermines the intended hidden Easter egg and can present a confusing, non-obvious menu entry.
Code

Tusk/Views/Main/TuskCommands.swift[R47-53]

+            Button("") {
+                appState.isShowingChristmasEasterEgg = true
+            }
+            .keyboardShortcut("j", modifiers: [.command, .shift])
+            .opacity(0)
+            .allowsHitTesting(false)
+            .accessibilityHidden(true)
Evidence
The command is created as a Help-menu item with an empty title and then visually hidden via opacity;
since it remains in the commands hierarchy, it will still occupy a menu slot (blank row) even if the
label is invisible.

Tusk/Views/Main/TuskCommands.swift[37-54]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
A hidden keyboard shortcut is implemented as a Help-menu `Button("")` with `.opacity(0)`. Opacity does not remove layout space, so the Help menu can still show a blank row.

### Issue Context
This is inside `CommandGroup(replacing: .help)`, so it impacts the app’s visible menu structure.

### Fix Focus Areas
- Tusk/Views/Main/TuskCommands.swift[37-54]

### Suggested fix
Prefer one of these approaches:
1) **Avoid adding a menu item at all**: register ⌘⇧J via an AppKit key event monitor (e.g., `NSEvent.addLocalMonitorForEvents`) or a dedicated keyboard-shortcut handler that toggles `appState.isShowingChristmasEasterEgg`.
2) If you must keep it as a menu command, **give it a real label** (so it’s not a blank row) and accept that it will be visible; hiding via opacity/hit-testing is not a reliable way to remove a command from menus.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Comment on lines +47 to +53
Button("") {
appState.isShowingChristmasEasterEgg = true
}
.keyboardShortcut("j", modifiers: [.command, .shift])
.opacity(0)
.allowsHitTesting(false)
.accessibilityHidden(true)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

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

Comment on lines +27 to +29
.sheet(isPresented: $appState.isShowingChristmasEasterEgg) {
ChristmasEasterEggView()
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Action required

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

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