From 7337fd36f66b71504e0a77366ef6c663317b7604 Mon Sep 17 00:00:00 2001 From: Alexis Quintero Date: Sun, 4 Oct 2026 06:18:09 -0500 Subject: [PATCH] fix: no tiny nested scroll areas on phones (v0.4.1) - Status bar: one swipeable row of legend chips with an edge fade, the hint hidden, and a one-line selection bar (Copy / clear) only when something is selected. The map gains 71px. - Editing vector or insert opens a full-screen sheet with a large field and a Done button, instead of a 110px textarea inside a scrolling panel. - Enzyme dropdown height fits above the on-screen keyboard. Co-Authored-By: Claude Opus 5.5 --- CITATION.cff | 2 +- package.json | 2 +- src/ui/VectorEditor.tsx | 18 ++++++++-- src/ui/styles.css | 78 +++++++++++++++++++++++++++++++++++++++-- 4 files changed, 93 insertions(+), 7 deletions(-) diff --git a/CITATION.cff b/CITATION.cff index 139488a..e72d03c 100644 --- a/CITATION.cff +++ b/CITATION.cff @@ -2,7 +2,7 @@ cff-version: 1.2.0 message: "Si usas este software, por favor cítalo así. / If you use this software, please cite it as below." title: "Vector editor: in-browser cloning simulator with REBASE enzymes" type: software -version: 0.4.0 +version: 0.4.1 authors: - family-names: "Quintero López" given-names: "Oscar Alexis" diff --git a/package.json b/package.json index ab18fc8..bcf584f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@oquinterol/vector-editor", - "version": "0.4.0", + "version": "0.4.1", "description": "In-browser cloning simulator: choose commercial or custom restriction enzymes, digest and ligate, and get a live FASTA and plasmid map.", "license": "MIT", "author": "Oscar Alexis Quintero López (https://oquinterol.com)", diff --git a/src/ui/VectorEditor.tsx b/src/ui/VectorEditor.tsx index d7dd86f..6d204d6 100644 --- a/src/ui/VectorEditor.tsx +++ b/src/ui/VectorEditor.tsx @@ -87,6 +87,8 @@ function SequenceCard(props: {
{ event.preventDefault() setDragging(true) @@ -104,6 +106,11 @@ function SequenceCard(props: { {length ? name : labels.empty} + {editing && ( + + )} {length.toLocaleString()} {labels.bp} · {circular ? labels.circular : labels.linear} @@ -670,10 +677,15 @@ export function VectorEditor({ {labels.selection(c.range.start + 1, c.range.end || c.resultSeq.length, c.selectionLength)} - ) : ( diff --git a/src/ui/styles.css b/src/ui/styles.css index 4857d62..70147fb 100644 --- a/src/ui/styles.css +++ b/src/ui/styles.css @@ -948,9 +948,83 @@ .ve--embedded[data-compact] .ve-sidebar { overflow: auto; } +/* Status bar on phones: one swipeable row of chips, never a tiny scrolling box. */ .ve[data-compact] .ve-statusbar { - max-height: 7.5rem; - overflow: auto; + gap: 0.3rem; + padding: 0.5rem 0 0.5rem 0.75rem; +} +.ve[data-compact] .ve-legend { + flex-wrap: nowrap; + padding-right: 0.75rem; + overflow-x: auto; + overscroll-behavior-x: contain; + scroll-snap-type: x proximity; + scrollbar-width: none; + /* Fade at the edge hints that the row continues. */ + mask-image: linear-gradient(to right, #000 calc(100% - 2rem), transparent); +} +.ve[data-compact] .ve-legend::-webkit-scrollbar { + display: none; +} +.ve[data-compact] .ve-legend li { + flex: none; + scroll-snap-align: start; +} +.ve[data-compact] .ve-selection { + flex-wrap: nowrap; + gap: 0 0.9rem; + padding-right: 0.75rem; + white-space: nowrap; +} +.ve[data-compact] .ve-selection > span { + overflow: hidden; + text-overflow: ellipsis; +} +.ve[data-compact] .ve-selection > .ve-muted { + display: none; +} +.ve[data-compact] .ve-selection:not(:has(button)) { + display: none; +} + +/* Editing vector or insert on a phone: a full-screen sheet with a large field. */ +.ve-sheet-done { + display: none; +} +.ve[data-compact] .ve-card[data-sheet] { + position: fixed; + inset: 0; + z-index: 50; + display: flex; + flex-direction: column; + gap: 0.6rem; + padding: calc(0.75rem + env(safe-area-inset-top)) calc(0.75rem + env(safe-area-inset-right)) + calc(0.75rem + env(safe-area-inset-bottom)) calc(0.75rem + env(safe-area-inset-left)); + border: 0; + border-radius: 0; + background: var(--ve-bg); +} +.ve[data-compact] .ve-card[data-sheet] .ve-card-head { + grid-template-columns: auto minmax(0, 1fr) auto; + align-items: center; +} +.ve[data-compact] .ve-card[data-sheet] .ve-card-head .ve-muted { + grid-column: 1 / -1; +} +.ve[data-compact] .ve-card[data-sheet] .ve-sheet-done { + display: inline-flex; +} +.ve[data-compact] .ve-card[data-sheet] textarea { + flex: 1; + min-height: 0; + resize: none; +} +.ve[data-compact] .ve-card[data-sheet] .ve-card-actions > button[aria-expanded] { + display: none; +} +/* The enzyme dropdown must fit above the on-screen keyboard. */ +.ve[data-compact] .ve-listbox { + max-height: min(20rem, 40svh); } /* Short landscape (phone on its side): tabs become a left rail, chrome shrinks to one line. */