` is invalid), with the inline skin below. A host's chip (the frontend's
+ * `MentionTag`, both its segments) draws `InlineChip` too, and adds only its own behaviour (link, new-tab segment).
+ */
+
+import type React from 'react';
+import Link from '../../embed-shims/next-link';
+import { cn } from '../../utils/cn';
+import { BrowserWindowIcon } from '../icons-v2-generated/coding/browser-window-icon';
+import { Tag } from '../ui/tag';
+
+/**
+ * On top of `Tag`'s badge skin, for a chip in a line of text:
+ * - `align-middle`: centred on the text line;
+ * - `hover:border-ods-border`: no accent border on hover (the badge's default);
+ * - `[&_svg]:size-4` and `[&_svg]:text-ods-text-secondary`: a 16px muted lead icon, the label in the primary colour.
+ */
+const INLINE_CHIP_CLASS =
+ 'max-w-[16rem] align-middle [&_svg]:size-4 [&_svg]:text-ods-text-secondary hover:border-ods-border';
+
+/**
+ * The inline box: an icon and a label in a chat sentence. `className` adds to the skin (a segment's square corner, a
+ * hover fill); `loading` draws `Tag`'s own skeleton in the same box.
+ */
+export function InlineChip({
+ icon,
+ label,
+ className,
+ loading,
+}: {
+ icon?: React.ReactNode;
+ label: React.ReactNode;
+ className?: string;
+ loading?: boolean;
+}): React.ReactElement {
+ return (
+
+ );
+}
+
+/**
+ * A link that stays in this app (the runtime's `computeIsNewTab` keeps it in this window), drawn as an inline box. `anchor` is the host's link element (its
+ * `NavLinkAnchor`, so the click follows the host's routing rule), else the lib's boxed `Link`.
+ */
+export function InlineAppLinkChip({
+ href,
+ children,
+ anchor: Anchor,
+}: {
+ href: string;
+ children: React.ReactNode;
+ anchor?: React.ComponentType<{ href: string; className?: string; children?: React.ReactNode }>;
+}): React.ReactElement {
+ const chip =
} label={children} className="hover:bg-ods-bg-hover" />;
+ return Anchor ? (
+
+ {chip}
+
+ ) : (
+
+ {chip}
+
+ );
+}
diff --git a/openframe-frontend-core/src/components/chat/source-action-button.tsx b/openframe-frontend-core/src/components/chat/source-action-button.tsx
index cfa065ef2a..158044d345 100644
--- a/openframe-frontend-core/src/components/chat/source-action-button.tsx
+++ b/openframe-frontend-core/src/components/chat/source-action-button.tsx
@@ -20,7 +20,10 @@
import { MessageSquare, FileText } from 'lucide-react';
import type React from 'react';
+import { cn } from '../../utils/cn';
import { Button } from '../ui/button';
+import { TextHold } from '../ui/layout-hold';
+import { SKELETON_SURFACE_CLASS } from '../ui/skeleton-surface';
import type { ChatRef } from './chat-ref.types';
export type SourceActionDensity = 'inline' | 'card' | 'list-row';
@@ -41,8 +44,14 @@ export interface SourceActionButtonProps {
* the icon only — the label is used for aria-label / title even when
* it doesn't render visibly. */
label?: string;
+ /** Draw the action's loading form: the same box, its icon and label as skeleton bars. */
+ loading?: boolean;
}
+/** A chat card's footer action (Ask, Display, Watch video): one look for every action in that row. */
+export const CARD_FOOTER_ACTION_CLASS =
+ '!h-auto !p-0 text-h6 font-normal text-ods-text-secondary opacity-60 hover:bg-transparent hover:opacity-100 hover:text-ods-text-primary';
+
// Per-density styling lives in one map so the three call sites share the
// SAME hover/opacity/transition rules. Adding a fourth density means
// adding one entry here, not touching the render path.
@@ -66,8 +75,7 @@ const DENSITY_STYLES: Record<
size: 'small',
showLabel: true,
iconSize: '!h-3 !w-3',
- className:
- '!h-auto !p-0 text-h6 font-normal text-ods-text-secondary opacity-60 hover:bg-transparent hover:opacity-100 hover:text-ods-text-primary',
+ className: CARD_FOOTER_ACTION_CLASS,
},
'list-row': {
size: 'small',
@@ -78,14 +86,57 @@ const DENSITY_STYLES: Record<
},
};
+/**
+ * A footer action's loading form: the real button, inert and unread, with its icon and label drawn as skeleton
+ * bars, so the box is exactly the loaded action's (same paddings, same line height, same label width).
+ */
+export function FooterActionSkeleton({
+ label,
+ className,
+ showLabel = true,
+ size = 'small',
+}: {
+ label: string;
+ className: string;
+ showLabel?: boolean;
+ size?: 'small' | 'icon';
+}): React.ReactElement {
+ const icon =
;
+ return (
+
+
+
+ );
+}
+
export function SourceActionButton({
chatRef,
onDiscuss,
density = 'inline',
className,
label = 'Ask',
+ loading,
}: SourceActionButtonProps): React.ReactElement | null {
if (!chatRef || !onDiscuss) return null;
+ if (loading) {
+ const s = DENSITY_STYLES[density];
+ return (
+
+ );
+ }
// Label-driven icon. "Display" reads as a verbatim-content action so a
// FileText icon reinforces "show me the body" semantics; the default