fix(ui): default floating dialog position to bottom-left

When the dialog first appears (mount) and when it switches to 'free' mode
(setMode), pin it to the bottom-left corner of the viewport (left: 20px,
bottom: 20px) rather than the previous bottom-right default. The header
drag handler still uses left/top for the new position, so this change
flows through cleanly on subsequent drags.

Note: existing users with a saved pos.x/pos.y in localStorage will still
see the dialog at the old transform-offset position until pos is reset
in a follow-up migration (see next commit).
This commit is contained in:
Claude
2026-06-01 22:24:01 -05:00
parent 501c6746eb
commit b03cc80665
+2 -2
View File
@@ -100,7 +100,7 @@ export class Dialog {
if (initialMode === 'free') { if (initialMode === 'free') {
root.style.bottom = '20px'; root.style.bottom = '20px';
root.style.right = '20px'; root.style.left = '20px';
if (initialPos.x || initialPos.y) { if (initialPos.x || initialPos.y) {
root.style.transform = `translate(${initialPos.x}px, ${initialPos.y}px)`; root.style.transform = `translate(${initialPos.x}px, ${initialPos.y}px)`;
} }
@@ -124,7 +124,7 @@ export class Dialog {
this.root.style.right = ''; this.root.style.right = '';
if (mode === 'free') { if (mode === 'free') {
this.root.style.bottom = '20px'; this.root.style.bottom = '20px';
this.root.style.right = '20px'; this.root.style.left = '20px';
} else if (anchorInfo && anchorInfo.canAnchor) { } else if (anchorInfo && anchorInfo.canAnchor) {
this._positionAnchored(anchorInfo.rect); this._positionAnchored(anchorInfo.rect);
} else { } else {