Skip to content

🚀 Variables Editor, theme switcher, and dependency security fixes - #226

Merged
sergak01 merged 9 commits into
developfrom
pp-3990
Aug 7, 2026
Merged

🚀 Variables Editor, theme switcher, and dependency security fixes#226
sergak01 merged 9 commits into
developfrom
pp-3990

Conversation

@sergak01

@sergak01 sergak01 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • 🚀 Adds a standalone Variables Editor page (/@pp-dev/variables-editor) for editing a template's variable schema and a page's live variable values, alongside the existing Request Inspector — plus new "Reload variables" / "Open variables editor…" buttons in the dev panel.
  • 🚀 Adds an Auto/Dark/Light theme switcher, now hosted primarily in the dev panel's settings popover and shared (via localStorage) with the standalone Inspector and Variables Editor pages.
  • 🔧 Fixes the Variables Editor's tab switch blanking out until the network request resolves (now shows cached content or a skeleton immediately, debounces the background reload), and adds a confirm-before-delete step plus a more ergonomic advanced-fields toggle in the Schema tab.
  • 🔐 Resolves npm audit findings in root and all 3 test fixtures — 0 vulnerabilities across the board.
  • 🧹 Replaces the outdated 1.0 planning docs with a real, screenshot-based feature tour (docs/features.md), linked from the README.

Key changes

Variables Editor

  • src/lib/variables-editor.ts — new standalone page: Schema tab (edit __template_variables.json) and Values tab (edit live page-variable values), each with a raw-JSON escape hatch.
  • src/lib/page-variables-diff.ts, src/api/page-variable.ts, src/lib/pp.middleware.ts — schema/export/validation helpers and PageVariableAPI backing the editor and the dev-panel "Reload variables" action.
  • Dev panel gets "Reload variables" and "Open variables editor…" buttons (gated on the page having a template), plus an always-available "Open request inspector…" button.

Theme switcher

  • src/client/theme.ts (new) — shared getStoredTheme/setTheme/initTheme, using one localStorage key (pp-dev-info-theme) and one DOM attribute (data-pp-dev-theme) across the dev panel, Inspector, and Variables Editor.
  • Adds light-theme support to the previously dark-only Inspector/Variables Editor.

Variables Editor UX fixes

  • Tab switches now repaint instantly with cached data (or a skeleton if never loaded) instead of leaving stale content on screen; the follow-up network reload is debounced (200ms) — the manual "↻ Refresh" button stays immediate.
  • Schema-tab advanced fields (uid, tag_source, additional_options, editor flags) now expand via a chevron at the start of each row instead of a gear icon at the far right end.
  • Deleting a Schema or Values row now requires confirmation.

Security

  • Bumped brace-expansion/ip-address/undici overrides past newly-disclosed vulnerable ranges (root + all 3 fixtures), added a js-yaml override in the Next.js fixtures for a CVE published mid-session.
  • Extended scripts/patch-npm-bundled-vulnerabilities.mjs to also cover undici (it already patched brace-expansion/ip-address/tar bundled inside the npm package via semantic-release), and to sync the patched versions into package-lock.json — the script only ever rewrote files on disk, so npm audit kept flagging the stale versions it still had recorded in the lockfile.

Included commits

36c727e feat: add page-variables API and schema/export/validation helpers
40bc88e feat: add standalone Variables Editor page with dev-panel entry points
536628c docs: document the Variables Editor, fix stale page-variables references
b6f72a6 feat: add Auto/Dark/Light theme switcher, shared across the dev panel, Inspector, and Variables Editor
bce87ee docs: add screenshot feature tour, link it from README
399930d fix: Variables Editor tab switch no longer blanks out until the fetch resolves
6cc96ee fix: Variables Editor — ergonomic advanced-fields toggle, confirm before delete
8600363 chore: reinstall pp-dev in test fixtures
a33aad3 fix: address npm audit vulnerabilities in root and test fixtures

