- {topic.title}
+
{#if isDailyLog && topic.contextId !== 'daily-log'}
{contextMap.get(topic.contextId) ?? topic.contextId}
{/if}
diff --git a/ka-note/client/src/lib/components/TopicCard.svelte b/ka-note/client/src/lib/components/TopicCard.svelte
index 7ecebcd..ae65de0 100644
--- a/ka-note/client/src/lib/components/TopicCard.svelte
+++ b/ka-note/client/src/lib/components/TopicCard.svelte
@@ -6,6 +6,7 @@
import { today } from '$lib/db/helpers';
import { processedTopicIds, collapsedTopicIds } from '$lib/stores/agenda';
import HistoryItem from './HistoryItem.svelte';
+ import LinkTitle from './LinkTitle.svelte';
import MeetingControls from './MeetingControls.svelte';
import MarkdownEditor from './MarkdownEditor.svelte';
import ConfirmDialog from './ConfirmDialog.svelte';
@@ -149,7 +150,7 @@
autofocus
/>
{:else}
- {topic.title}
+
-
- {#if /^https?:\/\//i.test(title)}
-
{truncateUrlDisplay(title)}
- {:else}
- {title}
- {/if}
-
+
{#if body}
{/if}
diff --git a/ka-note/client/src/lib/utils/urlUtils.ts b/ka-note/client/src/lib/utils/urlUtils.ts
new file mode 100644
index 0000000..9a07bc5
--- /dev/null
+++ b/ka-note/client/src/lib/utils/urlUtils.ts
@@ -0,0 +1,15 @@
+export function isUrl(text: string): boolean {
+ return /^https?:\/\//i.test(text);
+}
+
+export function truncateUrlDisplay(text: string, maxLen = 60): string {
+ if (!isUrl(text)) return text;
+ try {
+ const u = new URL(text);
+ const path = u.pathname !== '/' ? u.pathname : '';
+ const display = u.hostname + path;
+ return display.length > maxLen ? display.slice(0, maxLen - 3) + '…' : display;
+ } catch {
+ return text.length > maxLen ? text.slice(0, maxLen - 3) + '…' : text;
+ }
+}