Skip to content

Commit 15c5cb8

Browse files
mpstatonclaude
andcommitted
fix(org-workbench, lists): entry rows display host+path, not hostname alone
Gates Foundation's blog_index stream rendered as bare "gatesfoundation.org" — but the path IS the stream, and its two "website" identity links rendered identically. AdditiveList's fallback display now shows host + pathname (trailing slash trimmed, www. stripped, capped at 60 chars so tracking-style URLs don't blow up the row); hostname alone only for root URLs. Stream names still take precedence. One component — org links, streams, corpus, and person lists all inherit. Closes #27. Issue: context-v/issues/List-Rows-Show-Hostname-Only-Same-Domain-Entries-Indistinguishable.md Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UvYzx7vDWeafnkAi2nEQeb
1 parent ef02398 commit 15c5cb8

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

apps/org-workbench/src/AdditiveList.svelte

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script lang="ts">
22
// Generic additive list — the org card's repeated organ. Renders shaped
3-
// entries (kind badge · name-or-host · date) with an inline ➕ form that
3+
// entries (kind badge · name-or-host+path · date) with an inline ➕ form that
44
// hands the URL (+ optional kind, + optional name when nameable) to a
55
// caller-supplied add function. Entries are additive: no delete — canonical
66
// writes are append + dedup server-side. When the caller supplies onedit,
@@ -117,9 +117,16 @@
117117
}
118118
}
119119
120-
function host(u: string): string {
120+
// Fallback display: host + path, not hostname alone — the path is what
121+
// tells two entries on one domain apart (a blog_index IS its path). Capped
122+
// so deep tracking-style URLs don't blow up the row.
123+
function display(u: string): string {
121124
try {
122-
return new URL(u).hostname.replace(/^www\./, '');
125+
const parsed = new URL(u);
126+
const host = parsed.hostname.replace(/^www\./, '');
127+
const path = parsed.pathname.replace(/\/$/, '');
128+
const full = path ? host + path : host;
129+
return full.length > 60 ? `${full.slice(0, 57)}…` : full;
123130
} catch {
124131
return u;
125132
}
@@ -220,7 +227,7 @@
220227
{:else}
221228
<span class="ow-kind">{e.kind}</span>
222229
{/if}
223-
<a class="ow-url" href={e.url} target="_blank" rel="noreferrer">{e.name ?? host(e.url)}</a>
230+
<a class="ow-url" href={e.url} target="_blank" rel="noreferrer">{e.name ?? display(e.url)}</a>
224231
{#if onedit}
225232
<button
226233
type="button"

0 commit comments

Comments
 (0)