Repository navigation
fix(e2e): make mobile checks for sidebar and docs tree robust - #806
Conversation
There was a problem hiding this comment.
Important
The managed-copies fix does not survive the merge: on master the document header renders a second visible button named Documentation, so the new role locator still resolves to two elements and the test keeps failing in CI.
Approach: sound in direction — both failures are phone-only selector problems, and waiting on the page rather than the sidebar is the right call for file-changes. The managed-copies locator is not scoped tightly enough for the app code that master carries today.
Reviewed changes
- Docs sidebar wait —
openSidebarOnPhonemoves fromgetByText("Documentation")to a role-based button locator so the sidebar tree header can be awaited on phones. - General-scope wait — the
file-changestest replaces the sidebarTrashlink wait (never rendered while the mobile Sheet is closed) with amainlandmark wait beforesettleSocket.
⚠️ The branch was cut before the docs/files unification, so the local run cannot reproduce the failing run
The reported failures come from a run on master (6248c313), which includes the docs/files unification; this branch's base (17b6b918) does not. Running the suite on the branch therefore exercises the old docs header (plain text breadcrumb) and proves nothing about the code that will be tested after merge. Rebase onto master and rerun both mobile projects before the test plan's last box is ticked.
Technical details
# Branch base vs. the failing run
## Affected sites
- `apps/web/src/components/projects/docs/document-pane.tsx:254` (master) — builds `crumbs` from the Files path: `[project, ...filePath.data, doc]`; the docs root folder crumb label is "Documentation".
- `apps/web/src/components/shared/path-breadcrumb.tsx:62` (master, `CrumbButton`) — every non-current crumb with `onSelect` renders as `<button>`; the header bar that hosts `PathBreadcrumb` has no responsive hiding.
- `apps/web/src/components/app-shell/app-sidebar.tsx:1113` (master) — docs section header is `<SidebarGroupLabel render={<button />}>` containing `<span>Documentation</span>`.
- `apps/e2e/tests/docs/docs.spec.ts:171` — existing precedent for the scoped handle: `page.getByRole('dialog', { name: 'Sidebar' })`.
## Required outcome
- The fix must pass against the merge of this branch onto `master` (run 44731780646 head, `6248c313`, is the reference), not only against the branch's own base.
- `openSidebarOnPhone` must resolve exactly one element on the docs editor pages after that merge.
## Suggested approach (optional)
- Scope the wait to the Sheet: `page.getByRole("dialog", { name: "Sidebar" })`.
- Alternative: scope by `[data-slot="sidebar"]` inside the Sheet, but the dialog handle already has precedent in this test directory.deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏
There was a problem hiding this comment.
✅ No new issues found.
Approach: sound — the prior review's recommendation was applied directly, scoping the docs-tree wait to the mobile Sheet so the editor breadcrumb's same-named button can no longer collide.
Reviewed changes
Reviewed the delta since the prior pullfrog review (6624d92d → 18296349).
- Scoped docs sidebar wait —
openSidebarOnPhonenow waits ongetByRole("dialog", { name: "Sidebar" })before looking for theDocumentationtree button, matching the existingdocs.spec.tshandle and excluding the docs editor header'sPathBreadcrumbbutton.
deepseek-v4.1-flash-1017 (free via Pullfrog for OSS) | 𝕏

Summary
Fixes the two mobile-safari failures in the Playwright run 44731780646. Both were selector problems that only show up on phone-width viewports, where the sidebar is a closed Sheet and the page breadcrumb is visible.
managed-copies.spec.ts:openSidebarOnPhonewaited ongetByText("Documentation", { exact: true }). On phones the breadcrumb also reads "Documentation", so the locator matched two elements and failed on strict mode. It now targets the tree's button withgetByRole("button", { name: "Documentation", exact: true }).file-changes.spec.ts: "a folder created in the general scope appears without a reload" waited for the sidebar's "Trash" link, which never renders while the sidebar Sheet is closed. It now waits for themainlandmark, thensettleSocketas before.Test-only change; no app code is touched.
Not changed
docs.spec.ts"Rename an existing folder" was flaky in the same run (passed on retry), so it is left alone.Test plan
managed-copies.spec.tsandfile-changes.spec.tspass onmobile-safari(16/16) andmobile-chrome(16/16) against the local e2e docker stackbiome checkclean on both files