Skip to content

Add URL trigger expansion and marketing asset scripts - #190

Merged
superhighfives merged 3 commits into
feature/color-historyfrom
feature/url-triggers-and-marketing
Mar 16, 2026
Merged

Add URL trigger expansion and marketing asset scripts#190
superhighfives merged 3 commits into
feature/color-historyfrom
feature/url-triggers-and-marketing

Conversation

@superhighfives

Copy link
Copy Markdown
Owner

Summary

  • Extends pika:// URL scheme with 12 new actions for setting colors, controlling the history drawer, opening windows, resizing, and forcing appearance
  • Updates HelpView with all new trigger groups
  • Adds build/marketing/ scripts (capture.sh, generate.ts, manifest.json) for automated marketing screenshot capture and compositing at release time

New URL triggers

URL Action
pika://set/foreground/<hex> Set foreground color
pika://set/background/<hex> Set background color
pika://history/show Show history drawer
pika://history/hide Hide history drawer
pika://history/toggle Toggle history drawer
pika://window/about Open About window
pika://window/help Open Help window
pika://window/preferences Open Preferences window
pika://window/resize/<w>/<h> Resize main window
pika://appearance/light Force light appearance
pika://appearance/dark Force dark appearance
pika://appearance/system Restore system appearance

Marketing scripts

cd pika
npm install --prefix build/marketing
npx tsx build/marketing/generate.ts --version 1.3.0 --all

Outputs versioned assets to pika-releases/Marketing/v<version>/ — web JPGs (@2x + @1x) and shadow-trimmed Figma PNGs.

Test plan

  • pika://set/foreground/fbbf24 updates foreground color to yellow
  • pika://set/background/e74661 updates background color to red
  • pika://history/show opens drawer when hidden; hide closes when open; toggle flips state
  • pika://window/about, /help, /preferences open correct windows
  • pika://window/resize/480/300 resizes window to 480×300pt
  • pika://appearance/dark forces dark mode; /light forces light; /system restores following
  • Help view displays all new trigger groups

🤖 Generated with Claude Code

New pika:// URL triggers: set foreground/background color, show/hide/toggle
history drawer, open About/Help/Preferences windows, resize window, and
force light/dark/system appearance. Updates HelpView with all new triggers.

Adds build/marketing/ scripts (capture.sh, generate.ts, manifest.json) for
automated screenshot capture and compositing of release marketing assets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings March 16, 2026 04:52
Auto-detects pika-releases/Production Exports/Pika * (v<version>)/Pika.app
and passes it to capture.sh via PIKA_APP, using open -a to route URL
triggers to that exact binary. Launches Pika before capture and quits
it after. Falls back to system Pika if no export is found.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

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 adds a color history feature (with a drawer UI and navigation), introduces a dedicated Help window, expands pika:// URL automation, and updates localizations + ancillary tooling to support these additions.

