feat(web): mark sessions linked to a Mattermost chat - #146
Merged
Conversation
The Linear/Mattermost bridge binds a session to a Mattermost thread so a human can steer it from chat, but that binding lived only in the bridge's own database. Inside T3 the sidebar looked identical whether or not replies in chat were landing in the session. Adds `mattermostThreadUrl` to thread metadata, mirroring the existing `linearIssueUrl` tag end to end (contract, decider, both projectors, projection column via migration 1023, client reducer), and renders the Mattermost mark in the experimental sidebar's bottom-right lane beside the priority badge, owner avatar and provider icon. The badge is a labelled span rather than a link: it sits inside the row's button, where an anchor would be invalid HTML and would swallow row selection. Opening, changing and clearing the link live on the row's context menu, gated on the new `threadMattermostLink` capability so an older server shows none of it. The bridge writes the field through the `thread.meta.update` command it already speaks; no new T3 endpoint. Model: Claude Opus 5 (1M context), harness: T3 Code.
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
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.
Problem
The Linear/Mattermost bridge binds a session to a Mattermost thread so a human can steer it from chat, but that binding lived only in the bridge's own Postgres (
mattermost_threads). Inside T3 nothing recorded it — the sidebar row looked identical whether or not replies in chat were landing in the session.Fix
Adds
mattermostThreadUrlto thread metadata, mirroring the existinglinearIssueUrlmanual tag end to end:packages/contracts— the field onOrchestrationThread, the thread shell, thethread.meta.updatecommand and itsthread.meta-updatedpayload, plus athreadMattermostLinkcapability so an older server hides the affordances instead of failing on click.apps/server— decider passthrough, both projectors, theprojection_threadscolumn via migration 1023, and every snapshot query.packages/client-runtime— reducer passthrough.apps/web— the badge itself.The Mattermost mark renders in the experimental sidebar's bottom-right lane, immediately left of the provider icon, alongside the priority badge and owner avatar — the lane the request asked for.
Notes
<button>, where a nested<a>is invalid HTML and swallows row selection. Opening the conversation is a context-menu item instead.docs/site/static/img/brand/icon-denim.svgfrommattermost/mattermost), recoloured tocurrentColor— brand denim disappears in dark mode.thread.meta.update, so it can set this field on attach/bind. That bridge-side change is a follow-up int3-linear-bridge-nextand is not in this PR — until it lands, the badge lights up for links tagged by hand.apps/web/src/components/sidebar/); every hunk in an upstream-owned file is a markedT3-CUSTOM(expbkt3)addition beside itslinearIssueUrltwin.scripts/check-fork-markers.tspasses.Verification
Typecheck clean in
packages/contracts,packages/client-runtime,apps/web,apps/server(0 errors).Targeted tests, all passing:
apps/web/.../MattermostThreadBadge.test.tsx— 6 new (resolver: channel/DM/permalink labels, blank + unparseable +javascript:rejection; badge: label, sizing, svg)apps/server/.../decider.priority.test.ts— 2 new (set/clear, and omission leaves a live binding untouched)apps/server/.../1023_ProjectionThreadsMattermostLink.test.ts— 1 new (column added)projector.test.ts(11),ProjectionSnapshotQuery.test.ts(21),threadReducer.test.ts(33)No screenshot yet — the badge needs a thread carrying the field, which arrives with the deploy to expbkt3. I'll attach one from expbkt3.dev once it's serving this build.
Model: Claude Opus 5 (1M context), harness: T3 Code.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.