Tengo Gzirishvili Claude Sonnet 4.6 commited on
Commit
cd5ab31
·
1 Parent(s): 5a6022d

CRISPR UI: fix results-header layout, add My designs nav, surface 3-D viewer

Browse files

Three fixes from customer feedback on the live tool:

1. Results header was collapsing the title/sub into one word per line
because the overloaded action cluster (vendor buttons + Save + My
designs + Download) had no desktop flex rule, so it stole all the
width from .card-header-left (flex:1; min-width:0). Moved the
'Order all guides from' vendor buttons out of the header into a
full-width strip above the cloning picker, and gave .results-actions
a proper flex-shrink:0 layout so the buttons form a tidy group.

2. Saved designs were only reachable via a button inside the results
card (hidden until you ran a design). Added a 'My designs' item to
the sidebar nav that opens the saved-designs modal from anywhere,
so signed-in users can reopen past work without generating first.

3. The 3-D structure viewer (M5) was buried inside the collapsed
per-row why-panel and only when a human/mouse gene was set, so users
couldn't find it. Now: a visible '⌖ 3-D' button renders in the rank
cell when the cut maps to a residue, and the why-panel shows a clear
'add a gene symbol + organism to enable' hint when it can't yet.

Verified on the local app (real 50-guide render) at desktop + mobile
widths; 112 backend tests still green.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Files changed (3) hide show
  1. dee/static/app.css +54 -1
  2. dee/static/app.js +55 -3
  3. dee/static/index.html +20 -9
dee/static/app.css CHANGED
@@ -260,6 +260,8 @@ kbd {
260
  position: relative;
261
  }
262
  .nav-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-faint); }
 
 
263
  .nav-item:hover { background: var(--bg-hover); color: var(--ink); }
264
  .nav-item:hover .nav-icon { color: var(--ink-soft); }
