Skip to content

fix(e2e): adapt Playwright specs + Vitest setup to chat-as-home shell (#3751)#3754

Merged
oxoxDev merged 10 commits into
tinyhumansai:mainfrom
senamakel:fix/ci-e2e-green
Jun 18, 2026
Merged

fix(e2e): adapt Playwright specs + Vitest setup to chat-as-home shell (#3751)#3754
oxoxDev merged 10 commits into
tinyhumansai:mainfrom
senamakel:fix/ci-e2e-green

Conversation

@senamakel

@senamakel senamakel commented Jun 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Adapt the Playwright E2E suite to the chat-as-home root two-panel shell (feat(shell): root two-panel layout — unified sidebar + chat-as-home #3751): /home redirects to /chat, the former Home greeting moved into the chat "new window" hero, and stale markers/labels updated across ~14 specs.
  • Fix the auth helper to wait for the settled #/chat after sign-in (not the transient #/home redirect frame), avoiding post-login navigation races.
  • Raise the global RTL async-util timeout to 5s for the coverage run — fixes the intermittently-failing Frontend Coverage (Vitest) job (the real merge blocker).
  • Restore inline thread-title rename in the conversation header, which feat(shell): root two-panel layout — unified sidebar + chat-as-home #3751 dropped (the updateThreadTitle thunk, store tests and i18n keys had survived, so the UI removal was unintentional). Covered by new Conversations unit tests + the chat-management E2E.
  • Fix the lane-2 mcp-tab-flow flake: empty/no-results assertions used a broad text=/no.*servers|no.*results/i locator that also matched the new root-shell wrapper (Playwright strict-mode violation). Added stable testids to the empty-state divs.

Problem

After the v0.57.43 build (#3751 + release), CI was red:

Solution

  • helpers/core-rpc: completeAuthCallback polls for settled ^#/chat.
  • Stale markers → structural chat markers ("New Conversation", "Threads", [data-walkthrough="home-card"]).
  • navigation: /home expected to land on /chat.
  • chat-conversation-history: assert on response text (bubble class bg-stone-200/80 is one token a .bg-stone-200 selector can't match).
  • user-journey-full-task: re-open the thread after navigation (chat-as-home lands on the hero).
  • test/setup.ts: configure({ asyncUtilTimeout: 5000 }) — widens async-wait ceiling without masking real failures.
  • Conversations.tsx: re-add editingTitle state, handleStartEditTitle/handleCommitTitle, and the header title + pencil-edit affordance; 2 new unit tests (commit on Enter, cancel on Escape).
  • McpServersTab.tsx: add mcp-installed-empty / mcp-catalog-empty testids; specs + unit test target them.

Submission Checklist

  • Tests added or updated (happy path + at least one failure / edge case) — new Conversations rename unit tests (commit + cancel); adapted Playwright specs.
  • Diff coverage ≥ 80%pnpm test:coverage green locally (6072 passed); new production lines (rename handlers/JSX, mcp testids) covered by the added/extended unit tests.
  • Coverage matrix updated — N/A: no feature rows added/removed/renamed (rename restores a prior capability; mcp change is a testid).
  • All affected feature IDs from the matrix are listed — N/A: no matrix feature change.
  • No new external network dependencies introduced (mock backend used).
  • Manual smoke checklist updated if this touches release-cut surfaces — N/A: restores prior chat-header behavior; no new release surface.
  • Linked issue closed via Closes #NNN — N/A: no tracking issue.

Impact

  • Small production change: restores the chat-header thread-rename control (Conversations.tsx) and adds test-only data-testids to MCP empty states. Remainder is E2E/Vitest test maintenance.
  • Verified locally: full pnpm test:coverage green; targeted Playwright runs of all adapted specs green (incl. mcp-tab-flow + chat-management 18 passed).

Related

  • Closes: N/A
  • Follow-up PR(s)/TODOs: none — the thread-rename regression flagged in the initial review is fixed in this PR.

AI Authored PR Metadata

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: fix/ci-e2e-green
  • Commit SHA: 8ed4e88

Validation Run

  • pnpm --filter openhuman-app format:check
  • pnpm typecheck
  • Focused tests: pnpm test:coverage; Playwright mcp-tab-flow + chat-management-functional (18 passed); Conversations + McpServersTab unit tests
  • Rust fmt/check (if changed): N/A — no Rust changed
  • Tauri fmt/check (if changed): N/A — no Tauri changed

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

Parity Contract

Duplicate / Superseded PR Handling

  • Duplicate PR(s): N/A
  • Canonical PR: this PR
  • Resolution: N/A

Summary by CodeRabbit

  • New Features

    • Added inline editing for the selected conversation thread title in the page header (commit on Enter/blur, cancel on Escape).
  • Tests

    • Improved async test stability by increasing global async utility timeouts.
    • Updated Playwright assertions and flows to follow the unified chat landing state (#/chat) and /home redirect behavior.
    • Strengthened end-to-end and component checks with clearer UI markers and targeted data-testid empty-state selectors (including MCP).
    • Expanded thread rename coverage with new unit tests (Enter commits, Escape cancels).

…3751)

The root two-panel layout folded Home into the unified chat surface:
/home now redirects to /chat, the former Home greeting/markers moved into
the chat 'new window' hero (ChatNewWindowHero), and the new-thread control
reads 'New Conversation'. Update the E2E suite accordingly:

- helpers/core-rpc: wait for the settled #/chat after sign-in (not the
  transient #/home redirect frame) so callers navigating immediately after
  auth aren't clobbered by the late /home -> /chat redirect.
- Replace stale home markers ('Ask your assistant anything', 'Your device
  is connected') with structural chat-surface markers ('New Conversation',
  'Threads', home-card hero).
- navigation: expect /home to land on /chat.
- chat-management: anchor new-thread on its testid (label changed New ->
  New Conversation).
- chat-conversation-history: assert on response text (the bubble class is a
  single 'bg-stone-200/80' token a plain .bg-stone-200 selector can't match).
- user-journey-full-task: leave the chat surface via /human (Home == chat now).
The full Vitest suite runs under v8 coverage instrumentation on a single
worker, which makes individual renders markedly slower than an isolated,
un-instrumented file run. Testing Library's default 1000ms async-utility
timeout was too tight there, so findBy*/waitFor assertions in render-heavy,
poll-driven suites (e.g. the workflow orchestration stop/resume tests,
which wait on a 2s poll interval) flaked intermittently in CI's Frontend
Coverage job — and which test tripped first was non-deterministic
(TaskSourcesPanel in CI, IntelligenceOrchestrationTab locally).

Raising the global async-util budget removes that class of false timeouts
without masking real failures: waitFor/findBy still resolve the instant
their condition is met; this only widens the ceiling before they give up,
well within the 30s testTimeout.
Two follow-ups after exercising the chat-as-home surface end to end:

- chat-management-functional: the inline thread-rename ('Edit thread title')
  control was removed from the conversation header by tinyhumansai#3751 (the
  updateThreadTitle action/store tests/i18n remain, but the header button is
  gone). Per product decision, narrow the test to the still-present thread
  delete flow and drop the rename steps + the now-redundant 'Show sidebar'
  click (the chat thread sidebar is visible by default on /chat).
- user-journey-full-task: the chat surface lands on its 'new window' hero
  after navigating away rather than re-opening the last thread, so re-select
  the thread row before asserting the persisted message is visible.
Pre-push hook reflow of the lines changed in the preceding commits
(collapsed short expressions, import ordering in setup.ts). No behavior
change.
@senamakel senamakel requested a review from a team June 17, 2026 23:50
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The pull request aligns the test suite to a unified chat surface where /home redirects to /chat, adds inline thread title editing to the Conversations page, improves MCP server tab test reliability with dedicated empty-state identifiers, increases the async test timeout to 5000ms to reduce flaky assertions under v8 coverage instrumentation, and hardens a workflow test against parallel test interference.

Changes

Unified chat surface test alignment

Layer / File(s) Summary
Vitest async timeout increase
app/src/test/setup.ts
Adds configure import from Testing Library and sets global asyncUtilTimeout to 5000ms to reduce flaky async assertion failures under v8 coverage instrumentation.
Core RPC helper: auth-callback lands on /chat
app/test/playwright/helpers/core-rpc.ts
Updates completeAuthCallback polling assertion, error message, and post-browser-core-mode navigation assertion to target #/chat instead of #/home.
Login, auth, and onboarding: accept #/home or #/chat
app/test/playwright/specs/login-flow.spec.ts, app/test/playwright/specs/auth-access-control.spec.ts, app/test/playwright/specs/logout-relogin-onboarding.spec.ts, app/test/playwright/specs/onboarding-modes.spec.ts, app/test/playwright/specs/runtime-picker-login.spec.ts
Broadens post-login and post-onboarding hash assertions to match either #/home or #/chat via updated regex patterns.
Shell UI marker updates across specs
app/test/playwright/specs/agent-review.spec.ts, app/test/playwright/specs/cron-jobs-flow.spec.ts, app/test/playwright/specs/core-port-conflict-recovery.spec.ts, app/test/playwright/specs/linux-cef-deb-runtime.spec.ts, app/test/playwright/specs/skill-execution-flow.spec.ts, app/test/playwright/specs/tauri-commands.spec.ts, app/test/playwright/specs/webhooks-ingress-flow.spec.ts, app/test/playwright/specs/webhooks-tunnel-flow.spec.ts
Replaces old Home surface markers with unified chat surface markers (New Conversation, Threads, Chat) in shell-presence assertions across eight specs.
Navigation redirect assertions: /home → /chat
app/test/playwright/specs/navigation.spec.ts, app/test/playwright/specs/navigation-smoothness.spec.ts, app/test/playwright/specs/top-level-functional-flows.spec.ts, app/test/playwright/specs/skill-socket-reconnect.spec.ts
Adds expectedHash: '/chat' for the /home route fixture, updates route marker arrays and final-state assertions to expect the #/chat hash after navigating /#/home, and switches socket-reconnect baseline to home-card walkthrough element visibility.
User journey flows and chat test selector fixes
app/test/playwright/specs/user-journey-full-task.spec.ts, app/test/playwright/specs/user-journey-settings-round-trip.spec.ts, app/test/playwright/specs/chat-conversation-history.spec.ts, app/test/playwright/specs/chat-management-functional.spec.ts
Updates user journey tests to navigate via /#/home and assert /chat redirect with thread re-selection; replaces CSS-class selector with text-based assertion for first response visibility; switches new-thread trigger from accessible name to data-testid; updates thread rename/delete test to use inline header edit.

Inline thread title editing

Layer / File(s) Summary
Conversations page inline title editing
app/src/pages/Conversations.tsx
Adds updateThreadTitle import, local state/refs for edit mode management and input handling, handlers to enter edit mode and commit trimmed titles via dispatch(updateThreadTitle(...)), and conditional header UI rendering with editable input (Enter/Escape/blur controls) or hover-revealed edit button.
Thread rename unit tests
app/src/pages/__tests__/Conversations.attachments.test.tsx
New Vitest suite for conversation header thread-title editing with two cases: Enter commits the title and calls threadApi.updateTitle with thread id and updated string; Escape cancels the edit UI without calling updateTitle.

MCP servers tab test reliability

Layer / File(s) Summary
MCP empty-state test identifiers
app/src/components/channels/mcp/McpServersTab.tsx
Adds data-testid attributes to installed-empty, registry-empty, and unified all-empty placeholder divs to enable direct test targeting without broad text matching.
MCP tab assertion updates
app/test/playwright/specs/mcp-tab-flow.spec.ts, app/src/components/channels/mcp/McpServersTab.test.tsx
Updates mcp-tab-flow spec to replace regex-based locators with direct getByTestId assertions for empty-installed and catalog no-results states; updates McpServersTab component test to also verify catalog empty-state is displayed after search filtering to zero matches.

Workflow test resilience

Layer / File(s) Summary
Workflow test event filtering
src/openhuman/workflows/ops_create.rs
Updates test event-reception logic to match only WorkflowsChanged events with reason == "create", draining other concurrent WorkflowsChanged events instead of asserting unconditionally on the first event.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • tinyhumansai/openhuman#3515: Both PRs modify app/test/playwright/specs/mcp-tab-flow.spec.ts to make MCP tab E2E assertions more deterministic around empty-state UI checks.
  • tinyhumansai/openhuman#3722: The main PR updates src/openhuman/workflows/ops_create.rs's create_workflow_inner_emits_workflows_changed test to filter DomainEvent::WorkflowsChanged by reason == "create", which directly harmonizes with the retrieved PR's workflow event emission changes.
  • tinyhumansai/openhuman#3492: Both PRs touch the MCP Servers tab UI (app/src/components/channels/mcp/McpServersTab.tsx)—main PR adds data-testid hooks for empty states, while the retrieved PR redesigns table/row behavior.

Suggested reviewers

  • oxoxDev

Poem

🐇 From /home to /chat we hop and we bound,
New Conversation and Threads to be found!
Thread titles now editable in pages so bright,
Empty states tagged for test reliability's might.
A workflow test hardens against parallel strife—faster, steadier, without the flaky sigh! ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adapting Playwright specs and Vitest setup to the chat-as-home shell refactor, directly reflecting the primary purpose of this changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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


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

@coderabbitai coderabbitai Bot added the working A PR that is being worked on by the team. label Jun 17, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 17, 2026
Two follow-ups requested on top of the chat-as-home E2E adaptation:

- Restore the inline thread-rename control dropped from the conversation
  header by tinyhumansai#3751. Re-add the editingTitle state, handleStartEditTitle /
  handleCommitTitle handlers (dispatching the still-present updateThreadTitle
  thunk), and the header title + pencil-edit affordance in Conversations.tsx.
  Cover it with two deterministic Conversations unit tests (commit on Enter,
  cancel on Escape) and re-enable the rename assertion in the
  chat-management-functional E2E (asserting the unique renamed title surfaces,
  since chat-as-home auto-select can move the header's selected thread).

- Fix the lane-2 mcp-tab-flow flake: the empty/no-results assertions used a
  broad `text=/no.*servers|no.*results/i` locator that, under the new root
  two-panel shell, also matched the wrapping shell container -> Playwright
  strict-mode violation. Add stable data-testids (mcp-installed-empty,
  mcp-catalog-empty) to the empty-state divs and target those instead.

Verified locally: mcp-tab-flow + chat-management-functional E2E (18 passed),
Conversations + McpServersTab unit tests green.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8ed4e88a56

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/pages/Conversations.tsx Outdated
Comment thread app/src/pages/Conversations.tsx Outdated

@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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/src/pages/Conversations.tsx`:
- Around line 2530-2541: The thread-title edit button with
data-analytics-id="chat-header-edit-thread-title" is currently only visible on
hover due to the opacity-0 class and group-hover/title:opacity-100 conditional
styling, making it invisible to keyboard users who tab to focus it. Add a
focus-visible state to the className that makes the button visible when it
receives keyboard focus, ensuring keyboard users can see the control they are
interacting with. Use Tailwind's focus-visible utility to apply appropriate
opacity or visibility styling when the button is focused via keyboard.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 468f396a-c4e8-4391-97e8-f40377f51bcf

📥 Commits

Reviewing files that changed from the base of the PR and between d8c0e18 and 8ed4e88.

📒 Files selected for processing (6)
  • app/src/components/channels/mcp/McpServersTab.test.tsx
  • app/src/components/channels/mcp/McpServersTab.tsx
  • app/src/pages/Conversations.tsx
  • app/src/pages/__tests__/Conversations.attachments.test.tsx
  • app/test/playwright/specs/chat-management-functional.spec.ts
  • app/test/playwright/specs/mcp-tab-flow.spec.ts

Comment thread app/src/pages/Conversations.tsx
Address reviewer findings on the rename restoration:
- Make the header edit-title button keyboard-discoverable: reveal it on
  group-focus-within and focus-visible (with a focus ring), not hover only.
- Add namespaced [chat] debug diagnostics around the rename start/commit/
  success/failure path (per AGENTS.md verbose-logging rule), logging the title
  length rather than the title text to avoid PII.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
The event bus is a process-wide singleton, so other tests running in
parallel (e.g. ops_install publishing reason "install"/"uninstall")
leak WorkflowsChanged events into this test's receiver. It asserted on the
first WorkflowsChanged event seen, which intermittently was a sibling test's
"uninstall" -> 'left: "uninstall", right: "create"' failure in Rust Core
Coverage. Match only our own "create" reason and skip the rest.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2779120b5a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/test/playwright/specs/chat-management-functional.spec.ts
Per reviewer (P2): chat-as-home may already have a non-null selectedThreadId
(auto-created empty thread) before the New Conversation click, so waiting only
for non-null could return a stale id and let the rename/delete spec pass
without exercising the new-thread flow. Capture the prior id and wait for the
selection to advance to the new thread.
coderabbitai[bot]
coderabbitai Bot previously approved these changes Jun 18, 2026
The Coverage Gate (diff-cover >= 80%) flagged Conversations.tsx at 68.8% on
changed lines: the rename handler's skip branches (unchanged/blank title),
the persistence failure (.catch) path, and the onBlur/onMouseDown handlers
were unexercised. Add unit tests for unchanged-commit, blank-commit, blur
ignore-guard via mousedown-open, and a rejected updateTitle — every changed
rename line in Conversations.tsx is now covered.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0fac92a3d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/pages/Conversations.tsx
Per reviewer (P2): for CJK/IME input, the Enter that confirms a composition
candidate would also hit the title-edit handler and commit the rename early.
Apply the same isImeCompositionKeyEvent guard the composer already uses, and
cover it with a unit test (Enter with keyCode 229 must not persist).

@oxoxDev oxoxDev left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Walkthrough: Adapts ~16 Playwright specs + Vitest setup to the chat-as-home shell (#3751: /home/chat), restores the inline thread-rename control in the chat header, adds MCP empty-state testids, raises the RTL async-util timeout, and de-flakes a Rust event-bus test. Verified against head b8d2971.

Verdict: LGTM — approve. Clean, well-scoped, all 19 checks green. Prior CodeRabbit/Codex findings (diagnostics, keyboard-focus reveal, IME guard, new-thread wait) are all addressed in current code.

Verified good

  • Single header rename block (Conversations.tsx:2517) — no duplication; IME-guarded Enter, focus-visible/group-focus-within reveal + focus ring for keyboard users, blur-on-open guarded by ignoreNextTitleBlurRef.
  • Rename diagnostics log title length, not text (no PII leak) — good.
  • 7 non-vacuous unit tests (commit/cancel/IME/unchanged/blank/open-blur/failure) + MCP testid assertions.
  • Rust fix (ops_create.rs:714): correct race fix for the process-wide event-bus singleton — match guard if reason == "create" + drain unrelated events + Lagged handling, without weakening the saw assertion. Not a suppression.
  • asyncUtilTimeout: 5000 only widens the give-up ceiling under v8-coverage single-worker runs; doesn't mask real failures. Reasonable.

Nitpicks (non-blocking)

  • chat-conversation-history.spec.ts:140 & user-journey now assert on raw response text instead of the bubble selector — slightly looser (text could match elsewhere on the page), but .first() + unique canary mitigates. Fine.
  • Several auth specs broaden to ^#/(home|chat) while others pin ^#/chat. Mixed strictness is intentional (completeAuthCallback now settles on #/chat); consider tightening the (home|chat) ones in a follow-up once the redirect is fully bedded in.

@oxoxDev oxoxDev merged commit d798bf8 into tinyhumansai:main Jun 18, 2026
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

working A PR that is being worked on by the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants