mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-11 23:00:03 +00:00
feat(studio): persist per-element-type pinned groups in studioUiPreferences
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
384fe5934a
commit
0d7a60a525
@@ -28,6 +28,7 @@ export interface StudioUiPreferences {
|
||||
timelineZoomMode?: "fit" | "manual";
|
||||
/** Manual timeline zoom percent, paired with `timelineZoomMode: "manual"`. */
|
||||
timelineManualZoomPercent?: number;
|
||||
pinnedGroupsByElementType?: Record<string, string[]>;
|
||||
}
|
||||
|
||||
const STUDIO_UI_PREFERENCES_KEY = "hf-studio-ui-preferences";
|
||||
@@ -115,6 +116,15 @@ function readStorage(storage: Storage | null): StudioUiPreferences {
|
||||
) {
|
||||
preferences.timelineManualZoomPercent = parsed.timelineManualZoomPercent;
|
||||
}
|
||||
if (isRecord(parsed.pinnedGroupsByElementType)) {
|
||||
const map: Record<string, string[]> = {};
|
||||
for (const [kind, ids] of Object.entries(parsed.pinnedGroupsByElementType)) {
|
||||
if (Array.isArray(ids)) {
|
||||
map[kind] = ids.filter((id): id is string => typeof id === "string");
|
||||
}
|
||||
}
|
||||
preferences.pinnedGroupsByElementType = map;
|
||||
}
|
||||
return preferences;
|
||||
} catch {
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user