Repository navigation
Mention teammates and react to post notes, on the web, the API and MCP - #490
Merged
Merged
Conversation
added 30 commits
November 12, 2026 11:21
Notes take @mentions (stored as @[Name](user:id), parsed by PostNoteMentions and its TypeScript mirror) and emoji reactions (post_note_reactions). A mention emails the person; a new note emails the post's participants instead of the whole workspace. Mentionables, reactions and the new emails go through shared actions, with matching API endpoints and MCP tools.
- SingleEmoji takes a flag pair or a keycap only in their real shape and caps the code points, so a pictograph with stacked combining marks gets a 422 instead of overflowing the column. - The mention list is ordered in PHP, the same on both engines, and the mention input is an accessible combobox. - Laravel and front-end helpers where they fit; the mention corpus is a fixture. - Tests for valid emoji, hidden pending requests, notes of another post, removing a reaction you lack, edits through the API and MCP, the approval requester as a participant, and the keyboard and edit flows in the browser.
- Every emoji the picker offers is a valid reaction (SingleEmojiTest reads data/emojis.ts through a Node harness). - The note email shows mentions as names; the mention list on a draft is every member but you, sorted ignoring case and accents; reactions go with their note and their member. - The browser test picks with Tab and cancels an edit with Esc. - The note mails read the plain body once, the reaction request reads its route's method, and the audience docblock is rewrapped.
- The mention list carries each member's time zone and whether they are an admin (isAdminThrough, the owner always counts), on the web, the API and MCP. - It lists the viewer too, so a mention of yourself opens your own card; only the @ picker leaves you out. - PostNoteMention draws the chip and a hover card (also on focus), and loads the people the first time a card opens; someone no longer on the post shows by name only. - Browser test covers an admin with a photo, a member, a former member and your own mention.
Rounded-xl with a shadow and no border in light mode, like the menus and the sidebar channel card; a 40px rounded avatar, the name with the Admin badge on one line and the local time below, like the user menu header.
The card shows the photo, the name and the local time, with no gap between the two lines. is_admin leaves the mention list on the web, the API and MCP, with isAdminThrough and its lang key.
… note author - @ALL (in each reader's language: @todos, @tous, ...) is stored as @[word](everyone) and mentions everyone who sees the post; the @ picker offers it first and the chip and emails show the reader's word. - The note actions take the author instead of reading it off the note, so NotifyPostNoteRecipients needs no type check. - A saved mention carries the person's current name; a mention of someone outside the post becomes plain text. - Editing a note keeps a mention after punctuation and gives each of two same-named people their own mention (round-trip parity test). - A late mention list for another post is dropped, MariaDB gets the binary emoji collation, the card wait uses waitForState, and the stray mark.png leaves the repo.
The everyone option uses the primary-strong pair (the sidebar's New button) at the row's height, readable in light and dark. mark.png is untracked again; it was re-added by a broad git add.
…e cases - The @ list re-reads the query on keyup and focus, so moving the caret closes or reopens it instead of inserting at the wrong place; Esc closes the search even while the people load. - A picked @ana no longer blocks searching @ana Lima, and people removed from the text leave the picked list. - A mention ends at a space or punctuation, not before a CJK character, so @all-hands stays text and @山田さん mentions 山田 (round-trip tests). - Names Str::ascii empties sort by their own text, then id, the same on both engines. - The audience is listed once per note; reaction actions take the post; reused note types live in types/post-note.ts; the keyboard browser test waits for the highlighted option before pressing Enter.
…nd what they return
PostNoteMentions reads people and @ALL with the same single pattern as noteMentions.ts, and the front end checks ids with isUuid(), Laravel's Str::isUuid() mirrored in lib/helpers.ts and covered by HelpersParityTest.
The note input was a textarea that guessed, by matching names, which @name in the text were mentions. It is now a TipTap editor with the Mention extension: a picked person is a node that keeps their id, and the body is written from the document (docToNoteBody) and read back into it (noteBodyToDoc), so the name-matching rules are gone. - The @ list keeps its look (everyone first, Enter, Tab, arrows, Esc) and follows the mouse only once it moves, so a list opening under a still cursor never takes the highlight from the keyboard. - markupName() cleans a name the same way on both sides (brackets to spaces, squished, '?' when nothing is left), so a name like '[]' no longer writes markup nobody can read; a names parity test covers it. - The round-trip parity test now goes through the editor document. - Browser tests read the editor's text through waitForEditorText and wait for what they check instead of asserting right after another wait.
A note body now writes @[user:{id}] and @[everyone], with no name inside,
so the server no longer cleans or rewrites names. The members a note
mentions are kept in post_note_mentions (synced on save) and every note
comes with mentions [{id, name}]: the chip, the hover card, the emails
and API/MCP clients read the current name from there, and a person no
longer there reads as unknown (notes.mention_unknown, 16 locales).
- A mention of someone who cannot see the post is removed on save.
- PostNote::DISPLAY_RELATIONS is what every note is loaded with.
- The parity corpora, MCP descriptions and tests use the new format.
…strict uuid pattern per side - PostNotesPanel: every request goes through Inertia's useHttp (XSRF and headers handled by Inertia), saving a note copies the whole response so new mentions show their names - PostNoteEditor: options carry their id and label, so picking, keys and the list no longer switch on the kind - The mention pattern only matches a uuid, which drops the isUuid checks and the front-end isUuid helper - Reactions dispatch the change event with dispatchIf - Browser tests wait for the editor before typing
… and mention coverage - Create and update store the note and its mentions in one transaction - PostNoteAdded and PostNoteMentioned share PostNoteEmail and only name their template - Mentionable resources describe the @[user:id] markup - The note MCP tools say that outside mentions are dropped, that edits show live and what an id missing from mentions means - PostNoteMention reads the id already lower-cased by the parser - Tests: api and mcp store mentions in lower case, drop outsiders and return names; a mention of a gone user reads as unknown
The note emails name everyone and a gone member with their own mail.post_note_added / mail.post_note_mentioned keys, in all 16 locales, instead of the notes feature file.
…ked note recursively loadNotes(page) branched on page 1; loadLatestNotes replaces the thread and scrolls down, loadOlderNotes prepends the next page and says whether it loaded one, and findNote loads older pages until the linked note shows up. A browser test covers loading older notes and opening an older note from its link.
The publish page sends the open thread as the postNotes scroll prop (BuildPostNotesProps, page name notes_page), and the panel reads it with <InfiniteScroll reverse>: scrolling up loads older notes and a linked note loads pages until it shows. Opening notes reloads only the thread's props, so one thread is open at a time. The web notes JSON index is gone; the API and MCP keep theirs.
… a uuid query through Str::isUuid alone
- components/tiptap/editor.ts holds the plain-text nodes every editor shares; plugins/noteBody.ts stores a mention chip as its markup through Mention's renderText, so the body is editor.getText() and docToNoteBody is gone; plugins/noteKeys.ts sends on Enter and cancels on Esc - The parity harness reads the body back with TipTap's generateText - The editor refreshes aria-expanded and aria-activedescendant when the mention list opens or the highlight moves - The notes panel finds a linked note through function refs - The caret test uses arrows, which move the caret on every platform
waitForCondition (behind every waitFor* helper) returned silently when its 30 seconds ran out, so a test passed whatever the page did. It now asserts the condition was met. What that uncovered: - Ideas board: a card dropped while another move is in flight snapped back to its old column until the first move finished; the queued move now updates the board at once - Tests that waited for something that never happens: a hidden file input, a <br> in a textarea, a label on the second page, a thread reply read as a string, a path the sidebar logo never leaves, a success toast the calendar defers on purpose, two flash toasts sharing one id, types[] instead of types[0], a collapsible reka-ui keeps in the DOM, a stored image the server no longer rechecks, the desktop range buttons at 390px, the composer reopened after it closed, a queue slot its own post holds - The pending reel test for a member who needs approval now uses such a member instead of the workspace owner - The label picker test waits for the new-label dialog to close
- A note change broadcasts the note it touched; an open thread updates
that note alone (new GET posts/{post}/notes/{note} on the web and the
API) instead of reloading the newest page, so older pages, the scroll
and an edit in progress stay
- Sending, editing, reacting and deleting update the thread from the
answer; a refused send or edit says why and keeps the text (an edit
stays open until saved)
- Loading older pages for a linked note settles when the visit finishes
and stops when it fails
- Enter sends while the mention list finds nobody; aria-controls only
points at a rendered list; the edit field has a name
- Pasted mention markup becomes a chip, a copied chip reads @name, and
chips named before the people loaded get their names once they do
- The notes emails and their job are dropped when the note is gone
(DeleteWhenMissingModels) instead of failing
- Ideas board: every drop made while a move is saving is sent, in order,
with its column as the board shows it
- waitForDatabase fails the test when its condition never holds
- Tests for each of the above, the note show route, malformed thread
ids, cascades and edits of mentions outside the audience
- PostNoteMentions::parts splits a note into text, people (with their names) and everyone; the web resource sends it as parts, and the app shows and edits a note from them. The TypeScript parser, its regex and the paste rule are gone: the server is the one place that reads the markup, and the editor writes it back through TipTap's renderText - A note repeated by an older page is replaced or removed everywhere it shows, and an update broadcast never adds a note back (only a created one is added) - Notes page newest first with the id as tiebreaker - Ideas board: a card dropped twice while a move is saving keeps its last drop - A failed delete or reaction says what failed, in all 16 locales - The changelog test compares the stored reaction as the enum it reads - Tests for each, including a note survives an edit unchanged when opened from its parts
…e browser - The publish page's notes thread pages by cursor (ListPostNotes::thread, notes_cursor) with meta.total, so a note added or deleted while the thread is open no longer makes an older page skip or repeat one. AGENTS.md records it as an owner exception; the API and MCP keep page pagination - The Node harness that read notes back through TipTap needed npm packages the backend CI job does not install; a browser test now opens a note with blank lines, people and everyone in the real editor and saves it unchanged
18 tasks
…ugin - parts() splits the body around its mentions with preg_split instead of walking offsets, and toPlainText() is the parts read as text - The note document (parts to TipTap JSON, line breaks as hardBreak nodes) moves into plugins/noteBody.ts, which already writes the body back; lib/noteMentions.ts is gone
InfiniteScroll reverse keeps the reader's place after loading an older page, which scrolled a linked note back out of view right after the panel scrolled to it (found in manual testing). The panel now waits for the page to paint before scrolling, and the browser test checks the note is inside the thread, not only highlighted.
The InputGroup is h-9 unless its control is a textarea; the TipTap editor is a div, so a long note spilled above the box over the thread (found in manual testing). The composer box now grows with the editor, and the browser test checks the box, not only the editor.
TipTap's Mention turns a chip back into its @ on Backspace by default, leaving a stray @ (found in manual testing). deleteTriggerWithBackspace removes the chip and its @ together, as the test plan expects.
…rypost into post-note-mentions-reactions
The edit scrolled into view before TipTap mounted its content, so the editor grew afterwards and pushed Cancel and Save below the thread on the last note. Wait for the paint first, through afterPaint now shared in lib/utils.
Once a note lands, the composer drops the text that was sent and keeps what was typed after it, instead of keeping both; a field changed inside the sent text stays as it is. The grow-and-edit browser test now waits for the composer text before sending, so a slow CI runner cannot send a partial note.
A link to a deleted note, or to a note of another post, made the thread load every older page looking for it.
An @unknown mention opened the card with whatever the page still knew about that id, such as the name of a member deleted after the page loaded. It is now a plain chip with no card and no focus stop.
Moving a card or a stage handled validation and HTTP errors but not a network error, so offline the board kept the move with no error toast while the server never stored it.
Playwright's fill writes the DOM and TipTap reads it a moment later; on a slow CI runner a Shift+Enter or Enter pressed right away redrew the field without the filled text.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notes on posts were plain text: no way to call a teammate in, and every new note emailed the whole workspace. This brings mentions,
@alland reactions to notes, on the web, the API and MCP, all through the same actions. It also loads the thread through Inertia's infinite scroll and makes every browser-test wait an assertion, which found two real bugs (see the end).Mentions
@in a note lists@all(in the reader's language:@todos,@alle, …) and the teammates who see the post; Enter, Tab or a click picks one and inserts a chip.@[user:{uuid}], and@[everyone]for everyone. Names never live in the body, so a renamed member shows their current name everywhere.post_note_mentions(note, user) records who a note mentions; the API, MCP and web resources returnmentions: [{id, name}].App\Support\PostNoteMentions, one pattern). The web resource sends each note split intoparts(text,mentionwith the person's id and current name,everyone), and the app shows and edits a note from them, so there is no parser or regex on the front. The API and MCP keepbody+mentions.ListPostNoteAudience: every member of the workspace, and on a pending request only the approvers and the member who asked. A mention of anyone else is removed when the note is saved (withoutMentionsOutside), so a note never names someone it cannot reach.Note editor (TipTap)
The composer field is a TipTap editor (new dependencies, approved). Plain-text editors are built from
components/tiptap/:editor.ts: the plain-text nodes every editor shares (document, paragraph, text, line break, placeholder).plugins/noteBody.ts: TipTap's ownMention, configured so a chip reads back as its markup throughrenderText. The body to store is justeditor.getText();setNoteParts(parts)opens a note from its parts (each line break becomes TipTap'shardBreaknode). A copied chip reads@Name. The plugin is the one front-end file that knows the note format.plugins/noteKeys.ts: Enter sends and Esc cancels, leaving both keys to the@list while it is open.The mention search filters the people loaded once per post, in memory; it never queries the server per keystroke.
Mention card
Hovering or focusing a mention opens a card with the person's photo, name and local time (in the viewer's clock format). A mention of yourself opens your own card; someone no longer in the workspace reads as "unknown".
Who gets an email
NotifyPostNoteRecipientsreplacesNotifyPostNoteAdded:@all) get the newPostNoteMentionedemail (Maizzle, 16 locales), with mentions shown as@Name.PostNoteEmailand read their words frommail.php, and stay behind the existing "New note on a post" preference. A mention outside the audience, or of yourself, emails nobody.#[DeleteWhenMissingModels]onSendNotificationandPostNoteEmail).Reactions
post_note_reactions(note, user, emoji), unique on the three.App\Rules\SingleEmojitakes exactly one emoji: a pictograph, a flag or a keycap, at most 16 code points.emojicolumn usesutf8mb4_bin:utf8mb4_unicode_cicompares different emoji as equal, so 👍 and 🎉 would collide on the unique index.post.note.changedonly when something changed (dispatchIf). Reactions send no email.Loading notes (infinite scroll)
postNotesscroll prop (BuildPostNotesProps,Inertia::scrolloverListPostNotes::thread()), paged by cursor (notes_cursor, withmeta.total): notes are added and deleted while a thread is open, and an offset page would then skip or repeat a note. This is an owner exception recorded in AGENTS.md; the API and MCP keep page pagination. The panel reads it with<InfiniteScroll reverse>: scrolling up loads older notes, the first load lands on the newest.?notes=in the URL, replaced, no history entry), so one thread is open at a time.post.note.changednames the note (note_id) so other members' threads fetch just that note (GET posts/{post}/notes/{note}, new on the web and the API) or drop it. A refused send or edit says why and keeps the text.useHttpinstead offetch. The webGET posts/{post}/notesJSON endpoint is gone; the API and MCP keep theirs.Web, API and MCP
app.) / API (api.)GET posts/{post}/notes/mentionableslist-post-note-mentionables-toolPUT posts/{post}/notes/{note}/reactions{emoji}add-post-note-reaction-toolDELETE posts/{post}/notes/{note}/reactions{emoji}remove-post-note-reaction-tool(destructive)The note tools describe the mention syntax, what an id missing from
mentionsmeans, and who is emailed.Browser-test waits now fail
Every
waitFor*helper goes throughwaitForCondition(tests/Pest.php), which polled for 30 seconds and then returned silently: a test whose wait never came true went on as if it had. It now asserts the condition was met. That made 17 tests outside notes fail on every run. Each one was investigated:Real bugs (fixed)
pages/create/Ideas.vuenow applies queued moves at once and sends every one, in order, each with its column as the board shows it then (a card dropped twice keeps its last drop).CreateIdeasBoardTestcovers one, three and a repeated card, each failing before its fix.aria-expandednever turned true. TipTap only recomputes the editable's attributes when the document changes, so opening the mention list leftaria-expanded="false"and noaria-activedescendantfor screen readers. The editor now refreshes them when the list opens or the highlight moves.Tests that waited for something that never happens (app was right)
ComposerXPollTest(2)<input>to be visible; it is always hidden. Now waits for it to exist.LinkedInCommentTest<br>in a<textarea>; the line break is in itsvalue.LabelRowMenuTestComposerAutosaveTest{text, media}.ComposerUnsavedChangesTest/scheduleafter clicking the logo, which links to/schedule. Now waits for the URL to change. The guard itself is untouched.CalendarDragAndDropTest(2)WebhookShowTestChannelMetricsCardTesttypes[]in the URL, which holdstypes[0].ConnectChannelDialogTestComposerSharedDataTestInsightsChannelFilterTestPostComposerDialogTestPublishQueueTestChangelogTestwaitForDatabaseasserts its condition too.To confirm
ComposerChannelSettingsTestmeant to cover "a pending reel stays pending for a member who needs approval", but acted as the workspace owner, who always publishes directly. With a real member it shows that, after saving, a member who is not an admin sees the step to reconnect the Instagram account through Facebook. Reconnecting is usually an admin action; tell me if it should not be offered there (useSaveAndLinkFacebook).Review fixes
Three review passes found, and this PR fixes, with a test that fails without each: a reaction's own broadcast resetting the thread (now single-note updates), a second post's thread showing the first one's notes, a linked note's page load that could loop or hang, Enter not sending while the mention list finds nobody,
aria-controlspointing at a missing list and the edit field without a name, a refused send or edit losing the text silently, a note repeated by an older page staying after deletion, an update broadcast bringing a deleted note back, notes in the same second swapping pages (id tiebreaker), and failed deletes or reactions showing "couldn't save".Tests
PostNoteControllerTest: the thread pages by cursor (a deleted recent note does not make the older page skip one), every change broadcasts its note id, a note deleted before its email goes out drops the job, malformed thread ids, edits dropping mentions of someone who left, delete cascades, participants, mentions replacing the note email, edits emailing only new mentions,@all, the pending audience, thepostNotespage prop (newest first,notes_page, hidden for someone who cannot see the post).PostNotesParityTest: the noteshowroute on the web and the API, reactions and emoji rules, the mention list, mentions stored lower-case and outsiders dropped through the API and MCP, hidden pending requests and cross-tenant 404s, on every surface.PostNoteMentionsTest: a note splits into parts with nothing lost, and mention parts carry names (or null once the person is gone).MailRenderingTest: the mention email in English and Portuguese,@allin each language, a gone member as "unknown".PostNotesTest(browser, 25): a note with blank lines, people and everyone saved unchanged through the editor, mention from the list and the keyboard,@all, the card, reactions, edits, a refused edit, Enter with no match, one thread at a time and closing it, scrolling up loads older notes and reacting or sending keeps them, a repeated note removed on delete, failed delete and reaction toasts, a link to a note two pages back, a gone member as "unknown".Test plan
Automated:
Manual test plan
Setup
php artisan migrate(createspost_note_reactionsandpost_note_mentions) andphp artisan changelog:syncOpening a thread
?notes=<post id>and the browser Back button does not step through opening and closing threads?notesfrom the URL?notes=<post id>reopens that threadWriting a note
Mentions
@opens the list:@allfirst (in your language:@todosin Portuguese,@allein German…), then the teammates who see the post, never yourself@allrow has the people icon and "Everyone on this post"; each teammate row has their photo or initials@filters by name, ignoring case and accents (@anafinds "Ána")@Name; Backspace removes the whole chip@allrow and chip never cut the word, in Portuguese and German too@Namein the current name: rename a mentioned member and the note shows the new name@Name, not the stored markup@[user:…]markup is not turned into a chip; agreed, nobody pastes it)@list once the thread reopensMention card
Editing and deleting
@alland a deleted user's mention shows@alland@unknownchips; saving a change keeps@alland drops the mention of the deleted userReactions
1️⃣) and skin tones work as reactionsOlder notes (infinite scroll)
Realtime (two browsers on the same post)
Links to a note
Emails (Herd Mail)
@Namefor each mention@allsends the mention email to everyone who sees the post except its author, and@allreads in each recipient's language@allemails only the people the note had not mentioned yetPosts pending approval
?notes=to it opens no thread@list offers only the approvers and Ana; a mention of Bia sent through the API is removedLayout
API (personal access token of an admin)
GET /api/posts/{post}/noteslists notes newest first withmentions,reactionsand page metadata?page=2returns the next page andmeta.totalstays rightPOST /api/posts/{post}/noteswith@[user:<id>]and@[everyone]stores the mentions and emails the people mentioned; a mention of someone outside the workspace is removedGET /api/posts/{post}/notes/{note}returns one notePUT/DELETE /api/posts/{post}/notes/{note}edit and delete your own noteGET /api/posts/{post}/notes/mentionableslists who can be mentionedPUT/DELETE /api/posts/{post}/notes/{note}/reactionswith{"emoji": "👍"}add and take back a reaction;{"emoji": "ab"}returns 422MCP (Claude or ChatGPT connected)
@all, edit it, react to it, take the reaction back and delete it; each works and the app shows it liveIdeas board
What's New
Other languages