Repository navigation
refactor(mcp): rename and restructure sidebar opening functions for c… - #771
Conversation
There was a problem hiding this comment.
ℹ️ Minor suggestion inline. The fix is correct — I re-read the failing run's log and the pre-fix assertion failed with
element(s) not found/Timeout: 5000ms, exactly the unmounted-Sheet symptom described in the PR body.
Reviewed changes
openSidebarOnPhonehelper — extracts the "viewport < 768 → clickToggle Sidebar" block fromopenDocsTreeinto a reusable helper, andopenDocsTreenow goes through it.- Tree assertions on phones —
a managed copy shows where it comes fromopens the Sheet before both sidebar row assertions (:205,:215), since the second follows a fullpage.gotothat remounts the app with the Sheet closed. - Reorder —
expectEditable(page, true)moved ahead of the second open; order-only,toHaveAttributedoes not depend on visibility.
ℹ️ That run had a second, unrelated failure this PR does not cover
The mobile-safari job hit the same managed-copies failure (covered here, since the helper keys off viewport width) but also a pre-existing flake in docs.spec.ts, so a dispatched safari run may still report a failure after this merges.
Technical details
# Remaining e2e failures in run 43713324033
## Affected sites
- `apps/e2e/tests/docs/managed-copies.spec.ts:175` — failed on all 3 attempts in both mobile jobs (fixed here).
- `apps/e2e/tests/docs/docs.spec.ts:350` — "Rename a document from the sidebar", `mobile-safari` job 132809463755: failed twice, passed on retry #2.
## Evidence
- The safari error is `expect(...).toBe('Final')` receiving `'Draft'` from `GET /docs/{id}` while the sidebar already showed `Final`, i.e. the write had not landed when the API was read — a missing `expect.poll`, independent of the sidebar changes.
## Required outcome
- None for this PR; recorded so a still-red safari run is not attributed to this change.deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found. The follow-up commit addresses the earlier note exactly, and I verified the wait is sound against the Sidebar's mount semantics.
Reviewed changes
Since the prior pullfrog review (2fff861), one commit (2390c7c) landed:
- Helper now waits for a mounted Sheet — after the
Toggle Sidebarclick,openSidebarOnPhoneawaitsgetByText("Documentation", { exact: true })with a 10 s budget, so callers can assert on tree rows without carrying their own timeout. - Comment updated — the helper's JSDoc now says it "opens it and waits for the docs tree", matching the new behavior.
Two things I checked while validating the wait, so the next reader does not have to: Sidebar renders only the Sheet when isMobile (apps/web/src/components/ui/sidebar.tsx:202), so there is no hidden desktop copy of the "Documentation" label that could trip strict mode; and the label renders unconditionally in app-sidebar.tsx:1080, including when the docs group is collapsed, so it signals mount rather than the row fetch. The < 768 test also matches useIsMobile's breakpoint.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

What
Fixes the failing
mobile-chromePlaywright run in CI (run 43713324033):Managed copies › a managed copy shows where it comes frominapps/e2e/tests/docs/managed-copies.spec.ts.Why it failed
On phones (viewport < 768px) the sidebar, and with it the docs tree, is a Sheet that starts closed. The test asserted on the tree rows (
Plan … Copy of …andPlain) without opening it, so the locators were never found. Desktop projects always show the tree, so onlymobile-chromefailed.Changes
openDocsTreeinto a newopenSidebarOnPhonehelper (no-op on wider screens).openDocsTreenow uses the helper.Test-only change; no app code touched.
Verification
Ran
tests/docs/managed-copies.spec.tsagainst the isolated e2e docker stack (deploy/docker-compose.e2e.yml): 14/14 passed (7 onchromium, 7 onmobile-chrome). Biome check passes. The rest of the e2e suite was not re-run locally.