Skip to content

Comments ​

Discussions about a record: a list of threads on the record's page, each opened in a modal to read and reply.

components-comments--listOpen in Storybook ↗

When to use ​

  • Questions and remarks between colleagues about a record, such as a review note or a request to check a value.
  • Pointing a colleague or another record into the conversation with a tag.

When not to use ​

  • Information that belongs to the record: put it in a field, such as a WYSIWYG editor for a longer note.
  • Who changed what: that is in the history diff.

Anatomy ​

  1. Comments panel: an element panel with the configured title and a collapse chevron.

  2. New discussion: a small commit button with a plus icon at the top of the panel. It opens the composer in place.

  3. Composer: a WYSIWYG editor that is open for typing, the client's extra fields (such as a category) under it, then Cancel and a commit Post button.

  4. Discussion card, newest first. The header line holds:

    • the author in bold and the date in a lighter grey;
    • New for a comment you haven't seen yet, when the client tracks this. The card then also gets an accent bar on its left edge;
    • edited in italics, when the comment was changed after posting;
    • on the right: the extra field values, the status chip (Open on the accent colour, Resolved in grey) and the reply count.

    The comment text follows under the header.

  5. Tag: a record named in the text, as an inline chip in --color-accent-light with an accent outline.

Variants ​

VariantWhereWhat changes
List cardin the comments panelstatus and reply count; the whole card opens the discussion; hover gives an accent border
Discussionin the modalthe first comment, then the replies indented, oldest first; your own comments get Edit and Delete
Editingin the modal, on your own commentthe card turns into the composer, with Save and Cancel
components-comments--threadOpen in Storybook ↗

The discussion modal has the title Discussion and, on the right, the status buttons and a close cross. The reply composer sits at the bottom with a commit Reply button.

components-comments--composerOpen in Storybook ↗

Tagging is set up per client: typing the tag's trigger character, such as @, lists matching records, and the toolbar can offer a button per tag type. The picked record is saved as a relation of the comment. A click on a tag opens that record in a modal.

States ​

StateWhat you seeTrigger
LoadingLoading comments...the panel fetches its comments
EmptyNo comments yet in italicsno discussions on the record
Composingcomposer open; Post stays disabled until there is text or a tag, and the extra fields are validNew discussion
OpenOpen chip; replies allowed; a Resolve button in the modala new discussion
Resolvedgrey Resolved chip; no reply composer but This discussion is resolved. Reopen it to reply.; Reopen, and Archive for those who took partResolve
Archivedgone from the panel's list; Reopen when the discussion is openedArchive
Read-onlyno New discussion, no status buttons, no reply composer, no Edit or Deletethe panel is configured read-only

Edit and delete. Only the author sees Edit and Delete on a comment. Edit shows only while the discussion is open. Delete asks for confirmation in a modal. Deleting the first comment deletes the whole discussion, replies of others included, and the modal says so.

Keyboard & accessibility ​

KeyWhereDoes
Tabpanel and modalmoves through New discussion, the composer, Cancel, Post, the status buttons, Edit and Delete
Escapediscussion modalcloses it
↑ / ↓tag suggestionsmoves through the list
Enter / Tabtag suggestionspicks the highlighted record
Escapetag suggestionscloses the list
  • The composer is a WYSIWYG editor; its toolbar and formatting keys apply.
  • Edit and Delete are real buttons. A click on them doesn't open the card's discussion.
  • A click on a tag opens the record instead of the discussion.
  • Opening a discussion card and opening a tag work by mouse only for now.

Content ​

  • Keep comments about the record; anything that has to stay with the record belongs in a field.
  • Resolve a discussion when the question is answered; archive it to take it out of the list.
  • Translation keys: comments.new-thread, comments.post, comments.reply, comments.save, comments.cancel, comments.edit, comments.edited, comments.delete, comments.resolve, comments.archive, comments.reopen, comments.thread-title, comments.empty, comments.loading, comments.unknown-author, comments.new, comments.reply-count, comments.status.*, comments.resolved-hint, comments.archived-hint, confirm.delete-comment.*.

WYSIWYG editor · Modal · Panel & block shells · Button · History diff

Powered by Elody - Open Source Semantic Data Platform