Skip to content

fix(frontend): serve correct DAR package details from mock server - #294

Merged
zheli merged 2 commits into
mainfrom
package-details
Jul 30, 2026
Merged

fix(frontend): serve correct DAR package details from mock server#294
zheli merged 2 commits into
mainfrom
package-details

Conversation

@zheli

@zheli zheli commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

The DAR Manager "package details" panel (DARPackageTree) fetches /api/instances/:name/dar/:mainID/inspect, which the Vite mock server serves from frontend/mock/fixtures/dar-inspect.json. That fixture used a stale schema that no longer matched DARInspectResponse (frontend/src/api.ts), so the package tree rendered empty/broken when running against the frontend mock server.

Changes

  • frontend/mock/fixtures/dar-inspect.json: Rewrite to the current DARInspectResponse shape — top-level main/name/version/sha256, and packages[] with package_id, lf_version, size_bytes, is_main, and contents.modules[] (templates with choices, interfaces with choices/methods, and data_types). Includes one main package plus two dependency packages so the tree, chips, and NT · NI · ND counts render meaningfully.
  • frontend/mock/router.ts: The /dar/:id/inspect handler overrode the removed dar_id field; now it overrides main to match the requested id.

Verification

  • vitest run mock/router.test.ts mock/seed.test.ts src/screens/DARScreen.test.tsx → 15 passed.

zheli added 2 commits July 29, 2026 21:54
The DAR Manager package details panel (DARPackageTree) fetches
/api/instances/:name/dar/:mainID/inspect, which the mock server
serves from dar-inspect.json. That fixture used a stale schema that
no longer matched DARInspectResponse, so the package tree rendered
empty against the frontend mock server.

Rewrite the fixture to the current shape (main/sha256/packages with
package_id, lf_version, size_bytes, is_main and contents.modules with
templates, interfaces and data_types) and fix the inspect handler to
override 'main' instead of the removed 'dar_id' field.
Clicking a package opens the inspect drawer, which renders VettingPanel.
It reads data.participants from the vetting endpoint, but the mock
dar-vetting.json fixture used a stale schema (dar_id + roles) instead of
DARVettingResponse (instance/main/participants), so state.rows was
undefined and .map threw a render TypeError.

Rewrite the fixture to the participants shape with all three roles, and
align the vetting GET/POST handlers to override 'main' and return the
DARVettingToggleResponse shape instead of the removed 'dar_id' field.
@bitdynamics-ab bitdynamics-ab deleted a comment from cursor Bot Jul 30, 2026
@zheli
zheli merged commit 5054d1a into main Jul 30, 2026
25 checks passed
@zheli
zheli deleted the package-details branch July 30, 2026 10:40
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