Skip to content

fix(tools-pack): focus existing AppImage instead of silent EADDRINUSE on second launch#2262

Open
n8k99 wants to merge 2 commits into
nexu-io:mainfrom
n8k99:claudian/launcher-already-running-focus
Open

fix(tools-pack): focus existing AppImage instead of silent EADDRINUSE on second launch#2262
n8k99 wants to merge 2 commits into
nexu-io:mainfrom
n8k99:claudian/launcher-already-running-focus

Conversation

@n8k99
Copy link
Copy Markdown

@n8k99 n8k99 commented May 19, 2026

Summary

startPackedLinuxApp had no already-running detection. The .desktop entry runs open-design which always calls linux start, which tries to bind the same desktop IPC socket — second click silently EADDRINUSEs and the launcher appears to "do nothing."

This adds:

  • detectRunningLinuxApp() — mirrors stopPackedLinuxApp's marker + stamp + IPC liveness validation, but returns the live instance instead of killing it
  • focusLinuxWindow() — tries swaymsg / i3-msg / hyprctl based on WM env vars, with wmctrl as the universal fallback
  • Fast path in startPackedLinuxApp: if a live instance is detected, focus its window and return source: "already-running" (new variant)

Test plan

  • pnpm --filter @open-design/tools-pack typecheck — clean
  • pnpm --filter @open-design/tools-pack test — 66 tests, 5 new for focusAttemptsForLinuxWindow
  • pnpm guard — clean
  • Live: cold-start spawns AppImage (source: "installed"), warm-start hits new path (source: "already-running", focusMethod: "swaymsg", status returned via IPC)
  • No --force option surfaced on the new pr merge subcommand in forgejo-cli (matches the never-force-merge hard rail)

Notes

LinuxStartResult widens with optional focusMethod (string|null), populated only on "already-running". Backward compatible — existing consumers ignore the new field.

Nathan Eckenrode and others added 2 commits May 17, 2026 17:49
Two new design systems based on Nathan's existing DPN.md / DPS.md style
guides (canonical at ~/Documents/DPN.md and ~/Documents/DPS.md). They
codify a single design language with a dark face (Noir) and a light face
(Solar), originally authored for AI image generation and now extended
into UI tokens via the typographic-roles addition from 2026-04-27.

DragonPunk Noir (DPN) — dark-by-default:
- Canvas: Void Black #0A0A0F (warmest possible black, never #000)
- Ink: Dragon Gold #FFB800 — load-bearing read color at ~12:1 on void
- Accent + Focus glow: Neon Cyan #00F5FF — single token (~110:1 on void
  lets it serve both readable-accent and focus-glow roles)
- Neon family: Magenta #FF2D95, Purple #9D00FF, Toxic Green #39FF14
- Warm spike: Ember #FF6B35 (warn), Crimson #8B0000 (deep danger),
  Bronze #CD7F32 (stale/disabled)
- Plan 9 / Acme / NeXTSTEP lineage: square corners, no shadows, no blur,
  state-change motion only

DragonPunk Solar (DPS) — light-face twin:
- Canvas: Solar White #FFF8E1 (cream warmed toward gold, never sterile)
- Ink: Bole #3D1208 — Renaissance gilders' red-clay underground at ~13:1
- Readable accent: Rubric #B82F08 — manuscript-red, ~5.5:1
- Focus glow only: Plasma Cyan #00D4FF (cyan-on-cream collapses to
  ~1.7:1, so DPS splits the role into Rubric + Cyan rather than
  collapsing into one token like DPN does)
- Dark-mode override flips DPS to DPN's full token set (same brand,
  light face flips to dark face — not duplicated values per Lens B)

Both files satisfy the 9-section schema (Visual Theme / Color /
Typography / Spacing / Layout / Components / Motion / Voice /
Anti-patterns), include real CSS in :root blocks, use the
[data-theme="dark"] override pattern, and target prefers-reduced-motion
to specific selectors rather than global *. Substantive anti-patterns
named (no rounded corners, no drop shadows, no ambient idle animation,
no centered prose, no cyan-as-text on cream, etc.). Prior art names
real specifics: Plan 9, Acme, NeXTSTEP, Blade Runner 2049, Renaissance
manuscript rubrication, the Mixxx LateNight skins, dpn-void.css /
dps-solar.css.

Category: Bold & Expressive for both.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… on second launch

startPackedLinuxApp had no already-running detection. Every CMD+SPACE
"Open Design" launch after the first one tried to bind the same desktop
IPC socket at /tmp/open-design/ipc/<ns>/desktop.sock, hit EADDRINUSE,
and exited silently. Observed as the launcher "doing nothing" on the
second click.

This adds detectRunningLinuxApp() (mirrors stopPackedLinuxApp's marker
+ stamp + IPC liveness validation) and focusLinuxWindow() (swaymsg /
i3-msg / hyprctl by env, wmctrl as universal fallback), so the fast
path focuses an existing window instead of spawning a duplicate.

- LinuxStartSource widened to include "already-running"
- LinuxStartResult gains optional focusMethod
- 5 new tests for focusAttemptsForLinuxWindow (66 total, all pass)
- pnpm guard / typecheck / --filter @open-design/tools-pack test all green
@lefarcen lefarcen requested a review from PerishCode May 19, 2026 12:19
@lefarcen lefarcen added size/XL PR changes 700-1500 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels May 19, 2026
@PerishCode
Copy link
Copy Markdown
Contributor

@n8k99 I'm holding off on generating review comments for #2262 because this pull request has merge conflicts right now.

Please resolve the conflicts with main and push the updated branch. Once that's done, request or wait for the review to run again and I'll take another look.

🔁 Powered by Looper · runner=reviewer · agent=claude-code · An autonomous AI dev team for your GitHub repos.

Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

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

Hi @n8k99! The Summary gives a clear picture of the AppImage second-launch failure and the intended already-running path. One quick body-template ask before pool review: could you add a ## Surface area checklist and a ## Validation section? The current test-plan bullets are helpful; putting them under Validation and ticking the affected surface area will make the review/release scope easier to scan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk: regular code changes size/XL PR changes 700-1500 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants