Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(home): preview projects from unread notifications (#9447)

gbirman14f56e753ab8
diff --git a/apps/web/AGENTS.md b/apps/web/AGENTS.md
index 2d995d7e48..30fef36900 100644
--- a/apps/web/AGENTS.md
+++ b/apps/web/AGENTS.md
@@ -518,7 +518,9 @@ resolved session ID; keep the existing `AgentSessionProvider` subscription to
for checkbox, row, Only, keyboard, and touch behavior.
- Keep added external chats (WhatsApp today) in External at `/external/chat/:chatId` with their own queries (`features/external-chat`); sharing controls viewing and the viewer's own provider membership controls sending. Never route them through channel context or services.
- All API/network calls live in service-clients.
-- Open projects through `openProject` (`features/projects/open-project.ts`): it
+- Preview Home project rows with the shared `ProjectDetail`; preserve its project
+ search namespace, comment target, and Home breadcrumb. Touch and explicit split
+ activation use the full project route. Open other projects through `openProject` (`features/projects/open-project.ts`): it
retargets an already-open project split to the section or comment in place.
Shared open paths (unified list rows) use its `projectHostedContent`, whose
identity is the project itself, so the router focuses the split already
diff --git a/apps/web/src/components/app/previewTarget.ts b/apps/web/src/components/app/previewTarget.ts
index e266ba3295..7d0fc7baa5 100644
--- a/apps/web/src/components/app/previewTarget.ts
+++ b/apps/web/src/components/app/previewTarget.ts
@@ -23,6 +23,8 @@ import type {
DocumentEntity,
ForeignEntity,
} from '@entity';
+import type { WithNotification } from '@entity/types/notification';
+import { newestRowNotification } from '@notifications/row-notification';
import { untrack } from 'solid-js';
import { match, P } from 'ts-pattern';
@@ -54,6 +56,7 @@ type ForeignPreviewSelection = Pick<
/** Selections that render inline through a block. */
export type PreviewPanelSelection =
| IdOnlyPreviewSelection
+ | WithNotification<{ type: 'initiative'; id: string }>
| DocumentPreviewSelection
| ForeignPreviewSelection
| ChannelPreviewSelection;
@@ -105,6 +108,21 @@ export function previewBlockTarget(
};
}
)
+ .with({ type: 'initiative' }, (project) => {
+ const notification = untrack(() => newestRowNotification(project));
+ const metadata = notification?.notification_metadata;
+ return {
+ blockType: 'initiative',
+ blockId: project.id,
+ aliasContext: undefined,
+ params: {
+ section: 'overview',
+ ...(metadata?.tag === 'initiative_discussion'
+ ? { discussionId: metadata.content.messageId }
+ : {}),
+ },
+ };
+ })
.with({ type: 'foreign' }, (foreignEntity) => ({
blockType:
USE_MACRO_PR_SUMMARY_BLOCK &&
diff --git a/apps/web/src/features/home/components/HomeList.tsx b/apps/web/src/features/home/components/HomeList.tsx
index d31d47655c..2504187c0f 100644
--- a/apps/web/src/features/home/components/HomeList.tsx
+++ b/apps/web/src/features/home/components/HomeList.tsx
@@ -172,10 +172,7 @@ export function HomeList(props: HomeListProps) {
const newSplit =
metadata?.newSplit === true || metadata?.event?.shiftKey === true;
- // Projects have no Home preview, so activating one opens it in place
- // instead of selecting a row that shows nothing.
- const previewable = sourceRow.entity.type !== 'initiative';
- if (!isTouchDevice() && !newSplit && previewable) {
+ if (!isTouchDevice() && !newSplit) {
markEntitySeen(sourceRow.entity);
showPreview(sourceRow.entity, { activate: true });
props.onPreviewActivate?.();
@@ -204,10 +201,7 @@ export function HomeList(props: HomeListProps) {
entity: WithNotification<EntityData>,
options?: { activate?: boolean }
) {
- props.onPreviewEntityChange(
- entity?.type === 'initiative' ? undefined : entity,
- options
- );
+ props.onPreviewEntityChange(entity, options);
}
const previewAfterNavigation = debounce(showPreview, 150);
@@ -307,9 +301,7 @@ export function HomeList(props: HomeListProps) {
return ({ entity }) => {
previewAfterNavigation.clear();
- props.onPreviewEntityChange(
- entity?.type === 'initiative' ? undefined : entity
- );
+ props.onPreviewEntityChange(entity);
};
};
diff --git a/apps/web/src/features/home/components/HomeProjectPreview.tsx b/apps/web/src/features/home/components/HomeProjectPreview.tsx
new file mode 100644
index 0000000000..53229132ef
--- /dev/null
+++ b/apps/web/src/features/home/components/HomeProjectPreview.tsx
@@ -0,0 +1,67 @@
+import { ViewBreadcrumbs } from '@app/components/view-shell';
+import { ProjectDetail } from '@app/features/projects/project-detail';
+import { t } from '@app/lib/i18n';
+import { createSearchParams } from '@app/lib/split-router';
+import { PreviewFrame } from '@components/app/PreviewPanel';
+import { SidePanel } from '@components/app/side-panel';
+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
+import { homeProjectSearch } from '../home-route-schema';
+import { useHomeView } from '../home-view-context';
+
+/** The existing project detail, hosted by Home instead of the Tasks workspace. */
+export function HomeProjectPreview() {
+ const panel = useSplitPanelOrThrow();
+ const { previewTarget, previewNavigationRequest, closePreview } =
+ useHomeView();
+ const [search, setSearch] = createSearchParams(homeProjectSearch);
+ const id = () => previewTarget()!.blockId;
+ const value = () => `initiative:${id()}`;
+
+ return (
+ <PreviewFrame
+ splitPanelContext={panel}
+ hideHeader
+ locationKey={() =>
+ `${id()}:${search.section}:${search.discussionId}:${previewNavigationRequest()}`
+ }
+ >
+ <ViewBreadcrumbs.Root
+ value={value()}
+ onChange={(next) => {
+ if (next === 'home') closePreview();
+ }}
+ >
+ <ViewBreadcrumbs.Item value="home" metadata={null} order={0}>
+ {(item) => (
+ <ViewBreadcrumbs.ReturnButton onClick={item.onSelect}>
+ {t('nav.home')}
+ </ViewBreadcrumbs.ReturnButton>
+ )}
+ </ViewBreadcrumbs.Item>
+ <SidePanel.Root>
+ <div class="flex h-full min-h-0 flex-col">
+ <ProjectDetail
+ navigationRequest={previewNavigationRequest()}
+ route={{
+ id: id(),
+ section: search.section,
+ discussionId: search.discussionId,
+ }}
+ breadcrumb={{
+ entry: {
+ value: value(),
+ data: { type: 'initiative', id: id() },
+ },
+ order: 1,
+ }}
+ onSectionChange={(section) =>
+ setSearch({ section, discussionId: undefined })
+ }
+ onDelete={closePreview}
+ />
+ </div>
+ </SidePanel.Root>
+ </ViewBreadcrumbs.Root>
+ </PreviewFrame>
+ );
+}
diff --git a/apps/web/src/features/home/home-preview-navigation.ts b/apps/web/src/features/home/home-preview-navigation.ts
index fc50b496db..d6a7f2bd18 100644
--- a/apps/web/src/features/home/home-preview-navigation.ts
+++ b/apps/web/src/features/home/home-preview-navigation.ts
@@ -28,7 +28,10 @@ import {
type PreviewPanelSelection,
previewBlockTarget,
} from '@components/app/previewTarget';
-import type { HomePreviewRouteParams } from './home-route-schema';
+import {
+ type HomePreviewRouteParams,
+ homeProjectSearch,
+} from './home-route-schema';
type DetailSearch = Record<string, SerializedSearchParams | undefined>;
@@ -48,6 +51,7 @@ export function homeDetailSearch(
channel?: SerializedSearchParams;
document?: SerializedSearchParams;
calendar?: SerializedSearchParams;
+ project?: SerializedSearchParams;
} = {}
): DetailSearch {
return {
@@ -59,6 +63,7 @@ export function homeDetailSearch(
[channelsSearch.namespace]: detail.channel,
[driveSearch.namespace]: detail.document,
[CALENDAR_SEARCH_NAMESPACE]: detail.calendar,
+ [homeProjectSearch.namespace]: detail.project,
};
}
@@ -70,7 +75,8 @@ function targetParam(target: PreviewBlockTarget, key: string): string {
function documentDetailSearch(
target: PreviewBlockTarget
): SerializedSearchParams | undefined {
- if (target.blockType === 'channel') return;
+ if (target.blockType === 'channel' || target.blockType === 'initiative')
+ return;
return driveSearchCodec.serialize({
...driveSearch.defaults,
commentId:
@@ -107,6 +113,13 @@ export function homePreviewTargetNavigation(
search: homeDetailSearch({
channel: channelTargetSearch(target),
document: documentDetailSearch(target),
+ project:
+ target.blockType === 'initiative'
+ ? {
+ section: [targetParam(target, 'section') || 'overview'],
+ discussionId: [targetParam(target, 'discussionId')],
+ }
+ : undefined,
}),
};
}
diff --git a/apps/web/src/features/home/home-route-schema.ts b/apps/web/src/features/home/home-route-schema.ts
index abd457611e..1c76e970c2 100644
--- a/apps/web/src/features/home/home-route-schema.ts
+++ b/apps/web/src/features/home/home-route-schema.ts
@@ -50,8 +50,21 @@ export function homeBaseBlockType(
: (blockType as BlockName);
}
+export const homeProjectSearch = {
+ namespace: 'project',
+ schema: z.object({
+ section: z.enum(['overview', 'tasks']).default('overview'),
+ discussionId: z.string().optional(),
+ }),
+ defaults: {
+ section: 'overview' as const,
+ discussionId: undefined as string | undefined,
+ },
+};
+
/** Search the inline Home item owns; the channel namespace is shared with the channels view. */
export const HOME_PREVIEW_SEARCH_NAMESPACES = [
channelsSearch.namespace,
driveSearch.namespace,
+ homeProjectSearch.namespace,
] as const;
diff --git a/apps/web/src/features/home/home-route.ts b/apps/web/src/features/home/home-route.ts
index 5ce410c7a3..6268a76036 100644
--- a/apps/web/src/features/home/home-route.ts
+++ b/apps/web/src/features/home/home-route.ts
@@ -12,8 +12,10 @@ import type { SplitContent } from '@components/app/split-layout/layoutManager';
import { isBlockAlias, resolveBlockAlias } from '@core/constant/allBlocks';
import { documentCommentLocation } from '@notifications/document-comment-location';
import type { z } from 'zod';
+import { projectHostedContent } from '../projects/open-project';
import {
type HomePreviewRouteParams,
+ type homeProjectSearch,
isHomeDocumentType,
} from './home-route-schema';
@@ -23,6 +25,7 @@ export type HomePreviewSearch = {
'messageId' | 'threadId'
>;
document: Pick<DriveSearchParams, 'commentId'>;
+ project?: z.infer<typeof homeProjectSearch.schema>;
};
/** Normalize typed and fallback child routes to the same block identity. */
@@ -88,9 +91,14 @@ export function homePreviewTarget(
? { alias: params.blockType, baseType: blockType }
: undefined,
params:
- blockType === 'channel'
- ? channelParams(search.channel)
- : commentParams(params.blockType, search.document),
+ blockType === 'initiative'
+ ? {
+ section: search.project?.section ?? 'overview',
+ discussionId: search.project?.discussionId,
+ }
+ : blockType === 'channel'
+ ? channelParams(search.channel)
+ : commentParams(params.blockType, search.document),
};
}
@@ -99,6 +107,13 @@ export function homePreviewLegacyTarget(
params: HomePreviewRouteParams,
search: HomePreviewSearch
): SplitContent {
+ if (params.blockType === 'initiative') {
+ return projectHostedContent(
+ params.previewId,
+ search.project?.section ?? 'overview',
+ search.project?.discussionId
+ );
+ }
const target = homePreviewTarget(params, search);
return {
type: params.blockType,
diff --git a/apps/web/src/features/home/home-view-context.tsx b/apps/web/src/features/home/home-view-context.tsx
index bd8171875c..7415b9199e 100644
--- a/apps/web/src/features/home/home-view-context.tsx
+++ b/apps/web/src/features/home/home-view-context.tsx
@@ -47,7 +47,7 @@ import {
homePreviewTargetNavigation,
} from './home-preview-navigation';
import { homeDetailParamsFromRoute, homePreviewTarget } from './home-route';
-import { isHomeDocumentType } from './home-route-schema';
+import { homeProjectSearch, isHomeDocumentType } from './home-route-schema';
import { homeTabSearch, homeTabSearchCodec } from './home-tab-search';
import { createHomeViewPersistence, normalizeHomeFacets } from './persistence';
import type {
@@ -96,6 +96,7 @@ export const [HomeViewProvider, useHomeView] = createAssertedContextProvider<
useParams<Parameters<typeof homeDetailParamsFromRoute>[0]>();
const [channelSearch] = createSearchParams(channelsSearch);
const [documentSearch] = createSearchParams(driveSearch);
+ const [projectSearch] = createSearchParams(homeProjectSearch);
const [tabSearch] = createSearchParams(homeTabSearch);
const selectPreview = createPreviewSelectionGuard();
const initial = props.initialState ?? {};
@@ -138,6 +139,7 @@ export const [HomeViewProvider, useHomeView] = createAssertedContextProvider<
return homePreviewTarget(params, {
channel: channelSearch,
document: documentSearch,
+ project: projectSearch,
});
});
const withTab = (
diff --git a/apps/web/src/features/home/home-view.tsx b/apps/web/src/features/home/home-view.tsx
index 8fb960eae7..e157f67d21 100644
--- a/apps/web/src/features/home/home-view.tsx
+++ b/apps/web/src/features/home/home-view.tsx
@@ -27,6 +27,11 @@ import { HomeViewProvider, useHomeView } from './home-view-context';
import { homeTour } from './tour';
import type { HomeViewStateOptions } from './types';
+const HomeProjectPreview = lazyNamed(
+ () => import('./components/HomeProjectPreview'),
+ 'HomeProjectPreview'
+);
+
// The calendar grid (FullCalendar) only loads once Home's calendar route opens.
const CalendarView = lazyNamed(
() => import('@app/features/calendar-view/calendar-view'),
@@ -261,13 +266,20 @@ function HomeDetailRouteContent() {
return (
<DebugSuspense name="HomeView.detail-content">
- <PreviewPanel
- target={previewTarget()}
- navigationRequest={previewNavigationRequest()}
- orchestrator={orchestrator}
- splitPanelContext={panel}
- headerLeading={<HomeReturnBreadcrumb onReturn={closePreview} />}
- />
+ <Show
+ when={previewTarget()?.blockType === 'initiative'}
+ fallback={
+ <PreviewPanel
+ target={previewTarget()}
+ navigationRequest={previewNavigationRequest()}
+ orchestrator={orchestrator}
+ splitPanelContext={panel}
+ headerLeading={<HomeReturnBreadcrumb onReturn={closePreview} />}
+ />
+ }
+ >
+ <HomeProjectPreview />
+ </Show>
</DebugSuspense>
);
}
diff --git a/apps/web/src/features/home/route-views.tsx b/apps/web/src/features/home/route-views.tsx
index abe9e7da63..90c48dc746 100644
--- a/apps/web/src/features/home/route-views.tsx
+++ b/apps/web/src/features/home/route-views.tsx
@@ -16,6 +16,7 @@ import {
homePreviewLegacyTarget,
} from './home-route';
import type { HomePreviewRouteParams } from './home-route-schema';
+import { homeProjectSearch } from './home-route-schema';
import { HomePendingView, HomeView } from './home-view';
type HomeDetailParams = Partial<HomePreviewRouteParams> & {
@@ -29,6 +30,7 @@ function HomeLegacyRouteView() {
const params = useParams<HomeDetailParams>();
const [channelSearch] = createSearchParams(channelsSearch);
const [documentSearch] = createSearchParams(driveSearch);
+ const [projectSearch] = createSearchParams(homeProjectSearch);
const [eventSearch] = createSearchParams(calendarSearch);
const legacyTarget = () => {
const { period } = params;
@@ -38,6 +40,7 @@ function HomeLegacyRouteView() {
return homePreviewLegacyTarget(detail, {
channel: channelSearch,
document: documentSearch,
+ project: projectSearch,
});
};
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index 6c1685d70a..709138b61c 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -1,4 +1,5 @@
import { createCalendarRange } from '@app/features/calendar-view/calendar-range';
+import { createSearchParamsCodec } from '@app/lib/split-router';
import {
previewBlockTarget,
previewCalendarTarget,
@@ -9,7 +10,8 @@ import {
homeCalendarNavigation,
homePreviewNavigation,
} from '../home/home-preview-navigation';
-import { homePreviewTarget } from '../home/home-route';
+import { homePreviewLegacyTarget, homePreviewTarget } from '../home/home-route';
+import { homeProjectSearch } from '../home/home-route-schema';
vi.mock('@core/mobile/isTouchDevice', () => ({
isTouchDevice: vi.fn(() => false),
@@ -327,6 +329,67 @@ describe('project rows', () => {
ownerId: 'owner',
};
+ it.each(['unseen', 'seen'] as const)(
+ 'keeps a %s discussion target in the Home preview URL and touch fallback',
+ (state) => {
+ const notification: UnifiedNotification = {
+ id: 'project-comment-notification',
+ entity_id: projectId,
+ entity_type: 'initiative',
+ sender_id: null,
+ state,
+ created_at: '2026-10-01T12:00:00Z',
+ updated_at: '2026-10-01T12:00:00Z',
+ sent: true,
+ viewed_at: null,
+ notification_event_type: 'initiative_discussion',
+ notification_metadata: {
+ tag: 'initiative_discussion',
+ content: {
+ projectName: 'Roadmap',
+ owner: 'owner',
+ reason: 'reply',
+ messageId: 'reply',
+ threadId: 'root',
+ text: 'Update',
+ },
+ },
+ };
+ const selection = { ...entity, notifications: () => [notification] };
+ const navigation = homePreviewNavigation(selection);
+ const project = createSearchParamsCodec(homeProjectSearch).parse(
+ navigation.search.project ?? {}
+ ).value;
+ const search = {
+ channel: { messageId: '', threadId: '' },
+ document: { commentId: '' },
+ project,
+ };
+ expect(homePreviewTarget(navigation.params, search)).toMatchObject({
+ blockType: 'initiative',
+ blockId: projectId,
+ params: { section: 'overview', discussionId: 'reply' },
+ });
+ expect(homePreviewLegacyTarget(navigation.params, search)).toMatchObject({
+ type: 'initiative',
+ id: projectId,
+ entryMetadata: { search: { project: { discussionId: ['reply'] } } },
+ });
+ expect(
+ homePreviewNavigation({
+ ...selection,
+ notificationDisplayCutoff: '2026-10-02T12:00:00Z',
+ }).search.project?.discussionId
+ ).toEqual(['']);
+ expect(
+ homePreviewNavigation({
+ ...selection,
+ notifications: () => [{ ...notification, state: 'done' }],
+ }).search.project?.discussionId
+ ).toEqual(['']);
+ }
+ );
+
it.each([false, true])(
'opens a project through its Tasks-hosted identity (new split: %s)',
async (openInNewSplit) => {
@@ -1903,6 +1966,7 @@ describe('getChannelEntityTarget', () => {
'pdf-detail',
'agent-detail',
'call-detail',
+ 'project',
])('clears stale %s targets on ordinary Home navigation', (namespace) => {
const navigation = homePreviewNavigation({ type: 'channel', id: 'other' });
expect(Object.hasOwn(navigation.search, namespace)).toBe(true);
diff --git a/apps/web/src/features/projects/project-collaboration.test.tsx b/apps/web/src/features/projects/project-collaboration.test.tsx
index 11da8d08c9..ec837410c5 100644
--- a/apps/web/src/features/projects/project-collaboration.test.tsx
+++ b/apps/web/src/features/projects/project-collaboration.test.tsx
@@ -109,14 +109,17 @@ function setup(initialTargetId?: string) {
});
const [canWrite, setCanWrite] = createSignal(true);
const [targetId, setTargetId] = createSignal(initialTargetId);
+ const [requestKey, setRequestKey] = createSignal(0);
return {
setCanWrite,
setTargetId,
+ setRequestKey,
...render(() => (
<ProjectDiscussion
projectId={projectId}
canWrite={canWrite()}
targetId={targetId()}
+ targetRequestKey={requestKey()}
/>
)),
};
@@ -169,6 +172,19 @@ describe('project discussion uses the task conversation', () => {
);
});
+ it('re-aims the same comment without replacing the composer', () => {
+ const view = setup(oldId);
+ const comment = view.getByText('Old comment').closest('article')!;
+ const composer = view.getByRole('textbox');
+ fireEvent.input(composer, { target: { value: 'Unsent reply' } });
+ fireEvent.click(comment);
+ expect(comment.dataset.target).toBeUndefined();
+ view.setRequestKey(1);
+ expect(comment.dataset.target).toBe(oldId);
+ expect(view.getByRole('textbox')).toBe(composer);
+ expect((composer as HTMLTextAreaElement).value).toBe('Unsent reply');
+ });
+
it('dismisses a linked comment highlight without changing the loaded timeline', () => {
const view = setup(oldId);
const comment = view.getByText('Old comment').closest('article')!;
diff --git a/apps/web/src/features/projects/project-collaboration.tsx b/apps/web/src/features/projects/project-collaboration.tsx
index 71c9ccc6fb..4c8a7fc805 100644
--- a/apps/web/src/features/projects/project-collaboration.tsx
+++ b/apps/web/src/features/projects/project-collaboration.tsx
@@ -8,9 +8,13 @@ export function ProjectDiscussion(props: {
projectId: string;
canWrite: boolean;
targetId?: string;
+ targetRequestKey?: string | number;
}) {
const targetId = createMemo(() => props.targetId);
- const targetRequest = createMemo(() => ({ id: targetId() }));
+ const targetRequest = createMemo(() => ({
+ id: targetId(),
+ key: props.targetRequestKey,
+ }));
const [clearedTarget, setClearedTarget] =
createSignal<ReturnType<typeof targetRequest>>();
@@ -19,6 +23,7 @@ export function ProjectDiscussion(props: {
parent={{ type: 'initiative', id: props.projectId }}
canWrite={props.canWrite}
targetId={props.targetId}
+ targetRequestKey={props.targetRequestKey}
targetCleared={clearedTarget() === targetRequest()}
onClearTarget={() => setClearedTarget(targetRequest())}
buildLink={(message) =>
diff --git a/apps/web/src/features/projects/project-detail.tsx b/apps/web/src/features/projects/project-detail.tsx
index 60d0f38236..fca1b60d77 100644
--- a/apps/web/src/features/projects/project-detail.tsx
+++ b/apps/web/src/features/projects/project-detail.tsx
@@ -7,6 +7,7 @@ import {
import type { ComposeTaskProps } from '@app/features/task-composer/core/types';
import { t } from '@app/lib/i18n';
import { useNavigate } from '@app/lib/split-router';
+import { usePending } from '@app/observability/flow';
import {
projectDetailRoute,
projectTaskRoute,
@@ -99,8 +100,10 @@ export function ProjectBreadcrumb(props: ProjectBreadcrumbProps) {
type ProjectDetailProps = {
route: ProjectRoute;
+ navigationRequest?: number;
breadcrumb?: ProjectBreadcrumbProps;
onDelete?(): void;
+ onSectionChange?(section: ProjectSection): void;
};
function ProjectTitleMenu(props: {
@@ -208,17 +211,20 @@ function ProjectTitleMenu(props: {
function ProjectDetailHost(props: ProjectDetailProps) {
const context = useProjectsContext();
const source = context.createProjectSource(() => props.route.id);
+ usePending('project.detail', source.loading);
useSplitDisplayName(() => source.project()?.name ?? 'Project');
const commands = context.createCommands();
const openShare = useProjectShareModal(source.project, commands);
const panel = useSplitPanelOrThrow();
const layout = useSplitLayout();
const navigate = useNavigate();
- const section = (section: ProjectSection) =>
- navigate({
+ const section = (section: ProjectSection) => {
+ if (props.onSectionChange) return props.onSectionChange(section);
+ return navigate({
route: projectDetailRoute,
params: { projectId: props.route.id, section },
});
+ };
const createTask = (options?: TaskCreateOptions) => {
const projectId = props.route.id;
layout.popoverSplit({
@@ -349,6 +355,7 @@ function ProjectDetailHost(props: ProjectDetailProps) {
projectId={project().id}
canWrite={canDiscussProject(project())}
targetId={props.route.discussionId}
+ targetRequestKey={props.navigationRequest}
/>
}
/>
diff --git a/apps/web/src/lib/core/messages/EntityConversation.tsx b/apps/web/src/lib/core/messages/EntityConversation.tsx
index a4b74f6a55..c44746c3c6 100644
--- a/apps/web/src/lib/core/messages/EntityConversation.tsx
+++ b/apps/web/src/lib/core/messages/EntityConversation.tsx
@@ -61,6 +61,8 @@ export function EntityConversation(props: {
/** Delete comments the caller did not write. Document owners set this. */
canModerate?: boolean;
targetId?: string | null;
+ /** Re-aim the same linked comment without remounting the conversation. */
+ targetRequestKey?: string | number;
/** The linked view stays around `targetId`, but its message is no longer highlighted. */
targetCleared?: boolean;
onClearTarget?: () => void;
@@ -152,6 +154,7 @@ export function EntityConversation(props: {
data={messagesById().get(id)!}
canWrite={props.canWrite}
canModerate={props.canModerate}
+ targetRequestKey={props.targetRequestKey}
targetId={
target.rootId() === id && !props.targetCleared
? target.messageId()
diff --git a/docs/agent-guide/home.md b/docs/agent-guide/home.md
index a28e1bdc95..74449ac96c 100644
--- a/docs/agent-guide/home.md
+++ b/docs/agent-guide/home.md
@@ -170,6 +170,14 @@ arrow-key browsing keeps it open. Preview headers start with **Home >**. Clickin
sidebar visibility. Use the hamburger to reopen the feed. Mobile continues to
show the activity list alone.
+Project rows, including unread discussion notifications, open the project Overview
+inside Home on desktop. The preview keeps the Home return breadcrumb, project
+properties, description, and discussion; a discussion notification targets its
+message. Overview/Tasks tabs stay inside the Home preview, and reloading its URL
+restores the section and discussion target. Shift-click still opens the project
+in a split; touch opens the full-screen project page. Verify clicking an unread
+project row, switching tabs, returning Home, and reopening the same comment.
+
Desktop previews use the same header controls as their standalone views, with
the **Home >** return breadcrumb added. Calendar shares its date, search,
navigation, view, and New controls; email shares its action, navigation, AI/task,
diff --git a/docs/agent-guide/tasks.md b/docs/agent-guide/tasks.md
index ae26f2295e..7bd8b007dd 100644
--- a/docs/agent-guide/tasks.md
+++ b/docs/agent-guide/tasks.md
@@ -972,7 +972,9 @@ refreshes in the background to include the new row. If creation fails, the
composer reopens as a popover with the draft and the error.
Closing the popover without submitting keeps the underlying view open.
-Opening a project keeps the Tasks workspace and its navigation. The top bar
+Opening a project from Tasks keeps the Tasks workspace and its navigation.
+Home rows instead preview it inline with a Home return breadcrumb; touch and
+explicit split activation still use this full Tasks workspace. The top bar
shows the Projects return breadcrumb and the project name, with the same Share
and side-panel controls as task detail. `Project actions` (the dots button
after the name) opens the row context menu's entries for this project,