Skip to content

refactor(app): rename titlebar hooks to pawwork#369

Merged
Astro-Han merged 2 commits into
devfrom
codex/fix-i365-titlebar-hooks
May 2, 2026
Merged

refactor(app): rename titlebar hooks to pawwork#369
Astro-Han merged 2 commits into
devfrom
codex/fix-i365-titlebar-hooks

Conversation

@Astro-Han

@Astro-Han Astro-Han commented May 2, 2026

Copy link
Copy Markdown
Owner

Summary

Rename PawWork-owned titlebar DOM hook IDs from opencode-titlebar-* to pawwork-titlebar-*.

Why

These hooks belong to the PawWork app shell. Keeping the old opencode-* namespace makes frontend code and E2E selectors harder to grep, and blurs PawWork-owned UI surfaces with true OpenCode compatibility surfaces.

Related Issue

Closes #365.

Human Review Status

Pending. A human should make the final merge decision after reviewing the final diff and verification evidence.

Review Focus

Please check that this stays limited to titlebar shell hooks and does not rename compatibility surfaces such as @opencode-ai/*, virtual:opencode-server, OPENCODE_*, opencode://, provider IDs, localStorage keys, or theme persistence keys.

Risk Notes

Low. The only runtime risk is a mismatched portal mount ID hiding titlebar content; the titlebar contract test and settings smoke cover that path.

How To Verify

Install: bun install --frozen-lockfile completed successfully in this worktree
RED check: shell-frame-contract failed before production changes because titlebar still used opencode-titlebar-left
Hook search: rg -n "opencode-titlebar" . returned no matches after the rename
Focused test: bun test --preload ./happydom.ts ./src/shell-frame-contract.test.ts -> 4 passed, 0 failed
Typecheck: bun --cwd packages/app typecheck -> passed
Settings smoke: bun --cwd packages/app test:e2e --grep "PawWork settings opens as a full-pane surface" -> 1 passed
Diff check: git diff --check -> passed

Screenshots or Recordings

Not attached. This PR intentionally preserves visual behavior; the settings smoke test verified the Settings title still renders in the titlebar center slot.

Checklist

  • Human review status is stated above as pending, approved, or not required
  • I linked the related issue, or stated why there is no issue
  • This PR has type, scope, and priority labels, or I requested maintainer labeling
  • I described the review focus and any meaningful risks
  • I listed the relevant verification steps and the key result for each
  • I did not introduce unrelated refactors, dependencies, generated files, or file changes beyond the stated scope
  • I manually checked visible UI or copy changes when needed, with screenshots or recordings
  • I considered macOS and Windows impact for desktop, packaging, updater, signing, paths, shell, or permissions changes
  • I called out docs, release notes, dependencies, permissions, credentials, deletion behavior, generated content, or local file changes when relevant
  • I reviewed the final diff for unrelated changes and suspicious dependency changes
  • I am targeting dev, and my PR title and commit messages use Conventional Commits in English

Summary by CodeRabbit

  • Chores
    • Updated titlebar slot identifiers used by the app so components mount in the correct titlebar regions.
    • Aligned end-to-end and unit tests with the new titlebar identifiers.
    • Ensured titlebar integrations across layout and session UI reference the updated slot elements for consistent rendering.

@Astro-Han Astro-Han added enhancement New feature or request P3 Low priority ui Design system and user interface labels May 2, 2026 — with ChatGPT Codex Connector
@coderabbitai

coderabbitai Bot commented May 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ca116403-0936-4f93-9f87-b4521306ff58

📥 Commits

Reviewing files that changed from the base of the PR and between 0280f61 and 83cc88e.

📒 Files selected for processing (3)
  • packages/app/e2e/settings/settings.spec.ts
  • packages/app/src/components/session/session-header.tsx
  • packages/app/src/shell-frame-contract.test.ts
✅ Files skipped from review due to trivial changes (1)
  • packages/app/src/shell-frame-contract.test.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/app/e2e/settings/settings.spec.ts
  • packages/app/src/components/session/session-header.tsx

📝 Walkthrough

Walkthrough

Rename PawWork-owned frontend titlebar DOM hook IDs from opencode-titlebar-* to pawwork-titlebar-* across titlebar components, portal mounts, E2E selectors, and tests.

Changes

Titlebar DOM Hook Rename

Layer / File(s) Summary
DOM Element Declarations
packages/app/src/components/titlebar.tsx
Three titlebar slot elements (left, center, right) renamed from opencode-titlebar-*pawwork-titlebar-*.
Portal Mount Points
packages/app/src/components/session/session-header.tsx, packages/app/src/pages/layout/pawwork-titlebar.tsx
Portal mount lookups changed to use document.getElementById("pawwork-titlebar-*"); session-header now uses post-mount createSignal + onMount DOM lookups.
E2E Selectors
packages/app/e2e/selectors.ts
Selector constants updated from #opencode-titlebar-*#pawwork-titlebar-*.
Tests / Contract
packages/app/e2e/settings/settings.spec.ts, packages/app/src/shell-frame-contract.test.ts
Imports and assertions updated to reference titlebarCenterSelector and pawwork-titlebar-* IDs in expectations and test fixtures.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

app, harness

Poem

🐰 I hopped through code with tidy paws,
Renamed the hooks without a pause.
From opencode to pawwork bright,
Titlebars gleam in PawWork light —
Tests and portals snug and right.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: renaming titlebar hooks from 'opencode' to 'pawwork' namespace.
Description check ✅ Passed The description is comprehensive and follows the template with all required sections completed: summary, why, related issue, human review status, review focus, risk notes, verification steps, and completed checklist.
Linked Issues check ✅ Passed All coding requirements from issue #365 are met: titlebar DOM IDs renamed (#opencode-titlebar-* to #pawwork-titlebar-*), app code updated for portal mounting, E2E selectors updated, and shell-frame contract tests updated.
Out of Scope Changes check ✅ Passed All changes are scoped to titlebar hooks only; no out-of-scope modifications to @opencode-ai, virtual modules, env vars, protocol links, provider IDs, or localStorage keys detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/fix-i365-titlebar-hooks

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
packages/app/e2e/settings/settings.spec.ts (1)

49-49: ⚡ Quick win

Prefer guideline-approved selector types over an ID locator.

This assertion works, but using an ID locator in E2E specs diverges from the project selector policy. Consider asserting within a semantic/data-component container instead.

Suggested adjustment
-  await expect(page.locator("#pawwork-titlebar-center")).toContainText("Settings")
+  await expect(page.locator('[data-component="titlebar-shell"]')).toContainText("Settings")

As per coding guidelines: "Use data-component, data-action, or semantic roles for selectors instead of CSS class names or IDs."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/app/e2e/settings/settings.spec.ts` at line 49, The test uses an ID
locator in the assertion (page.locator("#pawwork-titlebar-center")), which
violates the selector policy; update the locator to use a guideline-approved
selector such as a data-component/data-action attribute or a semantic role.
Replace the ID-based locator in the assertion with something like
page.locator('[data-component="titlebar-center"]') or page.getByRole('heading',
{ name: 'Settings' }) and keep the same toContainText expectation so the
assertion still checks for "Settings". Ensure you update the selector reference
wherever "#pawwork-titlebar-center" is used in this spec.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@packages/app/e2e/settings/settings.spec.ts`:
- Line 49: The test uses an ID locator in the assertion
(page.locator("#pawwork-titlebar-center")), which violates the selector policy;
update the locator to use a guideline-approved selector such as a
data-component/data-action attribute or a semantic role. Replace the ID-based
locator in the assertion with something like
page.locator('[data-component="titlebar-center"]') or page.getByRole('heading',
{ name: 'Settings' }) and keep the same toContainText expectation so the
assertion still checks for "Settings". Ensure you update the selector reference
wherever "#pawwork-titlebar-center" is used in this spec.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f8b0cf9-1b27-4f6d-a858-4ba3274633be

📥 Commits

Reviewing files that changed from the base of the PR and between 6512b83 and 0280f61.

📒 Files selected for processing (6)
  • packages/app/e2e/selectors.ts
  • packages/app/e2e/settings/settings.spec.ts
  • packages/app/src/components/session/session-header.tsx
  • packages/app/src/components/titlebar.tsx
  • packages/app/src/pages/layout/pawwork-titlebar.tsx
  • packages/app/src/shell-frame-contract.test.ts

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request renames titlebar element IDs from opencode-titlebar-* to pawwork-titlebar-* across components, E2E selectors, and tests. Feedback suggests using defined selector constants in E2E tests to improve maintainability, adopting a more robust signal-based pattern for DOM element resolution in SessionHeader to avoid lifecycle issues, and using regular expressions in contract tests for better resilience against formatting changes.

Comment thread packages/app/e2e/settings/settings.spec.ts Outdated
Comment thread packages/app/src/components/session/session-header.tsx Outdated
Comment thread packages/app/src/shell-frame-contract.test.ts Outdated
@Astro-Han Astro-Han merged commit 2bfb2c0 into dev May 2, 2026
26 of 27 checks passed
@Astro-Han Astro-Han deleted the codex/fix-i365-titlebar-hooks branch May 2, 2026 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request P3 Low priority ui Design system and user interface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Rename frontend shell hooks from opencode to pawwork

1 participant