SurfSense/surfsense_web/components/tool-ui
guangyang1206 f096548a16 fix(web): extract single tryGetHostname helper (DRY, unified fallback)
Fixes #1368

Previously,  was duplicated in 4 places with 3 subtly different fallback behaviors:
1. inline-citation.tsx: returned  on error
2. markdown-text.tsx: returned  on error
3. assistant-message.tsx: returned  on error
4. citation.tsx: returned  on error

Created canonical  in  that:
- Returns
- Strips  prefix from hostname
- Returns  on invalid URL (safest contract)

Updated all 4 call sites:
- inline-citation.tsx:  (preserves original fallback)
- markdown-text.tsx:  (preserves original fallback)
- assistant-message.tsx:  (drop-in, both return )
- citation.tsx:  (drop-in, both return )

Co-authored-by: guangyang1206 <guangyang1206@users.noreply.github.com>
2026-05-16 12:15:16 +08:00
..
citation fix(web): extract single tryGetHostname helper (DRY, unified fallback) 2026-05-16 12:15:16 +08:00
confluence tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
dropbox tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
gmail tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
google-calendar tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
google-drive tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
image perf: optimize next/image sizes with dynamic maxWidth (#1089) 2026-04-14 17:58:45 +09:30
jira tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
linear tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
notion tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
onedrive tool-ui: route HITL imports through chat-messages slice. 2026-05-09 18:31:52 +02:00
plan chore: ran linting 2025-12-29 01:09:21 +05:30
shared chore: linting 2026-03-31 21:42:03 -07:00
video-presentation fix: replace transition-all with specific transition properties for better performance 2026-04-08 05:36:19 +05:30
audio.tsx fix: replace transition-all with specific transition properties for better performance 2026-04-08 05:36:19 +05:30
generate-image.tsx chore: ran linting 2026-03-25 00:27:24 +05:30
generate-podcast.tsx feat: fixed vision/image provider specific errors and fixed podcast/video streaming 2026-05-02 19:18:53 -07:00
generate-report.tsx feat: enhance UI components and functionality across documents and report panels 2026-04-24 22:45:33 +05:30
generate-resume.tsx feat: enhance UI components and functionality across documents and report panels 2026-04-24 22:45:33 +05:30
index.ts refactor: rename and update memory tool components to reflect new update_memory functionality 2026-04-09 00:02:54 +05:30
sandbox-execute.tsx chore: linting 2026-03-27 03:17:05 -07:00
user-memory.tsx chore: ran linting 2026-04-09 18:10:34 +05:30
write-todos.tsx refactor: update dependencies and streamline assistant-ui package usages 2026-03-24 02:22:51 +05:30