Skip to content

The Playwright API mock answers knowledge.formats, so the repository add dialog opens in e2e - #286

Merged
zlareb1 merged 2 commits into
mainfrom
fix/e2e-knowledge-formats
Nov 6, 2026
Merged

zlareb1 merged 2 commits into
mainfrom
fix/e2e-knowledge-formats

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Related: #157

Changelog category (leave one):

  • Not for changelog

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

None: a test fixture only.

Why

Since #283, the repository card's "Add a document" dialog reads knowledge.formats when it opens, to badge a picked file. The Playwright API mock (frontend/e2e/fixtures.ts) had no case for that op, so it answered with its catch-all list shape ({rows: [], entries: [], …}). The dialog then read formats.formats as undefined, and the page fell to the error boundary ("Cannot read properties of undefined (reading 'filter')"). tracker-ux.spec.ts's "page, trackers, a linked card, docs" test, desktop and mobile, timed out waiting for the dialog's Title field.

Design

  • The mock answers knowledge.formats as a server with the reference extractor does: every known format sorted by name, each with the extensions and media types server/core/document_formats.py names it by and available: true, the default 64 MB upload cap, the refused legacy extensions and text as the default format.
  • The dashboard is unchanged. A real server always sends the formats list, and a server without the op answers 404, which knowledgeFormats already reads as null.

Scope and risk

  • Test fixture only.

Compatibility, rollout and rollback

  • None.

Tests

  • E2E_PORT=<port> npm --prefix frontend run e2e -- e2e/tracker-ux.spec.ts: 10 passed. Before the fix, both "page, trackers, a linked card, docs" runs failed on a crashed page.
  • tracker-ux.spec.ts is the only spec that opens an add dialog (the specs searched for the dialog's button names).

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated (an agent wrote most of the diff): Claude Code. Checked: the crash in the failing run's page snapshot, and the spec passing with the fixture.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • make format-check, make lint, make typecheck and make test-unit pass; the integration suite passes if server behaviour changed.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (git commit -s), as CONTRIBUTING.md asks.

🤖 Generated with Claude Code

zlareb1 and others added 2 commits November 6, 2026 08:16
The repository's add dialog reads knowledge.formats when it opens. The mock
answered it with its catch-all list shape, so the dialog read an undefined
formats list and the page crashed in tracker-ux's add-a-document step.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: zlareb1 <[email protected]>
@zlareb1
zlareb1 merged commit 4189bc2 into main Nov 6, 2026
22 of 24 checks passed
@zlareb1
zlareb1 deleted the fix/e2e-knowledge-formats branch November 6, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant