Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Merge remote-tracking branch 'upstream/main' into fix/webview-remote-ipc

Manas Raghuwanshi894337a89007
diff --cc apps/screenpipe-app-tauri/components/markdown.tsx
index 1351ea06f,5e7deb27a..d907c7072
--- a/apps/screenpipe-app-tauri/components/markdown.tsx
+++ b/apps/screenpipe-app-tauri/components/markdown.tsx
@@@ -163,6 -184,34 +184,39 @@@ export function createMediaAwareMarkdow
): MarkdownComponents {
const base = components ?? {};
+ // A media name with nothing to play reads the way inline code does here.
+ const mediaNameAsText = (address: string) => {
+ const name = decodeLinkAddress(address);
+ const CustomCode = base.code;
+ return CustomCode ? <CustomCode>{name}</CustomCode> : <code>{name}</code>;
+ };
+
+ // A media link or image with nothing to play keeps its words (an image's
+ // alt text) and shows the address it named, alone if the words are empty or
+ // that address. Nothing in the app opens a relative address, so leaving it
+ // a link would do nothing when clicked.
+ const mediaLinkAsText = (address: string, words: ReactNode) => {
+ const said = textOf(words).trim();
+ return !said || said === decodeLinkAddress(address).trim() ? (
+ mediaNameAsText(address)
+ ) : (
+ <>{words} {mediaNameAsText(address)}</>
+ );
+ };
+
+ const link = (href: string | undefined, children: ReactNode, props = {}) => {
+ const CustomAnchor = base.a;
+ if (CustomAnchor) {
+ return <CustomAnchor href={href} {...props}>{children}</CustomAnchor>;
+ }
- return <a href={href} {...props}>{children}</a>;
++ // A plain web link would load the site inside the app window. The opener
++ // plugin sends `_blank` http(s) clicks to the system browser instead.
++ const webLink = href && /^https?:/i.test(href)
++ ? { target: "_blank", rel: "noopener noreferrer" }
++ : {};
++ return <a href={href} {...props} {...webLink}>{children}</a>;
+ };
+
return {
...base,
a({ href, children, ...props }) {