Fix mobile popup/modal issues across shell components
CI/CD / deploy (push) Failing after 9s Details

- Space switcher: clamp menu left to prevent right-edge overflow,
  add max-width: calc(100vw - 8px), scrollable tabs with smaller
  padding on mobile
- Auth/edit modals: add max-height: 90dvh + overflow-y: auto so
  virtual keyboard doesn't push modal off-screen, reduce padding
  on small screens
- Identity dropdown: raise z-index from 100 to 10002 so it renders
  above the app-switcher sidebar (10001)
- Device nudge toast: constrain max-width to viewport width
- App switcher: add translucent backdrop overlay on mobile (<640px)
  with tap-to-dismiss
- Add :active pseudo-class alongside :hover on interactive elements
  for touch tap feedback

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Jeff Emmett 2026-04-01 11:35:14 -07:00
parent 94964dfe88
commit 29cd6168f9
3 changed files with 36 additions and 12 deletions

View File

@ -362,6 +362,7 @@ export class RStackAppSwitcher extends HTMLElement {
<style>${STYLES}</style>
<div class="switcher">
<button class="trigger" id="trigger">${triggerContent} <span class="caret"></span></button>
<div class="sidebar-backdrop" id="backdrop"></div>
<div class="sidebar" id="sidebar">
<button class="collapse-btn" id="collapse" title="Close sidebar"></button>
${this.#renderGroupedModules(current)}
@ -372,10 +373,12 @@ export class RStackAppSwitcher extends HTMLElement {
const trigger = this.#shadow.getElementById("trigger")!;
const sidebar = this.#shadow.getElementById("sidebar")!;
const collapse = this.#shadow.getElementById("collapse")!;
const backdrop = this.#shadow.getElementById("backdrop")!;
// Sync sidebar DOM with tracked state (survives re-renders)
if (this.#isOpen) {
sidebar.classList.add("open");
backdrop.classList.add("visible");
document.body.classList.add("rstack-sidebar-open");
} else {
document.body.classList.remove("rstack-sidebar-open");
@ -384,11 +387,13 @@ export class RStackAppSwitcher extends HTMLElement {
const open = () => {
this.#isOpen = true;
sidebar.classList.add("open");
backdrop.classList.add("visible");
document.body.classList.add("rstack-sidebar-open");
};
const close = () => {
this.#isOpen = false;
sidebar.classList.remove("open");
backdrop.classList.remove("visible");
document.body.classList.remove("rstack-sidebar-open");
};
const toggle = () => {
@ -401,6 +406,7 @@ export class RStackAppSwitcher extends HTMLElement {
});
collapse.addEventListener("click", () => close());
backdrop.addEventListener("click", () => close());
// Close sidebar when clicking outside (on main content)
if (this.#outsideClickHandler) {
@ -603,6 +609,16 @@ const STYLES = `
.caret { font-size: 0.7em; opacity: 0.6; }
/* ── Sidebar backdrop (mobile) ── */
.sidebar-backdrop {
display: none; position: fixed; inset: 0; z-index: 10000;
background: rgba(0,0,0,0.4); opacity: 0; transition: opacity 0.25s ease;
-webkit-tap-highlight-color: transparent;
}
@media (max-width: 640px) {
.sidebar-backdrop.visible { display: block; opacity: 1; }
}
/* ── Sidebar panel ── */
.sidebar {
position: fixed;
@ -636,7 +652,7 @@ const STYLES = `
transition: background 0.15s, color 0.15s;
z-index: 1;
}
.collapse-btn:hover {
.collapse-btn:hover, .collapse-btn:active {
background: var(--rs-bg-hover);
color: var(--rs-text-primary);
}
@ -648,7 +664,7 @@ a.rstack-header {
text-decoration: none; color: inherit; cursor: pointer;
transition: background 0.12s;
}
a.rstack-header:hover { background: var(--rs-bg-hover); }
a.rstack-header:hover, a.rstack-header:active { background: var(--rs-bg-hover); }
.rstack-badge {
display: flex; align-items: center; justify-content: center;
width: 28px; height: 28px; border-radius: 8px;

View File

@ -467,7 +467,7 @@ export class RStackIdentity extends HTMLElement {
.eid-device-nudge {
position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999;
background: var(--rs-bg-surface, #1e1e2e); border: 1px solid rgba(6,182,212,0.4);
border-radius: 14px; padding: 1rem 1.25rem; max-width: 340px;
border-radius: 14px; padding: 1rem 1.25rem; max-width: min(340px, calc(100vw - 3rem));
box-shadow: 0 8px 32px rgba(0,0,0,0.4); animation: eid-nudge-in 0.4s ease-out;
color: var(--rs-text-primary, #e2e8f0); font-family: system-ui, sans-serif;
}
@ -2307,7 +2307,7 @@ const STYLES = `
.dropdown {
position: absolute; top: 100%; right: 0; margin-top: 8px;
min-width: 200px; border-radius: 10px; overflow: hidden;
box-shadow: 0 8px 30px rgba(0,0,0,0.2); display: none; z-index: 100;
box-shadow: 0 8px 30px rgba(0,0,0,0.2); display: none; z-index: 10002;
}
.dropdown.open { display: block; }
.dropdown.open { display: block; background: var(--rs-bg-surface); border: 1px solid var(--rs-border); }
@ -2475,9 +2475,11 @@ const MODAL_STYLES = `
.auth-modal {
background: var(--rs-bg-surface); border: 1px solid var(--rs-border);
border-radius: 16px; padding: 2rem; max-width: 420px; width: 90%;
max-height: 90dvh; overflow-y: auto;
text-align: center; color: var(--rs-text-primary); box-shadow: var(--rs-shadow-lg);
animation: slideUp 0.3s;
}
@media (max-width: 480px) { .auth-modal { padding: 1.25rem; } }
.auth-modal h2 {
font-size: 1.5rem; margin-bottom: 0.5rem;
background: linear-gradient(135deg, #06b6d4, #7c3aed);
@ -2518,7 +2520,7 @@ const MODAL_STYLES = `
cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
transition: all 0.15s;
}
.close-btn:hover { color: var(--rs-text-primary); background: var(--rs-bg-hover); }
.close-btn:hover, .close-btn:active { color: var(--rs-text-primary); background: var(--rs-bg-hover); }
.auth-modal { position: relative; }
.actions--stack { flex-direction: column; }
.btn--outline {

View File

@ -108,7 +108,7 @@ export class RStackSpaceSwitcher extends HTMLElement {
if (isOpen) {
const rect = trigger.getBoundingClientRect();
menu.style.top = `${rect.bottom + 6}px`;
menu.style.left = `${Math.max(4, rect.left)}px`;
menu.style.left = `${Math.max(4, Math.min(window.innerWidth - 268, rect.left))}px`;
if (!this.#loaded) {
await this.#loadSpaces();
this.#renderMenu(menu, current);
@ -1813,7 +1813,7 @@ const STYLES = `
.menu {
position: fixed; margin-top: 0;
min-width: 260px; max-height: 400px; overflow-y: auto;
min-width: 260px; max-width: calc(100vw - 8px); max-height: 400px; overflow-y: auto;
border-radius: 12px; box-shadow: var(--rs-shadow-lg);
display: none; z-index: 10001;
background: var(--rs-bg-surface); border: 1px solid var(--rs-border);
@ -1979,9 +1979,11 @@ const REQUEST_MODAL_STYLES = `
.auth-modal {
background: var(--rs-bg-surface); border: 1px solid var(--rs-border);
border-radius: 16px; padding: 2rem; max-width: 420px; width: 90%;
max-height: 90dvh; overflow-y: auto;
text-align: center; color: var(--rs-text-primary); box-shadow: var(--rs-shadow-lg);
animation: slideUp 0.3s; position: relative;
}
@media (max-width: 480px) { .auth-modal { padding: 1.25rem; } }
.auth-modal h2 {
font-size: 1.5rem; margin-bottom: 0.5rem;
background: linear-gradient(135deg, #06b6d4, #7c3aed);
@ -2012,7 +2014,7 @@ const REQUEST_MODAL_STYLES = `
background: none; border: none; color: var(--rs-text-muted); font-size: 1.5rem;
cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.close-btn:hover { color: var(--rs-text-primary); background: var(--rs-border); }
.close-btn:hover, .close-btn:active { color: var(--rs-text-primary); background: var(--rs-border); }
.spinner {
display: inline-block; width: 18px; height: 18px;
border: 2px solid transparent; border-top-color: currentColor;
@ -2033,9 +2035,11 @@ const EDIT_SPACE_MODAL_STYLES = `
.edit-modal {
background: var(--rs-bg-surface); border: 1px solid var(--rs-border);
border-radius: 16px; padding: 2rem; max-width: 520px; width: 92%;
max-height: 90dvh; overflow-y: auto;
color: var(--rs-text-primary); box-shadow: var(--rs-shadow-lg);
animation: slideUp 0.3s; position: relative;
}
@media (max-width: 480px) { .edit-modal { padding: 1.25rem; } }
.edit-modal h2 {
font-size: 1.5rem; margin: 0 0 1rem;
background: linear-gradient(135deg, #06b6d4, #7c3aed);
@ -2046,17 +2050,19 @@ const EDIT_SPACE_MODAL_STYLES = `
background: none; border: none; color: var(--rs-text-muted); font-size: 1.5rem;
cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 6px;
}
.close-btn:hover { color: var(--rs-text-primary); background: var(--rs-border); }
.close-btn:hover, .close-btn:active { color: var(--rs-text-primary); background: var(--rs-border); }
/* Tabs */
.tabs { display: flex; gap: 4px; margin-bottom: 1.2rem; border-bottom: 1px solid var(--rs-border); padding-bottom: 0; }
.tabs { display: flex; gap: 4px; margin-bottom: 1.2rem; border-bottom: 1px solid var(--rs-border); padding-bottom: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
padding: 8px 16px; border: none; background: none; color: var(--rs-text-secondary);
font-size: 0.85rem; font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent;
transition: all 0.15s; border-radius: 6px 6px 0 0;
transition: all 0.15s; border-radius: 6px 6px 0 0; white-space: nowrap; flex-shrink: 0;
}
.tab:hover { color: var(--rs-text-primary); background: var(--rs-bg-hover); }
.tab:hover, .tab:active { color: var(--rs-text-primary); background: var(--rs-bg-hover); }
.tab.active { color: #06b6d4; border-bottom-color: #06b6d4; }
@media (max-width: 480px) { .tab { padding: 8px 12px; font-size: 0.8rem; } }
.tab-panel { }
.tab-panel.hidden { display: none; }