Changes:

  • Add persistent color history storage with a bottom “history drawer”, toggle UI, and keyboard/navigation actions.
  • Introduce a new Help window/view that documents shortcuts and URL triggers, and add Help entry points in the app menu.
  • Expand URL scheme handling (pika://set, pika://history, pika://window, pika://appearance) and add marketing screenshot generation scripts.

Reviewed changes

Copilot reviewed 27 out of 30 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
Pika/Views/NavigationMenuItems.swift Adds menu items for toggling history and opening Help.
Pika/Views/NavigationMenu.swift Adds a toolbar toggle button for the history drawer + a hidden shortcut binding.
Pika/Views/KeyboardShortcutKey.swift Adjusts shortcut key UI sizing.
Pika/Views/KeyboardShortcutGrid.swift Reworks shortcut grid layout and adds history shortcut entry.
Pika/Views/HelpView.swift New Help window content (shortcuts, URL triggers, formats, links).
Pika/Views/ContentView.swift Integrates the history drawer, history recording, and history navigation notifications.
Pika/Views/ColorHistoryDrawer.swift New history drawer UI (chips, context menu actions, clear button).
Pika/Views/AboutView.swift Refactors About UI and reuses the external link row component.
Pika/Services/WindowCoordinator.swift Adds Help window creation and adjusts window sizing.
Pika/Services/URLSchemeHandler.swift Adds new URL actions (set/history/window/appearance) and refactors parsing.
Pika/Services/Eyedroppers.swift Implements history recording, undo/redo stacks, and history navigation/apply operations.
Pika/Services/ColorPair.swift New model for storing a foreground/background pair in Defaults.
Pika/Constants/Defaults.swift Adds Defaults keys for history + undo/redo stacks + drawer visibility.
Pika/Constants/Constants.swift Adds notification names and localized strings for Help + History.
Pika/Assets/zh-Hant.lproj/Localizable.strings Adds Traditional Chinese localization file content for new strings.
Pika/Assets/zh-Hans.lproj/Localizable.strings Adds Simplified Chinese localization file content for new strings.
Pika/Assets/pl.lproj/Localizable.strings Adds Help/History strings in Polish.
Pika/Assets/hr.lproj/Localizable.strings Adds Help/History strings in Croatian.
Pika/Assets/fr.lproj/Localizable.strings Adds Help/History strings in French.
Pika/Assets/es.lproj/Localizable.strings Adds Help/History strings in Spanish.
Pika/Assets/en.lproj/Localizable.strings Adds Help/History strings in English.
Pika/Assets/de.lproj/Localizable.strings Adds Help/History strings in German.
Pika/Assets/Base.lproj/Main.storyboard Adds menu actions/items for history toggling and navigation.
Pika/AppDelegate.swift Wires new actions, adds key monitoring for history navigation, switches undo/redo to new stack logic.
Pika.xcodeproj/project.pbxproj Adds new source files to targets and bumps version numbers.
build/marketing/package.json Adds Node deps for marketing asset generation.
build/marketing/manifest.json Defines capture/composite manifest for marketing screenshots.
build/marketing/generate.ts Adds capture/composite/figma export pipeline script.
build/marketing/capture.sh Adds shell helper to drive Pika via URL triggers and capture window screenshots.
.gitignore Updates ignored build outputs and ignores marketing capture output directory.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread Pika/Services/URLSchemeHandler.swift Outdated
Comment thread Pika/Services/Eyedroppers.swift
Comment thread Pika/Services/Eyedroppers.swift
Comment thread Pika/Services/ColorPair.swift Outdated
Comment thread Pika/Views/NavigationMenu.swift Outdated
- Fix pika://set/... URL parsing: pass arg1 (hex) not arg2 (nil) to handleSet
- Skip pushUndo() in recordHistory() when history is empty to avoid restoring
  an empty snapshot on first undo
- Guard against empty history in swap() to prevent index-out-of-range crash
- Remove stale isActivePair reference from ColorPair comment (active tracking
  is now by id, not hex equality)
- Fix history toggle hidden shortcut: ⌘Y → plain H to match storyboard/docs

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@superhighfives

Copy link
Copy Markdown
Owner Author

Addressed all five review comments in b1787af:

  • pika://set/... URL parsinghandleSet was receiving arg2 (nil) instead of arg1 (the hex value). Fixed: hex: arg2hex: arg1.
  • Empty undo snapshot on first pickrecordHistory() was calling pushUndo() unconditionally, snapshotting an empty [] on the very first entry. Fixed: pushUndo() is now skipped when colorHistory is empty.
  • swap() crash on empty historyhistory[index] could trap if undo restored an empty snapshot. Fixed: added guard !history.isEmpty else { return }.
  • Stale comment in ColorPair — removed the isActivePair comparison always holds clause; active tracking is by id, not hex equality.
  • History toggle shortcut — hidden SwiftUI button was registered as ⌘Y instead of plain H. Fixed: .keyboardShortcut("h", modifiers: []).

@superhighfives
superhighfives changed the base branch from main to feature/color-history March 16, 2026 18:13
@superhighfives
superhighfives merged commit 069d0a7 into feature/color-history Mar 16, 2026
1 check passed
@superhighfives
superhighfives deleted the feature/url-triggers-and-marketing branch March 16, 2026 19:01
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