@@ -162,15 +162,6 @@ export function threadLinkRefs(
162162 return [ ...refs . values ( ) ] ;
163163}
164164
165- export function unknownThreadLinkLabel (
166- link : ThreadLink ,
167- messageEnvironmentId : EnvironmentId ,
168- ) : string {
169- return link . environmentId === null || link . environmentId === messageEnvironmentId
170- ? "Thread no longer available"
171- : "Thread on another machine" ;
172- }
173-
174165/** Rewrites each link outside code `replace` answers for. `label` is a Markdown link's own text. */
175166export function replaceThreadLinks (
176167 markdown : string ,
@@ -185,11 +176,7 @@ export function replaceThreadLinks(
185176 } ) ;
186177}
187178
188- /**
189- * Writes each link with its thread's current title, a hosted link as a v2 link. A link `title`
190- * cannot resolve becomes plain text, its written label or a neutral one, except a labeled v1
191- * link, which may open elsewhere.
192- */
179+ /** Shells can omit threads, so unknown titles keep their destinations and use a neutral label. */
193180export function relabelThreadLinks (
194181 markdown : string ,
195182 messageEnvironmentId : EnvironmentId ,
@@ -205,13 +192,9 @@ export function relabelThreadLinks(
205192 ? decoded
206193 : written . threadId ;
207194 const current = title ( { environmentId, threadId } ) ;
208- if ( current === undefined ) {
209- if ( label !== undefined && written . environmentId === null ) return undefined ;
210- return label ?. trim ( ) || unknownThreadLinkLabel ( written , messageEnvironmentId ) ;
211- }
212195 return formatThreadLink (
213196 { environmentId : written . environmentId , threadId } ,
214- current . trim ( ) || label || threadId ,
197+ current ? .trim ( ) || label ?. trim ( ) || "Thread" ,
215198 ) ;
216199 } ) ;
217200}
0 commit comments