refactor(app): rename titlebar hooks to pawwork#369
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughWalkthroughRename PawWork-owned frontend titlebar DOM hook IDs from ChangesTitlebar DOM Hook Rename
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 9/10 reviews remaining, refill in 6 minutes. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/app/e2e/settings/settings.spec.ts (1)
49-49: ⚡ Quick winPrefer 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
📒 Files selected for processing (6)
packages/app/e2e/selectors.tspackages/app/e2e/settings/settings.spec.tspackages/app/src/components/session/session-header.tsxpackages/app/src/components/titlebar.tsxpackages/app/src/pages/layout/pawwork-titlebar.tsxpackages/app/src/shell-frame-contract.test.ts
There was a problem hiding this comment.
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.
Summary
Rename PawWork-owned titlebar DOM hook IDs from
opencode-titlebar-*topawwork-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
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
dev, and my PR title and commit messages use Conventional Commits in EnglishSummary by CodeRabbit