forge
Explore
Log in

Don't you dare go Hollow

menus and panels stay inside the glass: a card's context menu clamps to the viewport the way dropdown's place() already did, and the move submenu flips or pins itself inside too — its spot computed in the script because only JS knows the cursor and the pane; wide pickers take a floor that yields to the screen, the datepick anchors right so it opens inside the panel, tables and long runs fold or pan instead of overflowing; and a tablet band between the phone fold and the desktop keeps the desktop layout but gives tracks a readable floor, panning what doesn't fit the way the phone already does

Browse files at this commit

5af77e4eb318fc07b7137c4e89b067b2d98135b1Ahmet Kaan GümüşParent: 2117c60
crates/iz-web/src/board.rsmodified+32 -5
@@ -502,9 +502,15 @@ async fn render_card(
502502 }
503503 }
504504
505-/// Opens a card's context menu at the cursor and closes whichever one was
506-/// open; a plain document click closes it again. Rendered once — every
507-/// card's `@contextmenu` calls into this same global, by the menu's id.
505+/// Opens a card's context menu at the cursor — clamped inside the viewport
506+/// like `dropdown.rs`'s `place()`, with the move submenu flipped or pinned
507+/// to stay inside too; only JS knows the cursor and the viewport, so the
508+/// submenu's spot is computed here rather than left to its stylesheet's
509+/// `left: 100%`. The submenu is invisible until hover, so `placeSubmenus`
510+/// flashes each one open to measure — nothing paints mid-script. Closes
511+/// whichever one was open; a plain document click closes it again. Rendered
512+/// once — every card's `@contextmenu` calls into this same global, by the
513+/// menu's id.
508514 ///
509515 /// Also registers the board page's own `Escape` resolvers on
510516 /// `window.__izEsc`: the datepicker panel (priority 20 — below the
@@ -522,13 +528,34 @@ async fn card_menu_script(cx: &Cx) -> Result {
522528 if (window.__izCardMenu) { return; } \
523529 window.__izCardMenu = true; \
524530 function closeCardMenus() { document.querySelectorAll('.card-menu-open').forEach(function (el) { el.classList.remove('card-menu-open'); }); } \
531+ function placeSubmenus(menu) { \
532+ menu.querySelectorAll('.card-menu-submenu').forEach(function (sub) { \
533+ sub.style.display = 'block'; \
534+ var box = sub.getBoundingClientRect(); \
535+ var move = sub.parentElement.getBoundingClientRect(); \
536+ sub.style.display = ''; \
537+ var left = move.right + 4; \
538+ if (left + box.width > window.innerWidth - 4) { left = Math.max(4, move.left - 4 - box.width); } \
539+ var top = Math.max(4, Math.min(move.top, window.innerHeight - box.height - 4)); \
540+ sub.style.left = (left - move.left) + 'px'; \
541+ sub.style.top = (top - move.top) + 'px'; \
542+ sub.style.right = 'auto'; \
543+ sub.style.marginLeft = '0'; \
544+ sub.style.marginRight = '0'; \
545+ window.__izOwn(sub, [], ['style']); \
546+ }); \
547+ } \
525548 window.__izOpenCardMenu = function (e, id) { \
526549 closeCardMenus(); \
527550 var menu = document.getElementById(id); \
528551 if (!menu) { return; } \
529- menu.style.left = e.clientX + 'px'; \
530- menu.style.top = e.clientY + 'px'; \
531552 window.__izOwn(menu, ['card-menu-open'], ['style']); \
553+ var w = menu.offsetWidth, h = menu.offsetHeight; \
554+ var left = Math.max(4, Math.min(e.clientX, window.innerWidth - w - 4)); \
555+ var top = Math.max(4, Math.min(e.clientY, window.innerHeight - h - 4)); \
556+ menu.style.left = left + 'px'; \
557+ menu.style.top = top + 'px'; \
558+ placeSubmenus(menu); \
532559 }; \
533560 document.addEventListener('click', closeCardMenus); \
534561 window.__izEsc.register(20, function () { \
crates/iz-web/src/dropdown.rsmodified+10 -1
@@ -62,6 +62,10 @@ use topcoat::view::{Unescaped, view};
6262 /// with `?task=` registered it first and the modal chain won, closing
6363 /// the whole modal over an open dropdown — the registry pins the correct
6464 /// order; the whole table lives in `layout.rs`'s `escape_manager_script`).
65+/// A panel's rows are `white-space: nowrap`, so a long option never wraps —
66+/// `place` caps the open panel's width at `innerWidth − 8`, shaving off the
67+/// padding and borders a `max-width` does not cover, or its right edge would
68+/// clip on a 320px phone no matter where the left clamp puts it.
6569 pub async fn dropdown_script(cx: &Cx) -> Result {
6670 const JS: &str = "\
6771 (function () {\
@@ -76,6 +80,11 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
7680 }\
7781 function place(panel, trigger) {\
7882 var r = trigger.getBoundingClientRect();\
83+ var maxW = window.innerWidth - 8;\
84+ panel.style.maxWidth = '';\
85+ if (panel.offsetWidth > maxW) { panel.style.maxWidth = maxW + 'px'; }\
86+ var over = panel.offsetWidth - maxW;\
87+ if (over > 0) { panel.style.maxWidth = (maxW - over) + 'px'; }\
7988 var h = panel.offsetHeight;\
8089 var w = panel.offsetWidth;\
8190 var top = r.bottom + 4;\
@@ -84,7 +93,7 @@ pub async fn dropdown_script(cx: &Cx) -> Result {
8493 var left = Math.max(4, Math.min(r.left, window.innerWidth - w - 4));\
8594 panel.style.left = left + 'px';\
8695 panel.style.top = top + 'px';\
87- panel.style.minWidth = r.width + 'px';\
96+ panel.style.minWidth = Math.min(r.width, maxW) + 'px';\
8897 }\
8998 function visibleRows(panel) { return Array.prototype.slice.call(panel.querySelectorAll('.dd-option:not(.dd-option-hidden)')); }\
9099 function activate(panel, row) {\
style/_instrument.scssmodified+10 -0
@@ -262,6 +262,16 @@
262262 padding: 14px 20px;
263263 border-top: 1px solid var(--border);
264264 }
265+
266+// -- tablet band (621–1150px) ------------------------------------------------
267+// The bar's content — New task, three selects, the search box, chips — runs
268+// 900–1100px and wraps below ~1150px, where the fixed 40px would clip the
269+// second row into the board; the mobile layer concedes the same at 620px.
270+// The upper edge sits past the shared 621–1024 band because wrap pressure,
271+// not the breakpoint grid, decides where one row still fits.
272+@media (min-width: 621px) and (max-width: 1150px) {
273+ [data-ui="instrument"] .filterbar { height: auto; }
274+}
265275 // -- mobile (narrow viewports) -----------------------------------------------
266276 // Geometry that the skin sets with [data-ui]-prefixed rules and that the
267277 // shared mobile layer in main.scss cannot out-specify.
style/main.scssmodified+88 -12
@@ -870,6 +870,9 @@ a {
870870 font-weight: 600;
871871 line-height: 1.4;
872872 margin-top: 4px;
873+ // A pasted URL has no space to wrap at; without this it runs off the card
874+ // instead of folding.
875+ overflow-wrap: anywhere;
873876 }
874877
875878 .card-foot {
@@ -1723,7 +1726,13 @@ img.avatar {
17231726 box-shadow: var(--shadow-2);
17241727 }
17251728
1726-.pop-panel-wide { min-width: 320px; }
1729+// The wide pickers hang off a trigger sitting at a panel's edge; a flat
1730+// 320px floor walks them past a phone's viewport, where the locked body
1731+// keeps them unreachable. The floor yields to the screen first.
1732+.pop-panel-wide {
1733+ min-width: min(320px, calc(100dvw - 32px));
1734+ max-width: calc(100dvw - 32px);
1735+}
17271736
17281737 .pop-list {
17291738 display: flex;
@@ -1805,6 +1814,13 @@ img.avatar {
18051814 padding: 22px 24px 0;
18061815 }
18071816
1817+// The generic spacer grows, and here it once split the head's free width
1818+// with the headline fifty-fifty: a long title wrapped inside half the mast
1819+// while the other half sat empty. The headline's own flex already pushes
1820+// the trailing controls (status pill, close, board link) to the right edge,
1821+// so the spacer has nothing to do in this row.
1822+.detail-head > .spacer { flex-grow: 0; }
1823+
18081824 .detail-headline {
18091825 flex: 1;
18101826 min-width: 0;
@@ -1917,6 +1933,9 @@ img.avatar {
19171933 font-weight: 600;
19181934 letter-spacing: -0.01em;
19191935 line-height: 1.3;
1936+ // Same trap as the prose: an unbroken run would push the head row wider
1937+ // than the panel instead of folding.
1938+ overflow-wrap: anywhere;
19201939 }
19211940
19221941 .title-form {
@@ -2779,6 +2798,9 @@ img.avatar {
27792798 line-height: 1.55;
27802799 color: var(--ink-soft);
27812800 white-space: pre-wrap;
2801+ // pre-wrap keeps the author's lines but still needs somewhere to break
2802+ // a run that never ends.
2803+ overflow-wrap: anywhere;
27822804 }
27832805
27842806 .comment-composer {
@@ -3309,6 +3331,18 @@ input[type="radio"] {
33093331
33103332 // -- the member list --------------------------------------------------------
33113333
3334+// The members register keeps its named columns and pans inside the panel
3335+// rather than squeezing the role select out of the screen. Panning is not a
3336+// phone rescue: a mid-size window squeezes the same way.
3337+.table-pan {
3338+ overflow-x: auto;
3339+ scrollbar-width: none;
3340+
3341+ &::-webkit-scrollbar { display: none; }
3342+
3343+ .member-table { min-width: 560px; }
3344+}
3345+
33123346 // The columns are named, not counted, and only one of them is elastic.
33133347 //
33143348 // This was `table-layout: fixed` with a single hardcoded `width: 30%` on the
@@ -4132,6 +4166,16 @@ input[type="radio"] {
41324166 }
41334167
41344168 .topbar-nav-links { gap: 10px; }
4169+
4170+ // The stamp is a clock reading, not the news; below the smallest common
4171+ // phone it gives up its width and ends in an ellipsis, one line.
4172+ .log-stamp {
4173+ flex-shrink: 1;
4174+ min-width: 0;
4175+ overflow: hidden;
4176+ text-overflow: ellipsis;
4177+ white-space: nowrap;
4178+ }
41354179 }
41364180
41374181 // -- board -----------------------------------------------------------------
@@ -4199,6 +4243,16 @@ input[type="radio"] {
41994243
42004244 .detail-foot { padding: 14px 16px 16px; }
42014245
4246+ // -- popovers ----------------------------------------------------------------
4247+
4248+ // The datepick hangs from the right end of the filter row; anchored left
4249+ // it opens past the panel's clipped edge. Anchor it right, the way the
4250+ // assignee pop already is.
4251+ .datepick-pop .edit-form {
4252+ left: auto;
4253+ right: 0;
4254+ }
4255+
42024256 // -- the settings shell: rail becomes a strip -------------------------------
42034257
42044258 .settings-shell { flex-direction: column; }
@@ -4223,17 +4277,6 @@ input[type="radio"] {
42234277
42244278 .settings-stage { padding: 16px 16px 32px; }
42254279
4226- // The members register keeps its named columns and pans inside the panel
4227- // rather than squeezing the role select out of the screen.
4228- .table-pan {
4229- overflow-x: auto;
4230- scrollbar-width: none;
4231-
4232- &::-webkit-scrollbar { display: none; }
4233-
4234- .member-table { min-width: 560px; }
4235- }
4236-
42374280 .field-row { flex-wrap: wrap; }
42384281
42394282 // -- people -----------------------------------------------------------------
@@ -4259,3 +4302,36 @@ input[type="radio"] {
42594302
42604303 .auth-stage { padding: 0 16px 24px; }
42614304 }
4305+
4306+// --- Tablet (between the phone fold and the desktop) ------------------------
4307+//
4308+// The desktop layout holds here, but its evenly shared columns and fields
4309+// run short of room: a track keeps a floor to stay readable, and what does
4310+// not fit pans inside its region, the way it does on a phone. No document
4311+// scrollbar opens here either.
4312+@media (min-width: 621px) and (max-width: 1024px) {
4313+
4314+ // -- board -----------------------------------------------------------------
4315+
4316+ // Five or seven columns shared across a 620-something window are 90px
4317+ // slivers. Each keeps a card's width instead; the row pans sideways under
4318+ // the finger, silently, as the phone rail already does.
4319+ .board-columns {
4320+ grid-template-columns: none;
4321+ grid-auto-flow: column;
4322+ grid-auto-columns: minmax(180px, 1fr);
4323+ overflow-x: auto;
4324+ scroll-snap-type: x proximity;
4325+ scrollbar-width: none;
4326+
4327+ &::-webkit-scrollbar { display: none; }
4328+ }
4329+
4330+ .column { scroll-snap-align: start; }
4331+
4332+ // -- settings ----------------------------------------------------------------
4333+
4334+ // The rail keeps its width; two fields that no longer have the room for
4335+ // their columns stack instead of squeezing into slivers.
4336+ .field-row { flex-wrap: wrap; }
4337+}