Tengo Gzirishvili Claude Opus 4.8 commited on
Commit
dbb031b
·
1 Parent(s): caa515e

Alignment: highlight non-matching residues in red

Browse files

In the pairwise alignment card, every column the server's midline doesn't mark
"|" — i.e. mismatches AND gaps — now renders its residue in red (bold, faint
red tint) in both strands, so divergence is scannable at a glance. Matching
residues stay in the normal ink.

- app.js: colorRow() wraps consecutive non-matching runs in <span.align-mm>
using the authoritative per-column midline; render() uses it for both rows.
- app.css: .align-mm = var(--danger) + weight + var(--danger-light) tint, with
no padding/border so the monospace columns stay perfectly aligned (adapts to
light/dark via the danger tokens).
- index.html: bump asset cache-buster.

Verified in preview: red lands on exactly the mismatch + gap columns of both
strands, colour resolves to the danger token, alignment columns unshifted.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Files changed (3) hide show
  1. dee/static/app.css +4 -0
  2. dee/static/app.js +25 -3
  3. dee/static/index.html +3 -3
dee/static/app.css CHANGED
@@ -5737,6 +5737,10 @@ h3, h4 {
5737
  .align-block { margin-bottom: 10px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; white-space: pre; }
5738
  .align-row { white-space: pre; }
5739
  .align-mid { color: var(--ink-faint); }
 
 
 
 
5740
 
5741
  @media (max-width: 640px) {
5742
  .seqtool-input { width: 100%; }
 
5737
  .align-block { margin-bottom: 10px; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.5; white-space: pre; }
5738
  .align-row { white-space: pre; }
5739
  .align-mid { color: var(--ink-faint); }
5740
+ /* Non-matching residues (mismatches + gaps) in red so divergence is scannable
5741
+ * at a glance. Colour + weight + a faint tint only — no padding/border — so the
5742
+ * monospace columns stay perfectly aligned. */
5743
+ .align-mm { color: var(--danger); font-weight: 700; background: var(--danger-light); border-radius: 2px; }
5744
 
5745
  @media (max-width: 640px) {
5746
  .seqtool-input { width: 100%; }
dee/static/app.js CHANGED
@@ -8043,15 +8043,37 @@ function runOracle(opts){
8043
  b.classList.toggle('clone-method-active', b === btn));
8044
  });
8045
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8046
  function render(r) {
8047
  const W = 60, aa = r.aligned_a || '', bb = r.aligned_b || '', mid = r.midline || '';
8048
  let html = '';
8049
  for (let i = 0; i < aa.length; i += W) {
8050
  const n = Math.min(i + W, aa.length);
 
8051
  html += `<div class="align-block">`
8052
- + `<div class="align-row">${i + 1} ${escapeHtml(aa.slice(i, n))}</div>`
8053
- + `<div class="align-row align-mid">${' '.repeat(String(i + 1).length + 1)}${escapeHtml(mid.slice(i, n))}</div>`
8054
- + `<div class="align-row">${i + 1} ${escapeHtml(bb.slice(i, n))}</div></div>`;
8055
  }
8056
  out.innerHTML = html;
8057
  out.hidden = false;
 
8043
  b.classList.toggle('clone-method-active', b === btn));
8044
  });
8045
  });
8046
+ // Wrap every non-matching residue (mismatch or gap — any column the
8047
+ // server's midline doesn't mark "|") in a red span, grouping consecutive
8048
+ // runs so a stretch of divergence reads as one highlight. Matching runs
8049
+ // stay plain. Per-column status comes from the authoritative midline.
8050
+ function colorRow(seqSlice, midSlice) {
8051
+ let html = '', run = '', runMismatch = false;
8052
+ const flush = () => {
8053
+ if (!run) return;
8054
+ html += runMismatch
8055
+ ? `<span class="align-mm">${escapeHtml(run)}</span>`
8056
+ : escapeHtml(run);
8057
+ run = '';
8058
+ };
8059
+ for (let k = 0; k < seqSlice.length; k++) {
8060
+ const mismatch = midSlice[k] !== '|';
8061
+ if (mismatch !== runMismatch) { flush(); runMismatch = mismatch; }
8062
+ run += seqSlice[k];
8063
+ }
8064
+ flush();
8065
+ return html;
8066
+ }
8067
  function render(r) {
8068
  const W = 60, aa = r.aligned_a || '', bb = r.aligned_b || '', mid = r.midline || '';
8069
  let html = '';
8070
  for (let i = 0; i < aa.length; i += W) {
8071
  const n = Math.min(i + W, aa.length);
8072
+ const pos = String(i + 1), mSlice = mid.slice(i, n);
8073
  html += `<div class="align-block">`
8074
+ + `<div class="align-row">${pos} ${colorRow(aa.slice(i, n), mSlice)}</div>`
8075
+ + `<div class="align-row align-mid">${' '.repeat(pos.length + 1)}${escapeHtml(mSlice)}</div>`
8076
+ + `<div class="align-row">${pos} ${colorRow(bb.slice(i, n), mSlice)}</div></div>`;
8077
  }
8078
  out.innerHTML = html;
8079
  out.hidden = false;
dee/static/index.html CHANGED
@@ -28,7 +28,7 @@
28
  <!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
29
  app.js change. Bump these numbers whenever you ship a frontend update —
30
  without them, users keep getting the stale file for up to a week. -->
31
- <link rel="stylesheet" href="/static/app.css?v=20260609-acct" />
32
  <link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
33
  <link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
34
  <!-- Mol* (PDBe) 3-D viewer is ~4.9 MB. We do NOT eager-load it on every
@@ -1859,10 +1859,10 @@
1859
  Authorization header on every same-origin /api/* call. Without
1860
  this, signed-in users would still hit the anonymous-quota
1861
  gate. -->
1862
- <script src="/static/auth.js?v=20260609-acct"></script>
1863
  <!-- Cloning reference data must load before app.js so the Designer
1864
  can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
1865
  <script src="/static/cloning_db.js?v=20260530-ui-polish" defer></script>
1866
- <script src="/static/app.js?v=20260609-acct" defer></script>
1867
  </body>
1868
  </html>
 
28
  <!-- ?v= query bumps invalidate browser + iframe asset caches when app.css /
29
  app.js change. Bump these numbers whenever you ship a frontend update —
30
  without them, users keep getting the stale file for up to a week. -->
31
+ <link rel="stylesheet" href="/static/app.css?v=20260609-mm" />
32
  <link rel="icon" type="image/svg+xml" href="/static/favicon.svg?v=2" />
33
  <link rel="apple-touch-icon" href="/static/favicon.svg?v=2" />
34
  <!-- Mol* (PDBe) 3-D viewer is ~4.9 MB. We do NOT eager-load it on every
 
1859
  Authorization header on every same-origin /api/* call. Without
1860
  this, signed-in users would still hit the anonymous-quota
1861
  gate. -->
1862
+ <script src="/static/auth.js?v=20260609-mm"></script>
1863
  <!-- Cloning reference data must load before app.js so the Designer
1864
  can read VECTORS / ENZYMES / CLONING_METHODS / TAGS / LINKERS. -->
1865
  <script src="/static/cloning_db.js?v=20260530-ui-polish" defer></script>
1866
+ <script src="/static/app.js?v=20260609-mm" defer></script>
1867
  </body>
1868
  </html>