Skip to content

feat(dataset): add --id flag and ?id= URL dataset selection#171

Merged
fahimfaisaal merged 3 commits into
mainfrom
feat/dataset-id-flag
Jun 28, 2026
Merged

feat(dataset): add --id flag and ?id= URL dataset selection#171
fahimfaisaal merged 3 commits into
mainfrom
feat/dataset-id-flag

Conversation

@fahimfaisaal

Copy link
Copy Markdown
Member

Summary

Adds a stable top-level id field on datasets, set via --id on the root command and chart subcommands. The UI uses ?id= for deep links when a dataset has an id, falling back to the legacy ?d= index param otherwise.

Changes

  • Go: Dataset.ID field, --id data flag, pipeline wiring in assembleDataset
  • UI: DataSet.id type, URL router prefers ?id= over ?d=
  • Tests: Go + Vitest coverage for assembly, passthrough, and URL routing
  • Embed: Regenerated pkg/template/vizb-ui.gen.go

Behavior

  • id is top-level on the dataset object (not inside meta)
  • Set once on fresh assembly; never overwritten on passthrough or re-run
  • ?id= takes precedence over ?d= when both are present in the URL

Usage

vizb data.csv --id sales-auto -o out.html
# Deep link: out.html?id=sales-auto

Introduce a top-level dataset id field set via --id on the root command
and chart subcommands. The UI prefers ?id= for deep links when present,
falling back to the legacy ?d= index param. Existing ids are preserved
on passthrough and are never overwritten.
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

Drop unreachable dataset-load defer in useUrlRouter, shorten --id help,
and remove redundant tests that duplicate resolveDatasetIndex wiring.
Add CLI flag reference on root and chart subcommands, a deep-links
section in the UI overview, and update examples/README copy to explain
?id= vs ?d= URL selection.
@fahimfaisaal
fahimfaisaal merged commit 2082a1e into main Jun 28, 2026
13 checks passed
@fahimfaisaal
fahimfaisaal deleted the feat/dataset-id-flag branch June 28, 2026 08:00
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.

2 participants