Testing

  • npx tsc --noEmit — clean
  • npm run test:unit — 274/274 passing
  • npm run test:integration — 39/39 passing
  • npm run audit:all — 0 vulnerabilities in root + all 3 test fixtures
  • Manually verified in a live browser session (Playwright + real dev server) against a Metric Insights staging instance: dev panel, Request Inspector, Variables Editor (Schema/Values/raw-JSON/theme), theme propagation across pages, tab-switch caching/debounce, and delete confirmation.

Merge Request: origin/pp-3990origin/develop

Adds PageVariableAPI and live page-variable read/write on MiAPI, plus
the schema/export/validation helpers that the Variables Editor and
dev-panel "Reload variables" feature build on.
New /@pp-dev/variables-editor page (Schema + Values tabs), alongside
the existing Request Inspector, plus "Reload variables" and "Open
variables editor…" buttons in the dev panel's settings popover.
Extends the test-commonjs fixture's __template_variables.json to
cover every tag_type for manual/e2e testing.
Documents the new Variables Editor and dev-panel buttons in the
README, and fixes two stale references: templateLess described as a
current public config key (it's 0.x-only, migrated to app.type), and
TEMPLATE_VARIABLES.md describing the removed Setup/Export dev-panel
flow instead of the Values tab's actual JSON mode.
…, Inspector, and Variables Editor

Adds light-theme support to the previously dark-only Request Inspector
and Variables Editor, an Auto/Dark/Light switcher for both, then moves
the switcher into the dev panel's settings popover as the primary
control. All three surfaces share one localStorage key
(pp-dev-info-theme) and DOM attribute (data-pp-dev-theme), so a choice
made in any of them applies to the others too.

Also removes docs/ files planning the (now shipped) 1.0 config
rework — no longer needed.
Adds docs/features.md with real screenshots of the dev panel, Request
Inspector, and Variables Editor, and links it from the README. Also
embeds a few of the same screenshots directly into the relevant README
sections and documents the new panel-hosted theme switcher.
… resolves

Switching tabs now repaints immediately with whatever's already cached
for the target tab, or a skeleton if it's never been loaded, instead
of leaving the previous tab's content on screen until the network
round-trip completes. The round-trip itself is now debounced (200ms)
since it's automatic — the existing manual "Refresh" button stays
undebounced for when an immediate reload is actually wanted. A small
"Refreshing…" indicator in the toolbar covers the case where cached
content is showing while a background reload is in flight.
…ore delete

The gear icon that opened a schema row's advanced fields (uid,
tag_source, additional_options, editor flags) sat in the far-right
actions column, forcing a mouse trip across the whole row for every
variable. It's now a chevron at the start of the row, right next to
Name, so scanning down a column of rows to check/expand several of
them no longer means reaching all the way over each time.

Also: deleting a schema or values row no longer happens on a single
click — both now go through the existing confirm-modal pattern first.
Picks up all of the above in the built package.
Bumps brace-expansion/ip-address/undici overrides past newly-disclosed
vulnerable ranges (root + all 3 fixtures), and adds a js-yaml override
in the Next.js fixtures for a CVE published mid-session. Also extends
patch-npm-bundled-vulnerabilities.mjs to cover undici (it already
patched brace-expansion/ip-address/tar) and to sync the patched
versions into package-lock.json — the script only ever rewrote files
on disk, so npm audit kept flagging the stale versions it still had
recorded in the lockfile.

npm audit is clean (0 vulnerabilities) in root and all 3 test
fixtures.
@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2ff9cdc4-938e-4b5a-a293-38bcbcb54da1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

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

@sergak01 sergak01 self-assigned this Aug 7, 2026
@sergak01
sergak01 merged commit a458865 into develop Aug 7, 2026
3 checks passed
@sergak01
sergak01 deleted the pp-3990 branch August 7, 2026 09:04
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