components/ui and the pages now use only the style.css scale: text-[0.8rem]→text-label, text-[0.625rem]→text-micro, text-base/text-sm→ text-label (rows and controls), text-xs→text-caption (captions and secondary text), text-lg/text-xl/text-2xl→text-title (panel and page titles). Rendered markdown (ChatMarkdown/ChatInline/markdown.ts) keeps Tailwind steps as the issue allows. 196 files, class-token swaps only.
32 lines
1.2 KiB
Vue
32 lines
1.2 KiB
Vue
<script setup lang="ts">
|
|
import { Paperclip } from "@lucide/vue";
|
|
|
|
import { mediaDetail, mediaLabel } from "./attachment";
|
|
import type { ChatMedia } from "./state";
|
|
|
|
/**
|
|
* One attachment a message carried, as the transcript shows it.
|
|
*
|
|
* The bytes are gone by design: they are turn-scoped and stripped before the
|
|
* record is stored, so this is a labelled chip rather than a preview. It
|
|
* links out only when the attachment itself carried a URL; a platform file id
|
|
* is deliberately never rendered, because it is a handle rather than an
|
|
* address and a chip that 404s is worse than no chip.
|
|
*/
|
|
defineProps<{ attachment: ChatMedia }>();
|
|
</script>
|
|
|
|
<template>
|
|
<component
|
|
:is="attachment.url ? 'a' : 'span'"
|
|
:href="attachment.url"
|
|
:target="attachment.url ? '_blank' : undefined"
|
|
:rel="attachment.url ? 'noopener noreferrer' : undefined"
|
|
:title="mediaDetail(attachment)"
|
|
class="inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-muted px-2.5 py-1 text-caption font-medium text-fg-muted"
|
|
>
|
|
<Paperclip aria-hidden="true" class="size-3.5 shrink-0" />
|
|
<span class="truncate">{{ mediaLabel(attachment) }}</span>
|
|
</component>
|
|
</template>
|