Skip to content

fix(ci): give Companion Desktop Builds pnpm before it runs beforeBuildCommand - #52

Merged
acamarata merged 1 commit into
mainfrom
fix/companion-build-pnpm
Aug 27, 2026
Merged

acamarata merged 1 commit into
mainfrom
fix/companion-build-pnpm

Conversation

@acamarata

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #51. That PR fixed the wrong desktop/tauri path so cargo tauri build could find the project, but the very next run on main (actions/runs/33074963689) failed identically on all three platforms with pnpm: not found -- tauri.conf.json's beforeBuildCommand: pnpm build runs before cargo builds anything, and this workflow never installed Node/pnpm, and never checked out the nself-org/packages sibling that desktop/package.json's workspace:* deps resolve against.

Applied the same checkout-as-siblings + setup-node + pnpm/action-setup pattern desktop-e2e.yml already uses successfully.

Test plan

  • This workflow only triggers on push to main or workflow_dispatch (no pull_request trigger), so it will not run as a PR check here.
  • Dispatching it manually against this branch before merging, to verify without risking another failed run on main.

…dCommand

Fixing the desktop/tauri -> desktop/src-tauri path (previous commit)
let cargo tauri build actually find the project, and it immediately
hit the next problem: tauri.conf.json's beforeBuildCommand runs
`pnpm build`, but this workflow only ever installed Rust. Every
platform in the matrix failed identically with `pnpm: not found`.

It also never checked out the nself-org/packages sibling that
desktop/package.json's workspace:* dependencies resolve against
(pnpm-workspace.yaml globs ../packages/@nself/*), so a bare
`pnpm install` here would fail the same way desktop-e2e.yml's did
before it added the sibling checkout.

Apply the same fix desktop-e2e.yml already uses: check nclaw out to
a subdir, check nself-org/packages out beside it, set up Node +
pnpm, and install before cargo tauri build runs.
@acamarata
acamarata merged commit 7e8c569 into main Aug 27, 2026
11 of 14 checks passed
@acamarata
acamarata deleted the fix/companion-build-pnpm branch August 27, 2026 13:46
acamarata added a commit that referenced this pull request Aug 27, 2026
…col, restore Tailwind (#53)

* fix(ci): give Companion Desktop Builds pnpm before it runs beforeBuildCommand

Fixing the desktop/tauri -> desktop/src-tauri path (previous commit)
let cargo tauri build actually find the project, and it immediately
hit the next problem: tauri.conf.json's beforeBuildCommand runs
`pnpm build`, but this workflow only ever installed Rust. Every
platform in the matrix failed identically with `pnpm: not found`.

It also never checked out the nself-org/packages sibling that
desktop/package.json's workspace:* dependencies resolve against
(pnpm-workspace.yaml globs ../packages/@nself/*), so a bare
`pnpm install` here would fail the same way desktop-e2e.yml's did
before it added the sibling checkout.

Apply the same fix desktop-e2e.yml already uses: check nclaw out to
a subdir, check nself-org/packages out beside it, set up Node +
pnpm, and install before cargo tauri build runs.

* fix(desktop): wire ChatContainer into auth-gated Shell, fix broken chat send

Desktop E2E's two chat.spec.ts failures traced back to four separate,
compounding regressions, none caused by the other:

1. App.tsx's Shell() never had an 'authenticated' branch. The ea5e077
   "native epic complete" rewrite replaced the direct ChatContainer render
   with an auth-gated title screen but only handled 'loading' and
   'unauthenticated' -- a real user who signs in still sees the title
   screen forever. Added the missing branch.

2. chat-client.ts's chatTransport still spoke the ad hoc
   `data: {"content": ...}` SSE shape from an older AI SDK version.
   AI SDK v6's DefaultChatTransport (package.json already pins ai@^6,
   @ai-sdk/react@^3) requires the UI Message Stream protocol
   (text-start/text-delta/text-end chunks + the
   x-vercel-ai-ui-message-stream header) and its strict chunk schema
   silently drops anything else, so no reply ever reached useChat. It
   also declared `chatTransport(req: Request)`, but DefaultChatTransport
   calls its fetch override as fetch(url, init) -- the (Request) form
   would throw on every call. Fixed both.

3. main.tsx never imported styles/globals.css (the file that pulls in
   Tailwind), so every Tailwind utility class in the tree was inert --
   flex/h-full utilities did nothing, so ChatList's scroll container
   collapsed to zero height and rendered messages were invisible even
   after wiring auth and the SDK protocol correctly.

4. globals.css and postcss.config.js were still on Tailwind v3 syntax
   (`@tailwind` directives, bare `tailwindcss` PostCSS plugin) while
   tailwindcss@4 was the version actually resolving in the workspace
   (hoisted from apps/web, which is already on v4's @tailwindcss/postcss
   convention) -- desktop/package.json never declared tailwindcss,
   @tailwindcss/postcss, autoprefixer, or @fontsource/inter at all, so
   the whole CSS pipeline only worked by accident of hoisting. v4's
   PostCSS plugin rejects the v3 config outright (500 on every request).
   Migrated to `@import "tailwindcss"` + `@config` (keeping the existing
   tailwind.config.js as the source of truth for custom colors), fixed
   postcss.config.js, and declared the CSS toolchain as explicit
   devDependencies/dependencies instead of relying on hoisting.

chat.spec.ts itself also asserted on markup the app never renders: the
real composer placeholder is @nself/i18n's "Message ɳClaw…"
(desktop.nclaw.messagePlaceholder), not the test's hardcoded
"Type a message…", and MessageBubble renders markdown through
react-markdown (<p>/<strong>/<code> etc.), never an
article/[role=article]/.markdown/.prose wrapper -- that selector could
never have matched. Rewrote both assertions against real, current
output (real placeholder string; <strong> produced by **bold** through
remark-gfm) so they still fail if send-and-render or markdown rendering
breaks again.

Neither test can exercise a signed-in session without a backend, so a
new tests/e2e/fixtures/auth.ts seeds a TokenPair into the same
localStorage keys NativeAuthStrategy reads (making the app reach
'authenticated') and stubs window.__TAURI_INTERNALS__ (Playwright drives
a plain Chromium window with no Tauri IPC bridge). This restores a
harness that existed at 8e21382 and was dropped when chat.spec.ts was
later rewritten without it. The stubbed stream_chat reply intentionally
returns the same '(stub response)' text the real (still NotImplemented,
pending S15.T17) Tauri command would return -- it does not fake more
backend behavior than exists.

Companion Desktop Builds' pnpm-not-found failure (run 33074963689) is
already fixed on origin/main via #52 (cherry-picked here as 2567651);
included so this branch is green standalone.
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