Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.
Go
fix: render doc links in project descriptions on mobile and in the @ menu (#11199)
Jiayuan Zhang4ba6cfe14ebe
diff --git a/apps/mobile/components/project/project-header-card.tsx b/apps/mobile/components/project/project-header-card.tsxindex 6c12eec4e0..ad45f2ad8c 100644--- a/apps/mobile/components/project/project-header-card.tsx+++ b/apps/mobile/components/project/project-header-card.tsx@@ -1,6 +1,7 @@/*** Header card for the project detail screen. Large emoji icon centered above- * the title, with the description shown in full (no truncation) below.+ * the title, with the description rendered as Markdown, mention links+ * included, in full (no truncation) below.** Mirrors the visual emphasis of web's `project-header.tsx` but in a single* vertical stack instead of the web sidebar layout — phones don't have the@@ -15,6 +16,7 @@ import { Pressable, View } from "react-native";import type { Project } from "@multica/core/types";import { Text } from "@/components/ui/text";import { ProjectIcon } from "@/components/ui/project-icon";+import { Markdown } from "@/lib/markdown";import { useT } from "@/lib/i18n";interface Props {@@ -38,13 +40,10 @@ export function ProjectHeaderCard({ project, onEdit }: Props) {>{project.title}</Text>- {project.description ? (- <Text- className="text-sm text-muted-foreground"- selectable- >- {project.description}- </Text>+ {project.description?.trim() ? (+ <View className="w-full">+ <Markdown content={project.description} />+ </View>) : onEdit ? (<Text className="text-sm text-muted-foreground/60 italic">{t("detail.add_description")}diff --git a/apps/mobile/lib/markdown/markdown.tsx b/apps/mobile/lib/markdown/markdown.tsxindex 16db1b96e8..2ff137d3d4 100644--- a/apps/mobile/lib/markdown/markdown.tsx+++ b/apps/mobile/lib/markdown/markdown.tsx@@ -143,6 +143,7 @@ export function Markdown({//// mention://issue/<uuid> → navigate to that issue detail// mention://project/<uuid> → navigate to that project detail+ // mention://doc/<uuid> → open the doc on web (no docs screen in the app)// mention://member/<uuid> → no-op (no member profile screen yet)// mention://agent/<uuid> → no-op (no agent profile screen yet)// mention://squad/<uuid> → no-op (no squad profile screen yet)@@ -160,6 +161,12 @@ export function Markdown({// the mapping explicit so a new type can't silently no-op.if (type === "issue") router.push(`/${wsSlug}/issue/${id}`);else if (type === "project") router.push(`/${wsSlug}/project/${id}`);+ else if (type === "doc") {+ const webUrl = process.env.EXPO_PUBLIC_WEB_URL?.replace(/\/+$/, "");+ if (webUrl) {+ Linking.openURL(`${webUrl}/${wsSlug}/docs/${id}`).catch(() => {});+ }+ }}return;}diff --git a/packages/views/editor/extensions/mention-suggestion.test.tsx b/packages/views/editor/extensions/mention-suggestion.test.tsxindex 78f6072475..946a058d7d 100644--- a/packages/views/editor/extensions/mention-suggestion.test.tsx+++ b/packages/views/editor/extensions/mention-suggestion.test.tsx@@ -585,6 +585,27 @@ describe("createMentionSuggestion", () => {expect(screen.getByText("Release runbook")).toBeInTheDocument();});+ it("shows a project's description with its mention links as their labels", () => {+ render(+ <I18nWrapper>+ <MentionList+ items={[+ {+ id: "p-geo",+ label: "AI Search",+ type: "project",+ description: "Key docs: [Baseline report](mention://doc/d-1)",+ },+ ]}+ query=""+ command={vi.fn()}+ />+ </I18nWrapper>,+ );+ expect(screen.getByText("Key docs: Baseline report")).toBeInTheDocument();+ expect(screen.queryByText(/mention:\/\//)).not.toBeInTheDocument();+ });+it("does not call searchIssues for an empty query", () => {render(<I18nWrapper><MentionList items={[]} query="" command={vi.fn()} /></I18nWrapper>);diff --git a/packages/views/editor/extensions/mention-suggestion.tsx b/packages/views/editor/extensions/mention-suggestion.tsxindex 034bc2e36f..1fedb5b3ba 100644--- a/packages/views/editor/extensions/mention-suggestion.tsx+++ b/packages/views/editor/extensions/mention-suggestion.tsx@@ -73,6 +73,7 @@ import {} from "../../common/picker-keys";import { isTriggerArmedAt } from "./suggestion-trigger-arming";import { blockedReasonLabel } from "../../issues/blocked-trigger-copy";+import { stripMentionMarkdown } from "../../issues/utils/strip-mention-markdown";// Types@@ -665,7 +666,7 @@ function MentionRow({<span className="block truncate font-medium text-foreground">{item.label}</span>{item.description && (<span className="block truncate text-muted-foreground">- {item.description}+ {stripMentionMarkdown(item.description)}</span>)}</span>diff --git a/server/internal/service/builtin_skills/multica-platform/references/projects.md b/server/internal/service/builtin_skills/multica-platform/references/projects.mdindex eb9838d907..7189d9660f 100644--- a/server/internal/service/builtin_skills/multica-platform/references/projects.md+++ b/server/internal/service/builtin_skills/multica-platform/references/projects.md@@ -41,6 +41,10 @@ quick-create task) is bound to a project, the project description is injectedinto the agent's brief under `## Project Context` and written to`.multica/project/resources.json` as `project_description`. Use it forproject-wide rules/context that should apply to every task in the project.+Point at docs, issues and projects with mention links+(`[Doc Title](mention://doc/<doc-id>)`, `[MUL-123](mention://issue/<uuid>)`),+not bare IDs: the project page renders them as links, and agents read the same+ID out of the link.Common resource types: