Skip to content

Commit 0ea9898

Browse files
committed
fix: stale live preview position preference cache
1 parent 907a5e8 commit 0ea9898

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

src/LiveDevelopment/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ define(function main(require, exports, module) {
7373
showRulerLines: false, // default value, this will get updated when the extension loads
7474
showStylesBar: true, // default value, this will get updated when the extension loads
7575
showStarterBar: true, // default value, this will get updated when the extension loads
76-
stylesBarPosition: "", // saved dock side ("top"/"bottom"); empty = default bottom
76+
stylesBarPosition: "bottom", // saved dock side ("top"/"bottom")
7777
syncSourceAndPreview: true, // default value, this will get updated when the extension loads
7878
imageGalleryAutoOpen: true, // auto-open gallery on first image click per session
7979
isPaidUser: false, // will be updated when we fetch entitlements
@@ -356,7 +356,7 @@ define(function main(require, exports, module) {
356356
function updateStylesBarPositionConfig() {
357357
const prefValue = PreferencesManager.get(CONSTANTS.PREFERENCE_STYLES_BAR_POSITION);
358358
const config = MultiBrowserLiveDev.getConfig();
359-
config.stylesBarPosition = prefValue || "";
359+
config.stylesBarPosition = prefValue || "bottom";
360360
MultiBrowserLiveDev.updateConfig(config);
361361
}
362362

src/extensionsIntegrated/Phoenix-live-preview/main.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,11 @@ define(function (require, exports, module) {
127127
description: Strings.LIVE_DEV_SETTINGS_SHOW_STARTER_BAR_PREFERENCE
128128
});
129129

130-
// live preview styles bar position preference; persists where the user last dragged the bar
130+
// live preview styles bar dock side preference; persisted when the user flips the bar's dock button
131131
const PREFERENCE_STYLES_BAR_POSITION = CONSTANTS.PREFERENCE_STYLES_BAR_POSITION;
132-
PreferencesManager.definePreference(PREFERENCE_STYLES_BAR_POSITION, "string", "", {
133-
description: Strings.LIVE_DEV_SETTINGS_STYLES_BAR_POSITION_PREFERENCE
132+
PreferencesManager.definePreference(PREFERENCE_STYLES_BAR_POSITION, "string", "bottom", {
133+
description: Strings.LIVE_DEV_SETTINGS_STYLES_BAR_POSITION_PREFERENCE,
134+
values: ["top", "bottom"]
134135
});
135136

136137
const LIVE_PREVIEW_PANEL_ID = "live-preview-panel";

src/nls/root/strings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ define({
185185
"LIVE_DEV_SETTINGS_SHOW_RULER_LINES_PREFERENCE": "Show measurements when elements are selected in live preview. Defaults to 'false'",
186186
"LIVE_DEV_SETTINGS_SHOW_STYLES_BAR_PREFERENCE": "Show the styles bar when elements are selected in live preview. Defaults to 'true'",
187187
"LIVE_DEV_SETTINGS_SHOW_STARTER_BAR_PREFERENCE": "Show the starter bar when the live preview page is empty. Defaults to 'true'",
188-
"LIVE_DEV_SETTINGS_STYLES_BAR_POSITION_PREFERENCE": "Saved position of the live preview styles bar, set automatically when the bar is dragged. Empty places the bar at its default spot",
188+
"LIVE_DEV_SETTINGS_STYLES_BAR_POSITION_PREFERENCE": "Which edge the live preview styles bar docks to, 'top' or 'bottom'. Defaults to 'bottom'",
189189
"LIVE_DEV_TOOLBOX_SELECT_PARENT": "Select Parent",
190190
"LIVE_DEV_TOOLBOX_EDIT_TEXT": "Edit Text",
191191
"LIVE_DEV_TOOLBOX_DOUBLE_CLICK_HINT": "Double-click",

0 commit comments

Comments
 (0)