feat(studio): add flat-inspector tokens and STUDIO_FLAT_INSPECTOR_ENABLED flag

This commit is contained in:
Vance Ingalls
2026-07-14 00:59:06 -07:00
parent 6933e8acda
commit 3dc11c7137
4 changed files with 29 additions and 0 deletions
+6
View File
@@ -325,6 +325,12 @@
"file": "packages/core/src/figma/manifest.ts",
"exports": ["mediaDir", "typeDirPath", "isFigmaManifestRecord"],
},
// STUDIO_FLAT_INSPECTOR_ENABLED: exported for use by downstream studio
// inspector redesign tasks; consumed by components in later PRs.
{
"file": "packages/studio/src/components/editor/manualEditingAvailability.ts",
"exports": ["STUDIO_FLAT_INSPECTOR_ENABLED"],
},
],
"ignoreDependencies": [
// Runtime/dynamic deps not visible to static analysis: tsup `external`,
@@ -105,4 +105,14 @@ describe("manual editing availability", () => {
expect(resolveStudioBooleanEnvFlag({ EMPTY: "" }, ["EMPTY"], true)).toBe(true);
expect(resolveStudioBooleanEnvFlag({ UNKNOWN: "maybe" }, ["UNKNOWN"], false)).toBe(false);
});
it("defaults the flat inspector flag to false and honors an explicit override", async () => {
const off = await loadAvailabilityWithEnv({});
expect(off.STUDIO_FLAT_INSPECTOR_ENABLED).toBe(false);
const on = await loadAvailabilityWithEnv({
VITE_STUDIO_FLAT_INSPECTOR_ENABLED: "true",
});
expect(on.STUDIO_FLAT_INSPECTOR_ENABLED).toBe(true);
});
});
@@ -97,4 +97,13 @@ export const STUDIO_SDK_RESOLVER_SHADOW_ENABLED = resolveStudioBooleanEnvFlag(
true,
);
// Studio inspector redesign ("Ledger, flat" — design_handoff_studio_inspector):
// flat identity header/footer/groups behind a flag for incremental review.
// Default false; enable via VITE_STUDIO_FLAT_INSPECTOR_ENABLED=true.
export const STUDIO_FLAT_INSPECTOR_ENABLED = resolveStudioBooleanEnvFlag(
env,
["VITE_STUDIO_ENABLE_FLAT_INSPECTOR", "VITE_STUDIO_FLAT_INSPECTOR_ENABLED"],
false,
);
export const STUDIO_MANUAL_EDITING_DISABLED_TITLE = "Manual editing is temporarily disabled";
@@ -17,6 +17,8 @@ const studioPreset = {
hover: "#27272A",
border: "#1E1E1E",
"border-input": "#27272A",
hairline: "#1A1A1C",
"text-0": "#FAFAFA",
"text-1": "#E4E4E7",
"text-2": "#A1A1AA",
"text-3": "#71717A",
@@ -24,6 +26,8 @@ const studioPreset = {
"text-5": "#3F3F46",
accent: "#3CE6AC",
danger: "#EF4444",
media: "#00E3FF",
container: "#F5A623",
},
},
},