Document notes side by side — Activity block
Proactivity-document-notes-side-by-side · for record, app pages
Document notes side by side
A document excerpt and numbered anchors beside its discussion: comments pinned to passages of the merchant’s own text
Documentation
Installation
One command copies the block into your project with the shadcn CLI (the registry is set once: Installation).
pnpm dlx shadcn-vue@latest add @trame/activity-document-notes-side-by-sideUsage
Its demo data, shortened (Using blocks).
<script setup lang="ts">
import ActivityDocumentNotesSideBySide from '@/components/trame/blocks/activity/activity-document-notes-side-by-side.vue'
const props = {
title: "Conversation",
messages: [
{
id: 1,
author: {
name: "System"
},
side: "team",
kind: "system",
at: "Oct 7",
body: "Opened from the contact form · Oct 7"
},
{
id: 2,
author: {
name: "Louis Martin"
},
side: "customer",
at: "Oct 7, 4:40 p.m.",
anchor: "Delivery is expected by October 6 at the latest.",
body: "Hello, my order 2041 was supposed to arrive yesterday and I still haven’t received anything. Could you look into it?"
}
],
viewer: {
name: "Nadia Benali"
},
reply: "reply",
note: "note",
options: {
canNote: true,
shortcutHint: "Ctrl + Enter to send",
documentTitle: "Order tracking",
excerpt: "Your order has been handed to the carrier. Delivery is expected by October 6 at the latest. If it runs late, our team will help you out.",
resolve: "resolve",
assign: "assign"
}
}
</script>
<template>
<ActivityDocumentNotesSideBySide v-bind="props" />
</template>Props
Each prop says who changes it: Words, Picture, Action, Design, Data.* required.
| Prop | Type | Description |
|---|---|---|
| title* | string | Wordsthe conversation’s heading ("Exchanges") |
| messages* | Message[] | Datathe messages, oldest first |
| viewer | Viewer | Datathe person looking at the thread, for the composer |
| reply* | string | Actionthe page action that sends a reply |
| note | string | Actionthe page action that saves an internal note |
| options | Options | the block’s settings: layout choices and secondary words, read by every variant |
Message messages[] · 11 props
| Prop | Type | Description |
|---|---|---|
| id* | string | number | the message’s id |
| author* | Author | who wrote it |
| side* | 'customer' | 'team' | who wrote it: the person the thread is about, or the team |
| kind | 'message' | 'note' | 'system' | note: internal, never seen by the customer; system: a line of the record’s history |
| at* | string | Wordswhen, as the app writes it ("9 Oct., 14:32"): never computed here |
| body | string | Wordsthe text; absent shows a placeholder |
| ai | boolean | written by an assistant: labelled as such |
| attachments | Attachment[] | files attached to the note |
| anchor | string | Wordsflat: the passage this comment is about |
| resolved | boolean | true: the thread is resolved |
| outdated | boolean | the passage changed since this comment |
Author messages[].author · 3 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe person’s name |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
| role | string | Wordstheir role or job title |
Attachment messages[].attachments[] · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe file’s name |
| size | string | Wordsits size, as the app writes it |
Viewer viewer · 2 props
| Prop | Type | Description |
|---|---|---|
| name* | string | Wordsthe person’s name |
| avatar | string | Picturea picture: a root-relative path (/media/…) or an absolute URL |
Options options · 9 props
| Prop | Type | Description |
|---|---|---|
| documentTitle | string | Wordsannotations: the document being discussed |
| excerpt | string | Wordsannotations: the actual passage under review |
| canNote | boolean | this viewer may leave internal notes |
| shortcutHint | string | Wordshow to send from the keyboard ("Ctrl + Enter to send") |
| resolve | string | Actionflat: marks a comment resolved (receives the message id) |
| assign | string | Actionflat: assigns a comment (receives the message id) |
| placeholder | string | Wordsthe composer’s placeholder |
| pageSize | number | messages shown before "Older messages" |
| mood | 'inverse' | 'brand' | 'warm' | 'tint' | string | a band of the page that redefines the theme surfaces inside it |
What it asks your app for
The block never knows your app: it asks it, through one context provided once, where its links lead, what its actions do, how a price reads and which words to say (The host context).
| Member | What it is for |
|---|---|
| href | the address an action leads to, or null to hide what leads there |
| act | runs a change (subscribe, add to cart, save) and answers { ok } or { ok: false, error } |
| can | whether the page has this action |
| asset | a picture’s address as your app serves it |
| Link | your router’s link component |
| cartCount | the cart badge’s number |
| cartDrawer | whether your app has a cart drawer |
| cartOpen | whether the cart drawer is open |
| label | your word for an interface key, or undefined to keep the block’s own |
The words it says itself, in English and French; label(key) replaces any of them:
| Key | English | French |
|---|---|---|
| newsletter.already | You are already subscribed. | Vous êtes déjà inscrit. |
| newsletter.done | Done: you are subscribed. | C’est noté : vous êtes inscrit. |
| newsletter.invalid | Check the email address. | Vérifiez l’adresse e-mail. |
| newsletter.tooMany | Too many attempts, try again in a moment. | Trop de tentatives, réessayez dans un moment. |
Features
- Every word in the server HTML
- Same markup in Vue and React
- Theme tokens only: every theme, light and dark
- Shows what you give it, invents nothing
- No motion; still under reduced motion
- Real buttons and links, a visible focus
- Asks your app through actions:
reply,note,options.resolve,options.assign - Reads
messagesfrom your app
A activity section, for record, app pages; it uses @lucide/vue, @vueuse/core, class-variance-authority, clsx, reka-ui, tailwind-merge.
Built with
The components this block is made of; each one installs on its own too.
More activity blocks
- Event briefing sidebar: A category-by-category briefing with a summary rail, using only the app’s own recorded events.
- Feed grouped: a workspace-wide feed with many events: rows under day headings, avatar beside the sentence.
- Feed rail: a record’s history on its page: a hairline with an icon per event, the sentence and its time.
- Feed steps: stages with a state (done, running, upcoming): a process or an onboarding that moves forward.
- Notification center panel: the popover-sized list beside the bell: grouped Today / Earlier, unread marked, everything marked read.
- Notification digest grouped: a quiet morning: the notifications grouped by the record they concern, each group with its count.
- Notification feed tabbed: the full notifications page: tabs All / Unread / Mentions, extra filter chips, room for long sentences.
- Read archive split: Unread work beside the read archive, for scanning attention and context together without hiding either.