Merge branch 'dev'

This commit is contained in:
Jeff Emmett 2026-03-23 16:39:00 -07:00
commit 83c729f3df
1 changed files with 10 additions and 3 deletions

View File

@ -115,15 +115,22 @@ export class RStackSpaceSettings extends HTMLElement {
if (this._open) this.close(); else this.open();
}
/** Position the panel below the settings button, right-aligned. */
/** Position the panel below the settings button, left-aligned with screen clamping. */
private _positionPanel() {
const panel = this.shadowRoot?.querySelector(".panel") as HTMLElement | null;
const btn = document.getElementById("settings-btn");
if (!panel || !btn) return;
const rect = btn.getBoundingClientRect();
const panelWidth = Math.min(380, window.innerWidth * 0.9);
// Align panel's left edge with the button, but clamp so it stays on screen
let left = rect.left;
if (left + panelWidth > window.innerWidth - 8) {
left = window.innerWidth - panelWidth - 8;
}
if (left < 8) left = 8;
panel.style.top = `${rect.bottom + 6}px`;
panel.style.right = `${window.innerWidth - rect.right}px`;
panel.style.left = "auto";
panel.style.left = `${left}px`;
panel.style.right = "auto";
}
private async _loadData() {