Skip to content

Fetch the selected workspace's TDEI metadata on the dashboard - #176

Merged
jeffmaki merged 1 commit into
developfrom
dashboard-fetch-workspace-metadata
Oct 28, 2026
Merged

jeffmaki merged 1 commit into
developfrom
dashboard-fetch-workspace-metadata

Conversation

@jeffmaki

@jeffmaki jeffmaki commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

The dashboard read tdeiMetadata from GET /workspaces/mine, which sends it for every workspace. For a workspace created from a TDEI dataset, that field is the whole dataset record, including the area polygon, so it was most of the list's size. The backend wants to drop it from /mine (TaskarCenterAtUW/workspaces-backend#159); this change has to ship first.

What changes:

  • A new services/workspace-metadata.ts fetches a workspace's tdeiMetadata through GET /workspaces/{id}. It caches per workspace, so the map and the info panel share one request, and doesn't cache failures.
  • The dashboard clears the cache in setup and on refresh, so changes from an export show up. It clears in setup rather than onMounted because the child components start loading before the page's onMounted runs.
  • components/dashboard/Map.vue fetches the metadata alongside the bbox and still draws once. If the metadata request fails, it outlines the bbox as before.
  • components/dashboard/WorkspaceInformation.vue loads the metadata for the selected workspace (dataset version, dataset area) and ignores stale answers.

Nothing else reads tdeiMetadata from /mine: the merge and export pages already load their workspace with getWorkspace(id).

This works with both the current and the new backend, so it can deploy any time.

Testing:

  • Unit tests (680, including 4 new ones for the cache), lint and nuxt typecheck pass.
  • dashboard.spec.ts: /mine mocks now omit tdeiMetadata, as the new backend will, and serve it from GET /workspaces/{id}. The dataset-version test now passes only through that route. 14 passed, 6 skipped (the existing test.fixme placeholders).
  • Full e2e suite: 178 passed. Four unrelated tests (TDEI export, review deep links, team join) failed in the full run but pass when run alone, both here and on develop.

🤖 Generated with Claude Code

Summary

  • Fetch TDEI metadata for the selected workspace through GET /workspaces/{id} instead of relying on metadata in GET /workspaces/mine.
  • Cache metadata requests by workspace ID so the map and information panel can share a request. Failed requests are not cached, and the dashboard clears the cache on setup and refresh.
  • Load metadata alongside the map’s bounding-box request. If metadata loading fails, use the bounding box for the outline.
  • Load the selected workspace’s dataset version and area asynchronously. Clear stale values when the workspace changes and ignore responses for an outdated selection.
  • Update dashboard tests to provide metadata in individual workspace responses. Add unit tests for request reuse, retry after failure, and cache clearing.

The dashboard read tdeiMetadata from GET /workspaces/mine, which sends it
for every workspace. For one created from a TDEI dataset it is the whole
dataset record, so it made the list large. The map and information panel
now get it for the selected workspace from GET /workspaces/{id}, through a
small per-workspace cache so they share one request. The map fetches it
alongside the bbox and falls back to the bbox outline if it fails.

This lets the backend drop tdeiMetadata from /mine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

Dashboard components now load workspace metadata through a service that caches requests by workspace ID. The dashboard clears that cache during setup and workspace refresh. Map and workspace-information tests now provide metadata through individual workspace detail responses.

Changes: Workspace metadata loading

Layer / File(s) Summary
Metadata cache and request behavior
services/workspace-metadata.ts, test/unit/services/workspace-metadata.test.ts
The service caches metadata requests by workspace ID, removes failed requests from the cache, and supports clearing all cached entries. Unit tests cover request results, reuse, retry, and cache clearing.
Dashboard cache lifecycle
pages/dashboard.vue
Dashboard setup and workspace refresh clear the metadata cache.
Metadata consumers and test fixtures
components/dashboard/Map.vue, components/dashboard/WorkspaceInformation.vue, test/e2e/dashboard.spec.ts
Map.vue loads metadata alongside the bbox request. WorkspaceInformation.vue loads metadata when the workspace ID changes and ignores outdated responses. End-to-end fixtures return metadata through individual workspace detail requests.

Priority: Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Sequence Diagram(s)

sequenceDiagram
  participant Dashboard as dashboard.vue
  participant Map as Map.vue
  participant Info as WorkspaceInformation.vue
  participant Metadata as loadWorkspaceMetadata
  participant Client as workspacesClient
  Dashboard->>Metadata: Clear cached metadata during setup
  Map->>Metadata: Load metadata by workspace ID
  Info->>Metadata: Load metadata by workspace ID
  Metadata->>Client: getWorkspace(id)
  Client-->>Metadata: Workspace detail response
  Metadata-->>Map: tdeiMetadata
  Metadata-->>Info: tdeiMetadata
Loading

Possibly related PRs

Suggested reviewers: shweta2101

Merge Risk: Moderate · up to 85e8e

Refreshing a workspace can leave its information panel showing outdated dataset details. Update the panel’s refresh behavior before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the map for green,
Then fetches details, fresh and clean.
A cached request hops down the line,
Failed calls can try a second time.
The dashboard clears the burrow’s slate,
And workspace details arrive in state.

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

@jeffmaki
jeffmaki merged commit 4c090c5 into develop Oct 28, 2026
1 of 2 checks passed
@jeffmaki
jeffmaki deleted the dashboard-fetch-workspace-metadata branch October 28, 2026 20:32
@jeffmaki jeffmaki mentioned this pull request Oct 28, 2026
jeffmaki added a commit that referenced this pull request Oct 30, 2026
Brings the Sentry changes to Stage, so Stage reports under `environment:
stage` and drops local-dev and network noise, plus a dashboard fix.

Includes:
- #176 Fetch the selected workspace's TDEI metadata on the dashboard
- #177 Report mostly real production defects to Sentry

After it deploys, `window.__NUXT__.config.public.sentryEnvironment` on
the Stage site should read `stage`.

🤖 Generated with [Claude Code](https://claude.com/claude-code)
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