Skip to content

📊 Refactor chart-preview extension: unify chart and dataset preview#5717

Merged
Marigold merged 2 commits intomasterfrom
data-chartpreview-unify
Feb 26, 2026
Merged

📊 Refactor chart-preview extension: unify chart and dataset preview#5717
Marigold merged 2 commits intomasterfrom
data-chartpreview-unify

Conversation

@Marigold
Copy link
Collaborator

@Marigold Marigold commented Feb 26, 2026

Summary

Refactor and enhance the chart-preview VSCode extension:

  • Unified preview architecture: Strategy pattern (chartStrategy / datasetStrategy) replaces separate code paths for chart and dataset previews
  • Auto-detect instant mode: YAML file changes automatically use --instant (metadata-only), Python changes trigger full rebuild — no more manual --instant flag
  • Staging link: Grapher dataset previews show a clickable link to the staging admin
  • Search/filter indicators: Dataset preview includes a search bar to filter indicators by name
  • Unified error handling: Single "Preview Error" page with full traceback + Retry button (removed duplicate "Step Failed" overlay)
  • Extra dimensions support: Dataset preview shows dimension dropdowns for datasets with extra dims
  • .meta.yml support: Opening a .meta.yml file triggers the dataset preview for its parent step
  • Quality flags: Fixed description_key display (was showing [object Object]), hide empty unit fields
  • Slimmer package: Added .vscodeignore to exclude out/, src/, build config from .vsix

🤖 Generated with Claude Code

Marigold and others added 2 commits February 26, 2026 10:23
Introduce a PreviewStrategy interface to eliminate duplicated code between
chart preview and dataset preview. Both now share a single openPreview()
and startWatchProcess() flow, with strategy objects providing the
type-specific behavior (completion detection, reload HTML, etc.).

Key simplifications:
- Replace complex stepsRunning/detectingDirty/pendingReloadTimer state
  machine with the universal "--- Dataset rebuild complete" sentinel
- Remove auto-restart on crash (Retry button handles this now)
- Add Retry button to all chart preview error screens (was dataset-only)
- Consistent error titles ("Preview Error" for both paths)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@owidbot
Copy link
Contributor

owidbot commented Feb 26, 2026

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-data-chartpreview-unify

chart-diff: ✅ No charts for review.
data-diff: ✅ No differences found

Automatically updated datasets matching excess_mortality|covid|fluid|flunet|country_profile|garden/ihme_gbd/2019/gbd_risk are not included

Edited: 2026-02-26 09:27:00 UTC
Execution time: 10.46 seconds

@Marigold Marigold marked this pull request as ready for review February 26, 2026 12:10
@Marigold
Copy link
Collaborator Author

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8541cf36bd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@Marigold Marigold merged commit 43b1b6d into master Feb 26, 2026
6 of 7 checks passed
@Marigold Marigold deleted the data-chartpreview-unify branch February 26, 2026 12:23
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