From 36d555f3fbc74c8b8c4e391c740719c6d930e5da Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Sat, 14 Mar 2026 11:03:04 -0400 Subject: [PATCH] Add Linear project unfurling support (#11525) * Initial plan * Add Project type and unfurl implementation for Linear projects Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * Fix linter issues - remove unused import and rename unused parameter Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * Make actor parameter optional in unfurl helper methods Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> * fix: Resolve type errors in Linear project unfurl Use project.status (ProjectStatus object) instead of the deprecated project.state (string) field, add satisfies constraint, and fix exhaustive return in unfurl switch. Co-Authored-By: Claude Opus 4.6 * Determine mention type * styling --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: tommoor <380914+tommoor@users.noreply.github.com> Co-authored-by: Tom Moor Co-authored-by: Claude Opus 4.6 --- app/components/HoverPreview/Components.tsx | 10 +- app/components/HoverPreview/HoverPreview.tsx | 13 ++ .../HoverPreview/HoverPreviewIssue.tsx | 2 +- .../HoverPreview/HoverPreviewProject.tsx | 144 +++++++++++++++ app/utils/mention.ts | 6 +- plugins/linear/server/linear.ts | 170 +++++++++++++----- server/presenters/unfurl.ts | 7 + server/types.ts | 4 + shared/editor/components/Mentions.tsx | 74 ++++++++ shared/editor/nodes/Mention.tsx | 19 +- shared/i18n/locales/en_US/translation.json | 3 + shared/types.ts | 34 ++++ 12 files changed, 426 insertions(+), 60 deletions(-) create mode 100644 app/components/HoverPreview/HoverPreviewProject.tsx diff --git a/app/components/HoverPreview/Components.tsx b/app/components/HoverPreview/Components.tsx index 6cc6d7b3a2..426c10f685 100644 --- a/app/components/HoverPreview/Components.tsx +++ b/app/components/HoverPreview/Components.tsx @@ -43,9 +43,9 @@ export const Info = styled(StyledText).attrs(() => ({ white-space: nowrap; `; -export const Description = styled(StyledText)` +export const Description = styled(StyledText)<{ $margin?: string }>` ${sharedVars} - margin-top: 0.5em; + margin-top: ${(props) => props.$margin ?? "0.5em"}; line-height: var(--line-height); max-height: calc(var(--line-height) * ${NUMBER_OF_LINES}); overflow: hidden; @@ -64,8 +64,6 @@ export const Label = styled(Text).attrs({ size: "xsmall", weight: "bold" })<{ width: fit-content; border-radius: 2em; padding: 1px 8px 1px 20px; - margin-right: 0.5em; - margin-top: 0.5em; position: relative; flex-shrink: 0; @@ -75,8 +73,8 @@ export const Label = styled(Text).attrs({ size: "xsmall", weight: "bold" })<{ left: 8px; top: 50%; transform: translateY(-50%); - width: 6px; - height: 6px; + width: 8px; + height: 8px; border-radius: 50%; background-color: ${(props) => props.color || props.theme.backgroundSecondary}; diff --git a/app/components/HoverPreview/HoverPreview.tsx b/app/components/HoverPreview/HoverPreview.tsx index 3be4c32ca1..00965d055c 100644 --- a/app/components/HoverPreview/HoverPreview.tsx +++ b/app/components/HoverPreview/HoverPreview.tsx @@ -17,6 +17,7 @@ import HoverPreviewGroup from "./HoverPreviewGroup"; import HoverPreviewIssue from "./HoverPreviewIssue"; import HoverPreviewLink from "./HoverPreviewLink"; import HoverPreviewMention from "./HoverPreviewMention"; +import HoverPreviewProject from "./HoverPreviewProject"; import HoverPreviewPullRequest from "./HoverPreviewPullRequest"; const DELAY_CLOSE = 500; @@ -192,6 +193,18 @@ const HoverPreviewDesktop = observer( createdAt={data.createdAt} state={data.state} /> + ) : data.type === UnfurlResourceType.Project ? ( + ) : ( )} - + {labels.map((label, index) => (