Files Comments
Comments
Who may comment (a commenter, an editor, the owner) says something of a file or a folder in its details, under Comments; who may read it reads it. A reply goes under the comment that starts its thread, and a thread is resolved once it is dealt with.
On this page
In the drive
- The tab Comments of the details: each thread, its replies under it, who said what and when, “edited” when changed.
- Reply, Resolve or Reopen a thread; Edit and Delete one’s own. The owner may delete any.
- ⌘Enter or Ctrl+Enter sends what is written; Escape leaves an edit. What another person says comes as it happens, from the events.
- Each comment is in the activity of what it is on (
commented), and goes with it when it is deleted for good.
In a screen of your own
import { useComments } from '@rebofiles/react';
function Remarks({ id }: { id: string }) {
const { comments, add, resolve } = useComments(id);
return (
<ul>
{comments.map((c) => (
<li key={c.id} style={{ marginLeft: c.replyTo ? 16 : 0 }}>
<b>{c.by}</b> {c.text} {!c.replyTo && <button onClick={() => resolve(c.id, !c.resolved)}>{c.resolved ? 'Reopen' : 'Resolve'}</button>}
</li>
))}
<button onClick={() => add('Looks good to me, @bea')}>Approve</button>
</ul>
);
}Telling who is named
Whoever a comment names with an @ (`@bea`, `@ana.lopez`) is in `mentions`: telling them is your application’s, as onShare is.
createDriveHandler({
// …
onComment: async ({ comment, entry, mentions, by }) => {
for (const who of mentions) await mail(who, `${by.id} named you on “${entry.name}”: ${comment.text}`);
},
});For the assistant
list_comments reads them and add_comment says one, or a reply with replyTo, in the name of the one the assistant works for and with their rights: “add a note to the contract that the client signed”. See AI assistants.