Popups pinned to the viewport, the rail hidden on phones, phone rows on two lines, focus ring only when focused
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 files changed,
+27
−12
internal/fichas/static/frame.css+7 −4internal/fichas/static/grid.css+8 −8internal/fichas/static/grid.js+12 −0
diff --git a/internal/fichas/static/frame.css b/internal/fichas/static/frame.css| index bff9179..03e7f10 100644 |
| --- a/internal/fichas/static/frame.css |
| +++ b/internal/fichas/static/frame.css |
| @@ -24,10 +24,6 @@ |
| @media (min-width: 800px) and (max-width: 1279.98px) { |
| [fichas-app]:not([data-rail]) { --fichas-rail-w: 56px; } |
| } |
| -@media (max-width: 799.98px) { |
| - [fichas-app] { display: block; } |
| - [fichas-rail] { display: none; } |
| -} |
| [fichas-main] { min-inline-size: 0; } |
| [fichas-main] > [rst-page] { max-inline-size: none; } |
| @@ -119,3 +115,10 @@ |
| [fichas-keys-list] { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0 0 var(--rst-sp-4); } |
| [fichas-keys-list] dt { white-space: nowrap; } |
| [fichas-keys-list] dd { margin: 0; color: var(--rst-text-muted); } |
| + |
| +/* Below 800px the rail is gone: the bar's Menu sheet carries the types. |
| + Last in the file, so it wins over the rail's own display. */ |
| +@media (max-width: 799.98px) { |
| + [fichas-app] { display: block; } |
| + [fichas-rail] { display: none; } |
| +} |
diff --git a/internal/fichas/static/grid.css b/internal/fichas/static/grid.css| index dff9944..91cfa4f 100644 |
| --- a/internal/fichas/static/grid.css |
| +++ b/internal/fichas/static/grid.css |
| @@ -13,7 +13,6 @@ |
| [fichas-grid] td[data-field] { cursor: text; position: relative; } |
| [fichas-grid] td[data-kind="enum"], [fichas-grid] td[data-kind="date"] { cursor: pointer; } |
| [fichas-grid] td[data-field]:hover { background: var(--rst-row-tint-hover, var(--rst-surface-2)); } |
| -[fichas-grid][role="grid"] :is(td, th)[tabindex="0"], |
| [fichas-grid][role="grid"] :is(td, th):focus-visible, |
| [fichas-grid] [data-active] { |
| outline: 2px solid var(--rst-accent); |
| @@ -257,18 +256,18 @@ textarea[fichas-quiet] { resize: vertical; line-height: 1.5; } |
| [fichas-grid] thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); } |
| [fichas-grid] tr { |
| display: grid; |
| - grid-template-columns: minmax(0, 1fr) auto; |
| + grid-template-columns: auto minmax(0, 1fr) auto; |
| align-items: center; |
| - gap: 4px 12px; |
| - padding: 12px 4px; |
| + column-gap: 16px; |
| + padding: 6px 4px; |
| border-block-end: 1px solid var(--rst-line); |
| } |
| [fichas-grid] :is(th, td) { display: none; padding: 0; border: 0; background: none; } |
| - [fichas-grid] [fichas-title-cell] { display: block; grid-column: 1; } |
| + [fichas-grid] [fichas-title-cell] { display: block; grid-column: 1 / 3; grid-row: 1; } |
| [fichas-grid] [fichas-title-link] { display: flex; align-items: center; min-block-size: 44px; font-size: 1.05rem; } |
| - /* the status pill, then the next two values */ |
| - [fichas-grid] td[data-kind="enum"] { display: block; grid-column: 2; grid-row: 1; justify-self: end; } |
| - [fichas-grid] td[data-field]:not([data-kind="enum"]):nth-child(-n+4) { display: block; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| + /* the status pill, then the next two values on one line */ |
| + [fichas-grid] td[data-kind="enum"] { display: block; grid-column: 3; grid-row: 1; justify-self: end; } |
| + [fichas-grid] td[data-field]:not([data-kind="enum"]):nth-child(-n+3) { display: block; grid-row: 2; font-size: var(--rst-fs-sm); color: var(--rst-text-muted); } |
| [fichas-grid] [fichas-cell-link] { display: flex; align-items: center; min-block-size: 44px; } |
| [fichas-grid-help] { padding-inline: 4px; } |
| @@ -277,6 +276,7 @@ textarea[fichas-quiet] { resize: vertical; line-height: 1.5; } |
| [fichas-pane] { padding: 4px 0 32px; } |
| [fichas-card-fields] { grid-template-columns: 1fr; } |
| [fichas-card-top] [rst-btn] { min-block-size: 44px; } |
| + [fichas-card-steps] [fichas-meta] { display: none; } |
| [fichas-card-close] { min-inline-size: 44px; min-block-size: 44px; } |
| } |
diff --git a/internal/fichas/static/grid.js b/internal/fichas/static/grid.js| index 6a7028d..483c0af 100644 |
| --- a/internal/fichas/static/grid.js |
| +++ b/internal/fichas/static/grid.js |
| @@ -312,6 +312,15 @@ |
| }); |
| } |
| + // place pins a popup under its cell in the viewport's coordinates, so |
| + // the table's own scrolling box never clips it. |
| + function place(popup, cell) { |
| + var r = cell.getBoundingClientRect(); |
| + popup.style.position = "fixed"; |
| + popup.style.top = Math.round(r.bottom + 4) + "px"; |
| + popup.style.left = Math.round(Math.min(r.left, window.innerWidth - 240)) + "px"; |
| + } |
| + |
| function closeEditors() { document.querySelectorAll("[fichas-editor], [fichas-picker], [fichas-editor-error]").forEach(function (n) { n.remove(); }); } |
| function closeEditor(cell, refocus) { |
| @@ -337,6 +346,7 @@ |
| pick.appendChild(search); |
| pick.appendChild(list); |
| box.appendChild(pick); |
| + place(pick, cell); |
| var active = 0; |
| function draw() { |
| var q = search.value.toLowerCase(); |
| @@ -418,6 +428,7 @@ |
| err.id = "fichas-editor-error"; |
| err.textContent = message; |
| cell.appendChild(err); |
| + place(err, cell); |
| if (input) { input.setAttribute("aria-invalid", "true"); input.setAttribute("aria-describedby", err.id); } |
| } |
| @@ -440,6 +451,7 @@ |
| err.appendChild(keep); |
| err.appendChild(use); |
| cell.appendChild(err); |
| + place(err, cell); |
| keep.focus(); |
| } |