265
  .nav-item.active {
@@ -535,7 +537,22 @@ footer {
535
 
536
  .card-header.results-header { padding-bottom: 18px; }
537
 
538
- .card-header-left { flex: 1; min-width: 0; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
539
 
540
  .card-kicker {
541
  font-family: var(--font-mono);
@@ -4442,6 +4459,31 @@ h3, h4 {
4442
  /* ─── Phase 3 (M5): structure viewer ──────────────────────────────── */
4443
  .crispr-why-actions { margin-top: 10px; }
4444
  .crispr-struct-btn { font-size: 12.5px; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4445
  /* The Mol* host inside the structure modal needs an explicit height. */
4446
  .crispr-structure-viewer {
4447
  width: 100%;
@@ -4645,6 +4687,17 @@ h3, h4 {
4645
  margin-right: 10px;
4646
  flex-wrap: wrap;
4647
  }
 
 
 
 
 
 
 
 
 
 
 
4648
  .crispr-vendor-label {
4649
  font-family: var(--font-mono);
4650
  font-size: 10px;
 
260
  position: relative;
261
  }
262
  .nav-icon { width: 14px; height: 14px; flex-shrink: 0; color: var(--ink-faint); }
263
+ /* hrefless action nav items (e.g. "My designs") still get the link cursor */
264
+ .nav-item[role="button"] { cursor: pointer; }
265
  .nav-item:hover { background: var(--bg-hover); color: var(--ink); }
266
  .nav-item:hover .nav-icon { color: var(--ink-soft); }
267
  .nav-item.active {
 
537
 
538
  .card-header.results-header { padding-bottom: 18px; }
539
 
540
+ .card-header-left { flex: 1 1 0; min-width: 0; }
541
+
542
+ /* Results-header action cluster (Save / My designs / Download / Export).
543
+ * Without an explicit desktop rule this was an unstyled flex *item* with no
544
+ * internal layout, so its children claimed their full preferred width and
545
+ * shrank .card-header-left down to min-content — wrapping the sub-line one
546
+ * word per line. flex-shrink:0 keeps the buttons as a tidy right-aligned
547
+ * group that never steals width from the title. */
548
+ .results-actions {
549
+ display: flex;
550
+ align-items: center;
551
+ justify-content: flex-end;
552
+ gap: 8px;
553
+ flex-wrap: wrap;
554
+ flex-shrink: 0;
555
+ }
556
 
557
  .card-kicker {
558
  font-family: var(--font-mono);
 
4459
  /* ─── Phase 3 (M5): structure viewer ──────────────────────────────── */
4460
  .crispr-why-actions { margin-top: 10px; }
4461
  .crispr-struct-btn { font-size: 12.5px; }
4462
+ .crispr-struct-hint { font-size: 12px; font-style: italic; color: var(--ink-faint); }
4463
+
4464
+ /* Rank cell: stack the why-toggle and the visible "⌖ 3-D" structure
4465
+ * button vertically so the viewer is reachable without expanding the
4466
+ * why-panel (M5 discoverability fix, 2026-05-30). */
4467
+ .crispr-rank-cell { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
4468
+ .crispr-struct-mini {
4469
+ display: inline-flex; align-items: center; gap: 3px;
4470
+ padding: 2px 7px;
4471
+ font-family: var(--font-mono);
4472
+ font-size: 10px; letter-spacing: 0.04em; font-weight: 600;
4473
+ line-height: 1.4;
4474
+ color: var(--brand);
4475
+ background: var(--brand-50, var(--bg-card));
4476
+ border: 1px solid var(--brand-100, var(--line));
4477
+ border-radius: var(--r-2);
4478
+ cursor: pointer;
4479
+ white-space: nowrap;
4480
+ transition: all var(--t-fast) var(--ease);
4481
+ }
4482
+ .crispr-struct-mini:hover {
4483
+ color: #FFFFFF;
4484
+ background: linear-gradient(180deg, var(--brand) 0%, var(--brand-deep) 100%);
4485
+ border-color: var(--brand-deep);
4486
+ }
4487
  /* The Mol* host inside the structure modal needs an explicit height. */
4488
  .crispr-structure-viewer {
4489
  width: 100%;
 
4687
  margin-right: 10px;
4688
  flex-wrap: wrap;
4689
  }
4690
+ /* Full-width bulk-order strip (relocated out of the results header
4691
+ * 2026-05-30). Sits between the header and the cloning-vector picker. */
4692
+ .crispr-vendor-strip {
4693
+ display: flex;
4694
+ width: 100%;
4695
+ margin: 0 0 14px;
4696
+ padding: 10px 14px;
4697
+ background: var(--gray-1, rgba(30, 58, 138, 0.04));
4698
+ border: 1px solid var(--line);
4699
+ border-radius: var(--r-3);
4700
+ }
4701
  .crispr-vendor-label {
4702
  font-family: var(--font-mono);
4703
  font-size: 10px;
dee/static/app.js CHANGED
@@ -220,6 +220,29 @@ function showRoute(name) {
220
  window.addEventListener('hashchange', () => showRoute(currentRoute()));
221
  showRoute(currentRoute());
222
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  // ====================================================== LIBRARY + HISTORY
224
  // Removed 2026-05-27 along with the /api/library endpoints they called
225
  // (audit C2). Per-user saved libraries now live on the landing site's
@@ -4264,13 +4287,25 @@ if (_quitBtn) {
4264
  p.push('<em>Run your top guides through CRISPOR for whole-genome off-target before ordering.</em>');
4265
  // Phase 3 (M5): structure-view button when the cut maps to a residue
4266
  // AND a human/mouse gene symbol is set (needed to resolve UniProt).
 
 
 
4267
  let structBtn = '';
4268
  const geneEl = document.getElementById('crisprGeneSymbol');
4269
  const orgEl = document.getElementById('crisprOrganism');
4270
  const gene = geneEl ? geneEl.value.trim() : '';
4271
  const org = orgEl ? orgEl.value : '';
4272
- if (g.cut_residue && gene && (org === 'human' || org === 'mouse')) {
4273
- structBtn = `<div class="crispr-why-actions"><button type="button" class="ghost crispr-struct-btn" data-struct-residue="${g.cut_residue}">View 3-D structure · cut at residue ${g.cut_residue}</button></div>`;
 
 
 
 
 
 
 
 
 
4274
  }
4275
  return '<div class="crispr-why">' + p.join(' ') + structBtn + '</div>';
4276
  }
@@ -4609,6 +4644,16 @@ if (_quitBtn) {
4609
  _updateCrisprFilterCount(working.length, (data.guides || []).length);
4610
  _updateCrisprSortIndicators();
4611
 
 
 
 
 
 
 
 
 
 
 
4612
  const rows = working.map((g) => {
4613
  const flags = [];
4614
  if (g.flag_high_gc) flags.push('high&nbsp;GC');
@@ -4766,9 +4811,16 @@ if (_quitBtn) {
4766
  </div>`
4767
  : '<span class="muted">—</span>';
4768
 
 
 
 
 
 
 
 
4769
  return `
4770
  <tr class="crispr-row" data-rank="${g.rank}">
4771
- <td class="rank"><button type="button" class="crispr-why-toggle" data-why="${g.rank}" aria-expanded="false" title="Why this guide?">${g.rank}<span class="crispr-why-caret" aria-hidden="true">›</span></button></td>
4772
  <td>${g.strand === '+' ? 'sense' : 'antisense'}</td>
4773
  <td class="num">${g.position.toLocaleString()}</td>
4774
  <td class="crispr-spacer">
 
220
  window.addEventListener('hashchange', () => showRoute(currentRoute()));
221
  showRoute(currentRoute());
222
 
223
+ // "My designs" sidebar nav item (2026-05-30). Opens the saved-designs
224
+ // modal from anywhere — no need to run a design first. Switches to the
225
+ // CRISPR route, then triggers the existing #crisprDesignsBtn handler
226
+ // (which fetches the list and routes anonymous users to the sign-in
227
+ // modal). The button lives in the hidden results card, but a programmatic
228
+ // .click() fires its listener regardless of visibility.
229
+ (function initMyDesignsNav() {
230
+ const navMyDesigns = document.getElementById('navMyDesigns');
231
+ if (!navMyDesigns) return;
232
+ function open() {
233
+ showRoute('crispr');
234
+ if (location.hash !== '#crispr') {
235
+ try { history.replaceState(null, '', '#crispr'); } catch (_) { location.hash = 'crispr'; }
236
+ }
237
+ const btn = document.getElementById('crisprDesignsBtn');
238
+ if (btn) btn.click();
239
+ }
240
+ navMyDesigns.addEventListener('click', open);
241
+ navMyDesigns.addEventListener('keydown', (e) => {
242
+ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); open(); }
243
+ });
244
+ })();
245
+
246
  // ====================================================== LIBRARY + HISTORY
247
  // Removed 2026-05-27 along with the /api/library endpoints they called
248
  // (audit C2). Per-user saved libraries now live on the landing site's
 
4287
  p.push('<em>Run your top guides through CRISPOR for whole-genome off-target before ordering.</em>');
4288
  // Phase 3 (M5): structure-view button when the cut maps to a residue
4289
  // AND a human/mouse gene symbol is set (needed to resolve UniProt).
4290
+ // When the context is missing, show a hint telling the user exactly
4291
+ // what to add to unlock the 3-D view — so the feature is discoverable
4292
+ // even on a raw-sequence run where it can't render yet.
4293
  let structBtn = '';
4294
  const geneEl = document.getElementById('crisprGeneSymbol');
4295
  const orgEl = document.getElementById('crisprOrganism');
4296
  const gene = geneEl ? geneEl.value.trim() : '';
4297
  const org = orgEl ? orgEl.value : '';
4298
+ const orgOk = (org === 'human' || org === 'mouse');
4299
+ if (!isBE) {
4300
+ if (g.cut_residue && gene && orgOk) {
4301
+ structBtn = `<div class="crispr-why-actions"><button type="button" class="ghost crispr-struct-btn" data-struct-residue="${g.cut_residue}">View 3-D structure · cut at residue ${g.cut_residue}</button></div>`;
4302
+ } else {
4303
+ const need = (!gene && !orgOk) ? 'a human or mouse gene symbol and organism'
4304
+ : !gene ? 'a gene symbol'
4305
+ : !orgOk ? 'a human or mouse organism'
4306
+ : 'a sequence that aligns to the gene&rsquo;s coding region';
4307
+ structBtn = `<div class="crispr-why-actions"><span class="crispr-struct-hint">Add ${need} above, then re-run, to map this cut onto the 3-D AlphaFold structure.</span></div>`;
4308
+ }
4309
  }
4310
  return '<div class="crispr-why">' + p.join(' ') + structBtn + '</div>';
4311
  }
 
4644
  _updateCrisprFilterCount(working.length, (data.guides || []).length);
4645
  _updateCrisprSortIndicators();
4646
 
4647
+ // Phase 3 (M5) discoverability: is the 3-D structure view reachable
4648
+ // for this run? It needs a human/mouse gene symbol (to resolve the
4649
+ // UniProt accession → AlphaFold model) AND a cut→residue mapping.
4650
+ // Computed once here so each row can show a visible "⌖ 3-D" button
4651
+ // instead of burying it inside the expandable why-panel.
4652
+ const _sGeneEl = document.getElementById('crisprGeneSymbol');
4653
+ const _sOrgEl = document.getElementById('crisprOrganism');
4654
+ const _structOrgOk = _sOrgEl ? (_sOrgEl.value === 'human' || _sOrgEl.value === 'mouse') : false;
4655
+ const _structCtxOk = !!((_sGeneEl ? _sGeneEl.value.trim() : '') && _structOrgOk && !isBaseEdit);
4656
+
4657
  const rows = working.map((g) => {
4658
  const flags = [];
4659
  if (g.flag_high_gc) flags.push('high&nbsp;GC');
 
4811
  </div>`
4812
  : '<span class="muted">—</span>';
4813
 
4814
+ // Visible 3-D structure button (M5) — shown right in the row when
4815
+ // the cut maps to a residue and a human/mouse gene is set, so the
4816
+ // viewer is one click away without expanding the why-panel.
4817
+ const structMini = (_structCtxOk && g.cut_residue)
4818
+ ? `<button type="button" class="crispr-struct-btn crispr-struct-mini" data-struct-residue="${g.cut_residue}" title="View this cut site on the 3-D AlphaFold structure (residue ${g.cut_residue})" aria-label="View 3-D structure, residue ${g.cut_residue}">⌖ 3-D</button>`
4819
+ : '';
4820
+
4821
  return `
4822
  <tr class="crispr-row" data-rank="${g.rank}">
4823
+ <td class="rank"><div class="crispr-rank-cell"><button type="button" class="crispr-why-toggle" data-why="${g.rank}" aria-expanded="false" title="Why this guide?">${g.rank}<span class="crispr-why-caret" aria-hidden="true">›</span></button>${structMini}</div></td>
4824
  <td>${g.strand === '+' ? 'sense' : 'antisense'}</td>
4825
  <td class="num">${g.position.toLocaleString()}</td>
4826
  <td class="crispr-spacer">
dee/static/index.html CHANGED
@@ -7,7 +7,7 @@
7
  <!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
8
  app.js change. Bump these numbers whenever you ship a frontend update —
9
  without them, users keep getting the stale file for up to a week. -->
10
- <link rel="stylesheet" href="/static/app.css?v=20260529-save-revisit" />
11
  <link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
12
  <link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
13
  <!-- Mol* (PDBe) viewer for AlphaFold structure embed. Loaded async; the
@@ -53,6 +53,14 @@
53
  30-test suite passed clean.
54
  -->
55
  <a class="nav-item" href="#crispr">CRISPR</a>
 
 
 
 
 
 
 
 
56
  <!--
57
  Library + History tabs removed 2026-05-27. They called
58
  /api/library which read the Space-shared ~/.dee/output/
@@ -649,11 +657,6 @@
649
  <p class="card-sub" id="crisprResultsSub">—</p>
650
  </div>
651
  <div class="results-actions">
652
- <!-- Phase 2C-1: vendor buttons. Click → copy all
653
- oligo pairs as TSV to clipboard + open vendor
654
- site so the user can paste into the order form.
655
- Vendor list comes from /api/crispr/vectors. -->
656
- <div class="crispr-vendor-row" id="crisprVendorRow" hidden></div>
657
  <!-- Phase 3 (M4): save the current guide set to the
658
  signed-in user's library (90-day retention) and
659
  reopen past designs. -->
@@ -663,6 +666,14 @@
663
  </div>
664
  </header>
665
 
 
 
 
 
 
 
 
 
666
  <!-- Phase 2C-1: vector picker. Above the table but inside
667
  the results card so the picker contextualizes the
668
  oligo columns. Picking a vector re-renders the
@@ -1122,10 +1133,10 @@
1122
  Authorization header on every same-origin /api/* call. Without
1123
  this, signed-in users would still hit the anonymous-quota
1124
  gate. -->
1125
- <script src="/static/auth.js?v=20260529-save-revisit"></script>
1126
  <!-- Cloning reference data must load before app.js so the Designer
1127
  can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
1128
- <script src="/static/cloning_db.js?v=20260529-save-revisit" defer></script>
1129
- <script src="/static/app.js?v=20260529-save-revisit" defer></script>
1130
  </body>
1131
  </html>
 
7
  <!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
8
  app.js change. Bump these numbers whenever you ship a frontend update —
9
  without them, users keep getting the stale file for up to a week. -->
10
+ <link rel="stylesheet" href="/static/app.css?v=20260530-ui-polish" />
11
  <link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
12
  <link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
13
  <!-- Mol* (PDBe) viewer for AlphaFold structure embed. Loaded async; the
 
53
  30-test suite passed clean.
54
  -->
55
  <a class="nav-item" href="#crispr">CRISPR</a>
56
+ <!--
57
+ My designs — opens the saved-designs modal directly from
58
+ the nav (2026-05-30), so signed-in users can reopen a past
59
+ guide set without first running a new design. Sign-in
60
+ gated by the same /api/crispr/designs guard; an anonymous
61
+ click routes to the sign-in modal.
62
+ -->
63
+ <a class="nav-item" id="navMyDesigns" role="button" tabindex="0">My designs</a>
64
  <!--
65
  Library + History tabs removed 2026-05-27. They called
66
  /api/library which read the Space-shared ~/.dee/output/
 
657
  <p class="card-sub" id="crisprResultsSub">—</p>
658
  </div>
659
  <div class="results-actions">
 
 
 
 
 
660
  <!-- Phase 3 (M4): save the current guide set to the
661
  signed-in user's library (90-day retention) and
662
  reopen past designs. -->
 
666
  </div>
667
  </header>
668
 
669
+ <!-- Phase 2C-1: bulk-order strip. Click a vendor → copy all
670
+ oligo pairs as TSV to clipboard + open vendor site so the
671
+ user can paste into the order form. Vendor list comes from
672
+ /api/crispr/vectors. Moved OUT of the header (2026-05-30)
673
+ so it no longer squeezed the title into a one-word-per-line
674
+ column — now a full-width strip above the cloning picker. -->
675
+ <div class="crispr-vendor-row crispr-vendor-strip" id="crisprVendorRow" hidden></div>
676
+
677
  <!-- Phase 2C-1: vector picker. Above the table but inside
678
  the results card so the picker contextualizes the
679
  oligo columns. Picking a vector re-renders the
 
1133
  Authorization header on every same-origin /api/* call. Without
1134
  this, signed-in users would still hit the anonymous-quota
1135
  gate. -->
1136
+ <script src="/static/auth.js?v=20260530-ui-polish"></script>
1137
  <!-- Cloning reference data must load before app.js so the Designer
1138
  can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
1139
+ <script src="/static/cloning_db.js?v=20260530-ui-polish" defer></script>
1140
+ <script src="/static/app.js?v=20260530-ui-polish" defer></script>
1141
  </body>
1142
  </html>