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.

feat(web): add standalone Reviews view and PR details (#6964)

dev-rb6c5c9a2a52a7
diff --git a/apps/web/src/components/app/split-layout/componentRegistry.tsx b/apps/web/src/components/app/split-layout/componentRegistry.tsx
index 5ab576009d..7794953bb2 100644
--- a/apps/web/src/components/app/split-layout/componentRegistry.tsx
+++ b/apps/web/src/components/app/split-layout/componentRegistry.tsx
@@ -21,6 +21,7 @@ import {
} from '@app/features/next-soup/route';
import { ReminderEditorSplit } from '@app/features/reminders/ReminderEditorSplit';
import { RemindersRouteView } from '@app/features/reminders/route';
+import { ReviewsRouteView } from '@app/features/reviews-view/route';
import { SettingsRouteView } from '@app/features/settings/route';
import { TasksRouteView } from '@app/features/tasks-view/route';
import { EventComposerSplit } from '@block-calendar/components/EventComposerSplit';
@@ -172,6 +173,7 @@ registerComponent(
() => <DriveRouteView />,
() => composableLayout(true)
);
+registerComponent('reviews', () => <ReviewsRouteView />);
registerComponent(
'tasks',
() => <TasksRouteView />,
diff --git a/apps/web/src/components/app/split-layout/split-router/app-middleware.ts b/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
index 3148ae1cf5..4db3d853fd 100644
--- a/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
+++ b/apps/web/src/components/app/split-layout/split-router/app-middleware.ts
@@ -68,7 +68,7 @@ function redirectLegacyRoutes(
if (route.matches[0].id === 'pr-detail') {
const { foreignEntityId } = routeParams(route);
if (typeof foreignEntityId === 'string') {
- return redirect(`/tasks/pr/${encodeURIComponent(foreignEntityId)}`);
+ return redirect(`/reviews/pr/${encodeURIComponent(foreignEntityId)}`);
}
}
if (route.matches[0].id !== 'legacy-content') return;
diff --git a/apps/web/src/components/app/split-layout/split-router/app-routes.ts b/apps/web/src/components/app/split-layout/split-router/app-routes.ts
index e02f02f7e2..9d2ada2f9d 100644
--- a/apps/web/src/components/app/split-layout/split-router/app-routes.ts
+++ b/apps/web/src/components/app/split-layout/split-router/app-routes.ts
@@ -22,6 +22,7 @@ import {
searchRoute,
} from '@app/features/next-soup/route';
import { remindersRoute } from '@app/features/reminders/route';
+import { reviewsSplitRoute } from '@app/features/reviews-view/route';
import { settingsRoute } from '@app/features/settings/route';
import { tasksSplitRoute } from '@app/features/tasks-view/route';
import { defineRoutes } from '@app/lib/split-router';
@@ -44,6 +45,7 @@ export const appSplitRoutes = defineRoutes({
agentsViewRoute,
emailSplitRoute,
tasksSplitRoute,
+ reviewsSplitRoute,
calendarSplitRoute,
channelsSplitRoute,
callsRoute,
diff --git a/apps/web/src/components/app/split-layout/splitRouterLayout.ts b/apps/web/src/components/app/split-layout/splitRouterLayout.ts
index ba4f5afc4a..1faeb11a1d 100644
--- a/apps/web/src/components/app/split-layout/splitRouterLayout.ts
+++ b/apps/web/src/components/app/split-layout/splitRouterLayout.ts
@@ -74,19 +74,28 @@ export function createAppSplitRouterLayout(
return {
snapshot,
- updateCurrentLocation(splitId, update) {
+ updateCurrentLocation(splitId, update, replace) {
const handle = manager.getSplit(splitId);
if (!handle) return;
const current = resolveContentLocation(routes, handle.content());
const next = update({ splitId, location: current });
+ const content = contentForLocation(next, handle.content());
+ const existing = handle.content();
+ if (existing.type !== content.type || existing.id !== content.id) {
+ handle.replace({ next: content, mergeHistory: replace });
+ return;
+ }
+
// Child routes keep the workspace mounted but can dispose its list.
// Capture list focus/scroll before committing that accepted transition.
if (!deepEqual(current.route, next.route)) {
handle.captureEntryState();
}
- handle.updateCurrentEntry((content) => contentForLocation(next, content));
+ handle.updateCurrentEntry((currentContent) =>
+ contentForLocation(next, currentContent)
+ );
},
open({ location, target, replace }) {
diff --git a/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts b/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
index 0bd8418a81..a0272d6b1d 100644
--- a/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
+++ b/apps/web/src/components/app/split-layout/tests/layoutManager.test.ts
@@ -7,13 +7,18 @@ import {
emailSplitRoute,
emailThreadRoute,
} from '@app/features/email-view/route';
+import { reviewsHostedContent } from '@app/features/reviews-view/reviews-hosted-content';
+import { reviewsSplitRoute } from '@app/features/reviews-view/route';
import {
getListNavigationSource,
listNavigationSourceId,
registerListNavigationSource,
withListNavigationSource,
} from '@app/features/soup/collection/list-navigation-source';
-import { taskDetailRoute } from '@app/features/tasks-view/route';
+import {
+ taskDetailRoute,
+ tasksSplitRoute,
+} from '@app/features/tasks-view/route';
import { createMemorySplitRouterLocation } from '@app/lib/split-router/integrations/memory';
import { createSplitRouter } from '@app/lib/split-router/router';
import { createRoutesManifest } from '@app/lib/split-router/routes';
@@ -36,12 +41,12 @@ import { createAppSplitRouterMiddleware } from '../split-router/app-middleware';
import { appSplitRoutes } from '../split-router/app-routes';
import { createAppSplitRouterLayout } from '../splitRouterLayout';
-// Settings navigation has its own route tests; avoid loading it through unrelated views.
-vi.mock('@core/constant/settingsSplitUrl', () => ({
- appendSettingsSplitToUrl: vi.fn(),
- settingsTabSlugFromUrl: vi.fn(),
- stripSettingsSplitFromUrl: vi.fn(),
+// Settings UI imports the app route registry and is unrelated to layout behavior.
+vi.mock('@core/constant/SettingsState', () => ({
+ useSettingsState: vi.fn(),
}));
+
+// The route graph imports websocket clients; jsdom cannot open their sockets.
vi.mock('@service-storage/websocket', () => ({
storageWS: { reconnectIfDisconnected: vi.fn() },
createWebSocketJob: vi.fn(),
@@ -895,59 +900,125 @@ describe('layoutManager', () => {
}
);
- it('opens PR details in Tasks and redirects legacy PR links', async () => {
- for (const path of ['/pr/pr-1', '/tasks/pr/pr-1']) {
+ it('opens the Reviews list on its own component route', async () => {
+ const { manager, location, router, dispose } = ingressRouter('/reviews');
+ await router.settled();
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'reviews',
+ });
+ expect(manager.splits()[0].mount.kind).toBe('component');
+ expect(router.route(manager.splits()[0].id)?.matches[0]?.id).toBe(
+ 'view-reviews'
+ );
+ expect(location.read().pathname).toBe('/reviews');
+ router.dispose();
+ dispose();
+ });
+ it('navigates from Tasks to Reviews and back in the same pane', async () => {
+ const { manager, location, router, dispose } = ingressRouter('/tasks');
+ await router.settled();
+ const splitId = manager.splits()[0].id;
+
+ router.navigate(splitId, { route: reviewsSplitRoute, params: {} });
+ await router.settled();
+ expect(manager.splits()[0].id).toBe(splitId);
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'reviews',
+ });
+ expect(location.read().pathname).toBe('/reviews');
+
+ router.navigate(splitId, { route: tasksSplitRoute, params: {} });
+ await router.settled();
+ expect(manager.splits()[0].id).toBe(splitId);
+ expect(manager.splits()[0].content).toMatchObject({
+ type: 'component',
+ id: 'tasks',
+ });
+ expect(location.read().pathname).toBe('/tasks');
+ router.dispose();
+ dispose();
+ });
+ it('opens PR details in Reviews and redirects older PR links', async () => {
+ for (const path of ['/pr/pr-1', '/reviews/pr/pr-1']) {
const { manager, location, router, dispose } = ingressRouter(path);
await router.settled();
const split = manager.splits()[0];
expect(split.content).toMatchObject({
type: 'component',
- id: 'tasks',
+ id: 'reviews',
});
expect(split.mount.kind).toBe('component');
expect(router.route(split.id)?.matches).toEqual([
- { id: 'view-tasks', params: {} },
- { id: 'tasks-pr', params: { foreignEntityId: 'pr-1' } },
+ { id: 'view-reviews', params: {} },
+ { id: 'reviews-pr', params: { foreignEntityId: 'pr-1' } },
]);
- expect(location.read().pathname).toBe('/tasks/pr/pr-1');
+ expect(location.read().pathname).toBe('/reviews/pr/pr-1');
router.dispose();
dispose();
}
});
- it('keeps PR details in Tasks on touch', async () => {
+ it('opens a Reviews PR in a new split without reusing the Reviews list', async () => {
+ const { manager, router, dispose } = ingressRouter('/reviews');
+ await router.settled();
+ const listSplit = manager.splits()[0];
+ const content = reviewsHostedContent({ type: 'pr', id: 'pr-1' });
+ if (!content) throw new Error('Expected hosted PR content');
+
+ const opened = manager.openWithSplit(content, {
+ handle: manager.getSplit(listSplit.id),
+ preferNewSplit: true,
+ allowDuplicate: true,
+ });
+ await router.settled();
+
+ expect(opened.status).toBe('opened');
+ expect(manager.splits()).toHaveLength(2);
+ expect(manager.splits()[0].id).toBe(listSplit.id);
+ if (opened.status === 'opened') {
+ expect(router.route(opened.split.id)?.matches.at(-1)).toEqual({
+ id: 'reviews-pr',
+ params: { foreignEntityId: 'pr-1' },
+ });
+ }
+ router.dispose();
+ dispose();
+ });
+ it('keeps PR details in Reviews on touch', async () => {
const { manager, location, router, dispose } = ingressRouter('/pr/pr-1', {
touch: true,
});
await router.settled();
expect(manager.splits()[0].content).toMatchObject({
type: 'component',
- id: 'tasks',
+ id: 'reviews',
});
expect(manager.splits()[0].mount.kind).toBe('component');
- expect(location.read().pathname).toBe('/tasks/pr/pr-1');
+ expect(location.read().pathname).toBe('/reviews/pr/pr-1');
router.dispose();
dispose();
});
- it('uses the Tasks PR route for existing split navigation', async () => {
+ it('uses the Reviews PR route for existing split navigation', async () => {
const { manager, location, router, dispose } = ingressRouter('/inbox');
await router.settled();
manager.getSplit(manager.splits()[0].id)!.replace({
next: { type: 'pr', id: 'pr-2' },
});
await router.settled();
- expect(location.read().pathname).toBe('/tasks/pr/pr-2');
+ expect(location.read().pathname).toBe('/reviews/pr/pr-2');
expect(manager.splits()[0].mount.kind).toBe('component');
expect(manager.splits()[0].content).toMatchObject({
type: 'component',
- id: 'tasks',
+ id: 'reviews',
});
router.dispose();
dispose();
});
- it('upgrades stored PR route metadata to Tasks content', async () => {
+ it('upgrades stored PR route metadata to Reviews content', async () => {
const { manager, router, dispose } = ingressRouter('/inbox');
await router.settled();
const split = manager.getSplit(manager.splits()[0].id)!;
@@ -967,9 +1038,9 @@ describe('layoutManager', () => {
await router.settled();
expect(split.content()).toMatchObject({
type: 'component',
- id: 'tasks',
+ id: 'reviews',
});
- expect(router.route(split.id)?.matches.at(-1)?.id).toBe('tasks-pr');
+ expect(router.route(split.id)?.matches.at(-1)?.id).toBe('reviews-pr');
router.dispose();
dispose();
});
diff --git a/apps/web/src/features/block-pr/data/queries.ts b/apps/web/src/features/block-pr/data/queries.ts
index 6495ff9085..7278ed0b77 100644
--- a/apps/web/src/features/block-pr/data/queries.ts
+++ b/apps/web/src/features/block-pr/data/queries.ts
@@ -102,19 +102,20 @@ function prForeignEntityDataFromForeignEntity(
});
}
+export function prForeignEntityQueryOptions(id: string) {
+ return {
+ queryKey: prForeignEntityQueryKey(id),
+ queryFn: async (): Promise<PrForeignEntityData> => {
+ const entity = await throwOnErr(() =>
+ storageServiceClient.getForeignEntity({ id })
+ );
+ return prForeignEntityDataFromForeignEntity(entity);
+ },
+ staleTime: PR_STALE_TIME,
+ retry: 1,
+ };
+}
+
export function usePrForeignEntityQuery(id: Accessor<string>) {
- return useQuery(() => {
- const currentId = id();
- return {
- queryKey: prForeignEntityQueryKey(currentId),
- queryFn: async (): Promise<PrForeignEntityData> => {
- const entity = await throwOnErr(() =>
- storageServiceClient.getForeignEntity({ id: currentId })
- );
- return prForeignEntityDataFromForeignEntity(entity);
- },
- staleTime: PR_STALE_TIME,
- retry: 1,
- };
- });
+ return useQuery(() => prForeignEntityQueryOptions(id()));
}
diff --git a/apps/web/src/features/command/FavoritesCommands.tsx b/apps/web/src/features/command/FavoritesCommands.tsx
index 15e6939637..6859cadde4 100644
--- a/apps/web/src/features/command/FavoritesCommands.tsx
+++ b/apps/web/src/features/command/FavoritesCommands.tsx
@@ -39,6 +39,7 @@ export function FavoritesCommands() {
const openFavorite = (favorite: Favorite) => {
const result = openWithSplit(favoriteSplitContent(favorite), {
referredFrom: 'kommand-menu',
+ allowDuplicate: favorite.entityType === 'foreign_entity',
});
if (result.status === 'reused' && result.owner !== result.sourceOwner) {
toast.alert('Content already open');
diff --git a/apps/web/src/features/entity/composed/ListEntity.tsx b/apps/web/src/features/entity/composed/ListEntity.tsx
index 3465a89bea..3c4218859f 100644
--- a/apps/web/src/features/entity/composed/ListEntity.tsx
+++ b/apps/web/src/features/entity/composed/ListEntity.tsx
@@ -148,6 +148,7 @@ export function ListEntity(props: ListEntityProps) {
const layoutProps = (): LayoutProps => ({
entity: props.entity,
+ authorDisplayName: props.authorDisplayName,
checked: props.checked,
hideCheckbox: props.hideCheckbox,
onChecked: props.onChecked,
diff --git a/apps/web/src/features/entity/composed/list-entity/foreign.tsx b/apps/web/src/features/entity/composed/list-entity/foreign.tsx
index d4aeb7d54c..d4eb1eeb49 100644
--- a/apps/web/src/features/entity/composed/list-entity/foreign.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/foreign.tsx
@@ -22,11 +22,13 @@ import type { GithubPullRequestEntity } from '../../types/entity';
type PillProps = {
children: JSX.Element;
class?: string;
+ title?: string;
};
function Pill(props: PillProps) {
return (
<span
+ title={props.title}
class={cn(
'min-w-0 rounded-full inline-flex items-center gap-1 px-1.5 py-1 leading-tight text-xs font-medium border border-edge bg-surface/50',
props.class
@@ -417,8 +419,44 @@ export function GithubPullRequestChecksIndicator(props: {
);
}
+export function GithubAuthorBadge(props: {
+ entity: GithubPullRequestEntity;
+ displayName?: string;
+}) {
+ const login = () =>
+ props.entity.metadata.authorLogin?.replace(/\[bot\]$/, '');
+ const name = () => props.displayName || login() || 'GitHub user';
+ const avatarUrl = () => {
+ const id = props.entity.metadata.authorId;
+ if (id !== undefined)
+ return `https://avatars.githubusercontent.com/u/${id}?s=48&v=4`;
+ const githubLogin = login();
+ return githubLogin
+ ? `https://github.com/${encodeURIComponent(githubLogin)}.png?size=48`
+ : undefined;
+ };
+ return (
+ <span
+ class="inline-flex min-w-0 items-center gap-1.5"
+ title={`Authored by ${name()}`}
+ >
+ <Show when={avatarUrl()}>
+ {(url) => (
+ <img
+ src={url()}
+ alt=""
+ loading="lazy"
+ class="size-4 shrink-0 rounded-full"
+ />
+ )}
+ </Show>
+ <span class="min-w-0 truncate">{name()}</span>
+ </span>
+ );
+}
export function GithubPullRequestPills(props: {
entity: GithubPullRequestEntity;
+ authorDisplayName?: string;
}) {
const additions = () => props.entity.metadata.additions;
const deletions = () => props.entity.metadata.deletions;
@@ -427,6 +465,18 @@ export function GithubPullRequestPills(props: {
return (
<>
+ <Show
+ when={
+ props.entity.metadata.authorLogin || props.entity.metadata.authorId
+ }
+ >
+ <Pill class="max-w-32 text-ink-muted">
+ <GithubAuthorBadge
+ entity={props.entity}
+ displayName={props.authorDisplayName}
+ />
+ </Pill>
+ </Show>
<Pill class="tabular-nums">
<span
class={cn(
diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
index 4eb0fa2ba4..8d9255e0f8 100644
--- a/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/narrow-layout.tsx
@@ -5,6 +5,7 @@ import {
isChannelEntity,
isChannelMessageEntity,
isEmailEntity,
+ isGithubPrEntity,
isTaskEntity,
} from '../../types/entity';
import { isSearchEntity } from '../../types/search';
@@ -14,10 +15,17 @@ import {
ChannelMessageSingleLine,
} from './channel';
import { EmailInboxChip } from './email';
+import { GithubAuthorBadge } from './foreign';
import { SOUP_ROW_CLASS } from './row-geometry';
import { type LayoutProps, RowIndicator } from './shared';
export function NarrowLayout(props: LayoutProps) {
+ const reviewWithAuthor = () => {
+ const entity = props.entity;
+ if (!isGithubPrEntity(entity)) return;
+ if (!entity.metadata.authorLogin && !entity.metadata.authorId) return;
+ return entity;
+ };
return (
<Entity.Layout
class={cn(
@@ -53,6 +61,16 @@ export function NarrowLayout(props: LayoutProps) {
>
{(entity) => <ChannelMessageSingleLine entity={entity()} />}
</Show>
+ <Show when={reviewWithAuthor()}>
+ {(review) => (
+ <span class="max-w-32 shrink-0 overflow-hidden text-xs font-normal text-ink-muted">
+ <GithubAuthorBadge
+ entity={review()}
+ displayName={props.authorDisplayName}
+ />
+ </span>
+ )}
+ </Show>
<Show when={isEmailEntity(props.entity) && props.entity}>
{(entity) => <EmailInboxChip entity={entity()} class="ml-auto" />}
</Show>
diff --git a/apps/web/src/features/entity/composed/list-entity/shared.tsx b/apps/web/src/features/entity/composed/list-entity/shared.tsx
index 5e14646772..47a1a1af3b 100644
--- a/apps/web/src/features/entity/composed/list-entity/shared.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/shared.tsx
@@ -29,6 +29,8 @@ export interface BaseListEntityProps<E extends EntityData = EntityData> {
highlighted?: boolean;
hovered?: boolean;
hideContentHits?: boolean;
+ /** Resolved app display name for a linked GitHub PR author, when available. */
+ authorDisplayName?: string;
/** Opt-in by the data-owning view; keep nonessential setup off initial render. */
deferInteractions?: boolean;
/** Hide the multi-select checkbox (e.g. read-only embeds outside soup). */
@@ -57,6 +59,7 @@ const WIDE_BREAKPOINT = 512; // @lg container query = 32rem
export interface LayoutProps {
entity: WithNotification<EntityData>;
checked?: boolean;
+ authorDisplayName?: string;
hideCheckbox?: boolean;
onChecked?: (checked: boolean, shiftKey: boolean) => void;
unread: boolean;
diff --git a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
index 09251cda98..aaba5d9627 100644
--- a/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
+++ b/apps/web/src/features/entity/composed/list-entity/wide-layout.tsx
@@ -243,7 +243,12 @@ export function WideLayout(props: LayoutProps) {
<SharedBadge ownerId={props.entity.ownerId} />
</Show>
<Show when={isGithubPrEntity(props.entity) && props.entity}>
- {(entity) => <GithubPullRequestPills entity={entity()} />}
+ {(entity) => (
+ <GithubPullRequestPills
+ entity={entity()}
+ authorDisplayName={props.authorDisplayName}
+ />
+ )}
</Show>
<Show when={isCallEntity(props.entity) && props.entity}>
{(entity) => (
diff --git a/apps/web/src/features/favorites/FavoriteContextMenu.tsx b/apps/web/src/features/favorites/FavoriteContextMenu.tsx
index b7512e4ec1..950a44de40 100644
--- a/apps/web/src/features/favorites/FavoriteContextMenu.tsx
+++ b/apps/web/src/features/favorites/FavoriteContextMenu.tsx
@@ -30,6 +30,7 @@ export function FavoriteContextMenu(props: FavoriteContextMenuProps) {
referredFrom: 'sidebar',
activate: true,
preferNewSplit,
+ allowDuplicate: props.favorite.entityType === 'foreign_entity',
}).split;
globalSplitManager()?.returnFocus();
return split;
diff --git a/apps/web/src/features/favorites/sidebar/favorites-section.tsx b/apps/web/src/features/favorites/sidebar/favorites-section.tsx
index 2148106bd1..05fd4d73ed 100644
--- a/apps/web/src/features/favorites/sidebar/favorites-section.tsx
+++ b/apps/web/src/features/favorites/sidebar/favorites-section.tsx
@@ -398,6 +398,7 @@ const FavoriteRow = (props: {
referredFrom: 'sidebar',
activate: true,
preferNewSplit,
+ allowDuplicate: props.favorite.entityType === 'foreign_entity',
});
if (result.status === 'reused' && result.owner !== result.sourceOwner) {
toast.alert('Content already open');
diff --git a/apps/web/src/features/next-soup/actions/make-copy-link-action.ts b/apps/web/src/features/next-soup/actions/make-copy-link-action.ts
index ffcadf681d..eb0a0c9e4d 100644
--- a/apps/web/src/features/next-soup/actions/make-copy-link-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-copy-link-action.ts
@@ -41,8 +41,12 @@ const getEntityUrlParams = (
};
const getEntityUrl = (entity: EntityData): string => {
- // TODO(dev-rb/github): Return the Macro /pr/:id URL.
- if (isGithubPrEntity(entity)) return entity.metadata.url;
+ if (isGithubPrEntity(entity)) {
+ return buildSimpleEntityUrl({
+ type: 'reviews/pr',
+ id: encodeURIComponent(entity.id),
+ });
+ }
return buildSimpleEntityUrl(
{
diff --git a/apps/web/src/features/next-soup/actions/make-favorite-action.ts b/apps/web/src/features/next-soup/actions/make-favorite-action.ts
index 84917c09f0..7a577752e5 100644
--- a/apps/web/src/features/next-soup/actions/make-favorite-action.ts
+++ b/apps/web/src/features/next-soup/actions/make-favorite-action.ts
@@ -23,6 +23,8 @@ export const makeFavoriteAction = () => {
const removeMutation = useRemoveFavoriteMutation();
const canExecute = (entity: EntityData): boolean =>
+ (entity.type !== 'foreign' ||
+ entity.foreignSource === 'github_pull_request') &&
favoriteEntityType(entity.type) !== undefined;
const isFavorited = (entity: EntityData): boolean => {
diff --git a/apps/web/src/features/next-soup/utils.test.ts b/apps/web/src/features/next-soup/utils.test.ts
index 5c3ba802d0..4805d6d52a 100644
--- a/apps/web/src/features/next-soup/utils.test.ts
+++ b/apps/web/src/features/next-soup/utils.test.ts
@@ -675,7 +675,7 @@ describe('calendar view navigation', () => {
});
describe('Hosted details and Drive document routing', () => {
- it('opens GitHub pull requests as Tasks-hosted content', async () => {
+ it('opens GitHub pull requests as Reviews-hosted content', async () => {
const openWithSplit = vi.fn(() => ({ status: 'unavailable' }));
setGlobalSplitManager({
activeSplit: vi.fn(),
@@ -695,12 +695,12 @@ describe('Hosted details and Drive document routing', () => {
expect(openWithSplit).toHaveBeenCalledWith(
{
type: 'component',
- id: 'tasks',
+ id: 'reviews',
entryMetadata: {
route: {
matches: [
- { id: 'view-tasks', params: {} },
- { id: 'tasks-pr', params: { foreignEntityId: 'pr-1' } },
+ { id: 'view-reviews', params: {} },
+ { id: 'reviews-pr', params: { foreignEntityId: 'pr-1' } },
],
},
},
diff --git a/apps/web/src/features/next-soup/utils.ts b/apps/web/src/features/next-soup/utils.ts
index cf64b69f90..c31d21b9b1 100644
--- a/apps/web/src/features/next-soup/utils.ts
+++ b/apps/web/src/features/next-soup/utils.ts
@@ -15,13 +15,13 @@ import {
} from '@app/features/calendar-view/types';
import { driveHostedContent } from '@app/features/drive-view/drive-hosted-content';
import { URL_PARAMS as EMAIL_PARAMS } from '@app/features/email-thread/core/location';
+import { reviewsHostedContent } from '@app/features/reviews-view/reviews-hosted-content';
import { withListNavigationSource } from '@app/features/soup/collection/list-navigation-source';
import {
type EntityWithRawNotifications,
getEntityNotifications,
scopeChannelNotificationsForEntity,
} from '@app/features/soup/entity-notifications';
-import { tasksHostedContent } from '@app/features/tasks-view/tasks-hosted-content';
import { isRecord } from '@app/lib/split-router/utils';
import { globalSplitManager } from '@app/signal/splitLayout';
import { CALENDAR_BLOCK_ID } from '@block-calendar/types';
@@ -714,7 +714,7 @@ export const openEntityInSplitFromUnifiedList = async (
if (USE_MACRO_PR_SUMMARY_BLOCK) {
const content = { type: 'pr' as const, id: entity.id };
const result = splitManager.openWithSplit(
- tasksHostedContent(content) ?? content,
+ reviewsHostedContent(content) ?? content,
{
referredFrom: options.referredFrom,
activate: true,
@@ -803,7 +803,7 @@ export const openEntityInSplitFromUnifiedList = async (
// Construct hosted content before opening the split so details do not mount
// legacy blocks. Comment targets keep their document block.
const hostedContent =
- tasksHostedContent(content) ??
+ reviewsHostedContent(content) ??
driveHostedContent(content, {
allowDocuments: !isTouchDevice() && !commentParams,
});
diff --git a/apps/web/src/features/reviews-view/components/ReviewsControls.tsx b/apps/web/src/features/reviews-view/components/ReviewsControls.tsx
new file mode 100644
index 0000000000..7df4ff8742
--- /dev/null
+++ b/apps/web/src/features/reviews-view/components/ReviewsControls.tsx
@@ -0,0 +1,199 @@
+import {
+ type ListControlOption,
+ ListFilterDropdown,
+ type ListFilterGroup,
+ ListSortDropdown,
+ MobileFilterDrawer,
+ useViewControlHotkeys,
+} from '@app/components/view-shell';
+import { MobileDrawer } from '@components/app/mobile/MobileDrawer';
+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
+import { Accordion } from '@kobalte/core/accordion';
+import { createSignal, For, Show } from 'solid-js';
+import type { ReviewsSortId } from '../reviews-types';
+
+export type ReviewsFilterId = 'repository' | 'author';
+
+export type ReviewsControlProps = {
+ sort: ReviewsSortId;
+ onSortChange: (sort: ReviewsSortId) => void;
+ repositories: ListControlOption<string>[];
+ authors: ListControlOption<string>[];
+ selectedRepositories: readonly string[];
+ selectedAuthors: readonly string[];
+ onFilterChange: (
+ group: ReviewsFilterId,
+ id: string,
+ selected: boolean
+ ) => void;
+ onClearFilters: () => void;
+};
+
+const SORT_OPTIONS: ListControlOption<ReviewsSortId>[] = [
+ { id: 'updated_at', label: 'Updated' },
+ { id: 'created_at', label: 'Created' },
+];
+
+function filterGroups(
+ props: ReviewsControlProps
+): ListFilterGroup<ReviewsFilterId, string>[] {
+ return [
+ {
+ id: 'repository',
+ label: 'Repository',
+ options: props.repositories,
+ searchPlaceholder: 'Search repositories',
+ },
+ {
+ id: 'author',
+ label: 'Author',
+ options: props.authors,
+ searchPlaceholder: 'Search authors',
+ },
+ ];
+}
+
+function isSelected(
+ props: ReviewsControlProps,
+ group: ReviewsFilterId,
+ id: string
+) {
+ return (
+ group === 'repository' ? props.selectedRepositories : props.selectedAuthors
+ ).includes(id);
+}
+
+export function ReviewsControls(props: ReviewsControlProps) {
+ const panel = useSplitPanelOrThrow();
+ const [openMenu, setOpenMenu] = createSignal<'filters' | 'sort'>();
+ let filterTrigger: HTMLButtonElement | undefined;
+ let sortTrigger: HTMLButtonElement | undefined;
+
+ const handleMenuOpenChange =
+ (menu: 'filters' | 'sort') => (open: boolean) => {
+ setOpenMenu((current) =>
+ open ? menu : current === menu ? undefined : current
+ );
+ };
+
+ useViewControlHotkeys({
+ scopeId: panel.splitHotkeyScope,
+ enabled: panel.isPanelActive,
+ filter: {
+ description: 'Filter pull requests',
+ run: () => {
+ if (!filterTrigger) return false;
+ setOpenMenu('filters');
+ return true;
+ },
+ },
+ sort: {
+ description: 'Sort pull requests',
+ run: () => {
+ if (!sortTrigger) return false;
+ setOpenMenu('sort');
+ return true;
+ },
+ },
+ });
+
+ const activeCount = () =>
+ props.selectedRepositories.length + props.selectedAuthors.length;
+
+ return (
+ <div class="flex min-w-0 shrink-0 items-center justify-end gap-2 @max-[720px]/view-shell:gap-1">
+ <ListSortDropdown
+ label="Sort pull requests"
+ value={props.sort}
+ options={SORT_OPTIONS}
+ open={openMenu() === 'sort'}
+ onChange={props.onSortChange}
+ onOpenChange={handleMenuOpenChange('sort')}
+ triggerRef={(element) => (sortTrigger = element)}
+ />
+ <div class="relative shrink-0">
+ <ListFilterDropdown
+ label="Filter pull requests"
+ groups={filterGroups(props)}
+ open={openMenu() === 'filters'}
+ onOpenChange={handleMenuOpenChange('filters')}
+ triggerRef={(element) => (filterTrigger = element)}
+ isSelected={(group, id) => isSelected(props, group, id)}
+ onSelectionChange={props.onFilterChange}
+ onClear={props.onClearFilters}
+ />
+ <Show when={activeCount() > 0}>
+ <span class="pointer-events-none absolute -top-0.5 right-0 z-10 flex size-4 translate-x-1/2 items-center justify-center rounded-full bg-accent text-xxs font-medium leading-none text-surface">
+ {activeCount()}
+ </span>
+ </Show>
+ </div>
+ </div>
+ );
+}
+
+export function ReviewsFilterDrawer(props: ReviewsControlProps) {
+ const groups = () => filterGroups(props);
+ const activeCount = () =>
+ props.selectedRepositories.length + props.selectedAuthors.length;
+
+ return (
+ <MobileFilterDrawer
+ triggerLabel="Open pull request filters"
+ label="Pull request list controls"
+ activeCount={activeCount()}
+ onClear={props.onClearFilters}
+ >
+ <MobileDrawer.Label id="reviews-sort-label" class="pt-4">
+ Sort
+ </MobileDrawer.Label>
+ <MobileDrawer.Section
+ role="radiogroup"
+ aria-labelledby="reviews-sort-label"
+ >
+ <For each={SORT_OPTIONS}>
+ {(option) => (
+ <MobileFilterDrawer.Option
+ selectionMode="single"
+ checked={props.sort === option.id}
+ onChange={() => props.onSortChange(option.id)}
+ >
+ {option.label}
+ </MobileFilterDrawer.Option>
+ )}
+ </For>
+ </MobileDrawer.Section>
+ <MobileDrawer.Label class="pt-4">Filters</MobileDrawer.Label>
+ <Accordion multiple collapsible defaultValue={['repository']}>
+ <div class="flex flex-col gap-3">
+ <For each={groups()}>
+ {(group) => (
+ <MobileFilterDrawer.Section
+ value={group.id}
+ label={group.label}
+ activeCount={
+ group.options.filter((option) =>
+ isSelected(props, group.id, option.id)
+ ).length
+ }
+ >
+ <For each={group.options}>
+ {(option) => (
+ <MobileFilterDrawer.Option
+ checked={isSelected(props, group.id, option.id)}
+ onChange={(selected) =>
+ props.onFilterChange(group.id, option.id, selected)
+ }
+ >
+ {option.label}
+ </MobileFilterDrawer.Option>
+ )}
+ </For>
+ </MobileFilterDrawer.Section>
+ )}
+ </For>
+ </div>
+ </Accordion>
+ </MobileFilterDrawer>
+ );
+}
diff --git a/apps/web/src/features/reviews-view/components/ReviewsEmptyState.tsx b/apps/web/src/features/reviews-view/components/ReviewsEmptyState.tsx
new file mode 100644
index 0000000000..f0c9a4c6ae
--- /dev/null
+++ b/apps/web/src/features/reviews-view/components/ReviewsEmptyState.tsx
@@ -0,0 +1,117 @@
+import EmptyStateNoFilterMatchGraphic from '@design/empty-state-no-filter-match.svg';
+import EmptyStateNoSearchMatchGraphic from '@design/empty-state-no-search-match.svg';
+import GitPullRequestIcon from '@phosphor/git-pull-request.svg';
+import type { GithubLinkStatus } from '@queries/auth/github-link';
+import { EmptyStatePanel } from '@ui';
+import { Match, Switch } from 'solid-js';
+import { match } from 'ts-pattern';
+import type { ReviewsScope } from '../reviews-types';
+
+export function ReviewsEmptyState(props: {
+ scope: ReviewsScope;
+ search: string;
+ hasFilters: boolean;
+ hasAuthorIdentity: boolean;
+ githubAccountStatus?: GithubLinkStatus | 'error';
+ onClearSearch: () => void;
+ onClearFilters: () => void;
+}) {
+ const identityCopy = () => {
+ const subject =
+ props.scope === 'involving'
+ ? 'pull requests involving you'
+ : 'pull requests you authored';
+ return match(props.githubAccountStatus)
+ .with('linked', () => ({
+ title: 'GitHub account details unavailable',
+ description: `We could not identify your linked account to find ${subject}. Try again later.`,
+ }))
+ .with('reauthentication_required', () => ({
+ title: 'Reconnect your GitHub account',
+ description: `Your GitHub link has expired. Reconnect to see ${subject}.`,
+ }))
+ .with('error', () => ({
+ title: 'Could not check your GitHub account',
+ description: `Try again later to see ${subject}.`,
+ }))
+ .otherwise(() => ({
+ title: 'Connect your GitHub account',
+ description: `Link GitHub to see ${subject}.`,
+ }));
+ };
+
+ return (
+ <Switch>
+ <Match when={props.scope === 'authored' && !props.hasAuthorIdentity}>
+ <EmptyStatePanel
+ centered
+ graphic={GitPullRequestIcon}
+ title={identityCopy().title}
+ description={identityCopy().description}
+ />
+ </Match>
+ <Match
+ when={
+ props.scope === 'involving' &&
+ props.githubAccountStatus &&
+ props.githubAccountStatus !== 'linked'
+ }
+ >
+ <EmptyStatePanel
+ centered
+ graphic={GitPullRequestIcon}
+ title={identityCopy().title}
+ description={identityCopy().description}
+ />
+ </Match>
+ <Match when={props.search.trim()}>
+ <EmptyStatePanel
+ centered
+ graphic={EmptyStateNoSearchMatchGraphic}
+ title={`No results for "${props.search.trim()}"`}
+ description="Try another pull request title, repository, number, or author."
+ primaryAction={{
+ label: 'Clear search',
+ onClick: props.onClearSearch,
+ }}
+ />
+ </Match>
+ <Match when={props.hasFilters}>
+ <EmptyStatePanel
+ centered
+ graphic={EmptyStateNoFilterMatchGraphic}
+ title="No pull requests match these filters"
+ description="Try another repository or author, or clear your filters."
+ primaryAction={{
+ label: 'Clear filters',
+ onClick: props.onClearFilters,
+ }}
+ />
+ </Match>
+ <Match when={props.scope === 'involving'}>
+ <EmptyStatePanel
+ centered
+ graphic={GitPullRequestIcon}
+ title="No pull requests involving you"
+ description="Pull requests you authored, were assigned or asked to review, or participated in will appear here."
+ />
+ </Match>
+ <Match when={props.scope === 'authored'}>
+ <EmptyStatePanel
+ centered
+ graphic={GitPullRequestIcon}
+ title="No pull requests authored by you"
+ description="Pull requests you authored and can access in Macro will appear here."
+ />
+ </Match>
+ <Match when={true}>
+ <EmptyStatePanel
+ centered
+ graphic={GitPullRequestIcon}
+ title="No pull requests yet"
+ description="GitHub pull requests accessible in your workspace will appear here."
+ />
+ </Match>
+ </Switch>
+ );
+}
diff --git a/apps/web/src/features/reviews-view/components/ReviewsList.tsx b/apps/web/src/features/reviews-view/components/ReviewsList.tsx
new file mode 100644
index 0000000000..9a9b287850
--- /dev/null
+++ b/apps/web/src/features/reviews-view/components/ReviewsList.tsx
@@ -0,0 +1,448 @@
+import { useListInteractions } from '@app/components/list';
+import {
+ makeCopyLinkAction,
+ makeFavoriteAction,
+ toEntityActionListState,
+ useEntityActionHotkeys,
+} from '@app/features/next-soup/actions';
+import { globalSplitManager } from '@app/signal/splitLayout';
+import { useInfiniteScrollSentinel } from '@companies/Company/use-infinite-scroll-sentinel';
+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
+import { ContextMenuContent, MenuItem } from '@core/component/ContextMenu';
+import {
+ EntitySelectionToolbar,
+ type GithubPullRequestEntity,
+ ListEntity,
+ ListLayoutProvider,
+} from '@entity';
+import { ContextMenu } from '@kobalte/core/context-menu';
+import ArrowSquareOutIcon from '@phosphor/arrow-square-out.svg';
+import SplitIcon from '@phosphor/columns.svg';
+import CopyIcon from '@phosphor/copy.svg';
+import SpinnerIcon from '@phosphor/spinner.svg';
+import StarIcon from '@phosphor/star.svg';
+import type { GithubLinkStatus } from '@queries/auth/github-link';
+import { createElementSize } from '@solid-primitives/resize-observer';
+import { Button } from '@ui';
+import {
+ createEffect,
+ createSignal,
+ type JSX,
+ Match,
+ onCleanup,
+ Show,
+ Suspense,
+ Switch,
+} from 'solid-js';
+import { Virtualizer, type VirtualizerHandle } from 'virtua/solid';
+import type { ReviewsListController } from '../primitives/create-reviews-list-controller';
+import type { useReviewsQuery } from '../queries/use-reviews-query';
+import { isAuthoredBy } from '../reviews-filter';
+import type { ReviewsScope } from '../reviews-types';
+import { ReviewsEmptyState } from './ReviewsEmptyState';
+
+export type ReviewsListProps = {
+ list: ReviewsListController;
+ source: ReturnType<typeof useReviewsQuery>;
+ scope: ReviewsScope;
+ authorLogin?: string;
+ authorId?: string;
+ viewerName?: string;
+ githubIdentityLoading: boolean;
+ githubAccountStatus?: GithubLinkStatus | 'error';
+ search: string;
+ selectedRepositories: readonly string[];
+ selectedAuthors: readonly string[];
+ onClearSearch: () => void;
+ onClearFilters: () => void;
+ onOpen: (foreignEntityId: string, newSplit: boolean) => void;
+};
+
+const copyLink = makeCopyLinkAction();
+
+function ReviewListElement(props: JSX.HTMLAttributes<HTMLUListElement>) {
+ return <ul {...props} aria-label="Pull requests" />;
+}
+
+function ReviewRow(props: {
+ review: GithubPullRequestEntity;
+ authorDisplayName?: string;
+ checked: boolean;
+ onChecked: (checked: boolean, shiftKey: boolean) => void;
+ favoriteAction: ReturnType<typeof makeFavoriteAction>;
+ onOpen: ReviewsListProps['onOpen'];
+ onActivate: (newSplit: boolean) => void;
+ onClick: (event: MouseEvent) => void;
+ onFocus: () => void;
+}) {
+ return (
+ <ContextMenu>
+ <ContextMenu.Trigger
+ as="div"
+ class="w-full outline-none focus-visible:ring-2 focus-visible:ring-accent"
+ role="button"
+ tabIndex={0}
+ aria-label={`${props.review.metadata.name}, ${props.review.metadata.owner}/${props.review.metadata.repo}`}
+ onFocusIn={props.onFocus}
+ onKeyDown={(event) => {
+ if (event.target !== event.currentTarget) return;
+ if (event.key !== 'Enter' && event.key !== ' ') return;
+ event.preventDefault();
+ props.onActivate(event.shiftKey);
+ }}
+ >
+ <ListEntity
+ entity={props.review}
+ authorDisplayName={props.authorDisplayName}
+ checked={props.checked}
+ onChecked={props.onChecked}
+ onClick={props.onClick}
+ />
+ </ContextMenu.Trigger>
+ <ContextMenu.Portal>
+ <ContextMenuContent class="w-56 text-xs text-ink-muted">
+ <MenuItem
+ icon={SplitIcon}
+ text="Open in new split"
+ disabled={!globalSplitManager()?.canAppendSplit()}
+ onClick={() => {
+ if (globalSplitManager()?.canAppendSplit())
+ props.onOpen(props.review.id, true);
+ }}
+ />
+ <MenuItem
+ icon={StarIcon}
+ text={
+ props.favoriteAction.isFavorited(props.review)
+ ? 'Remove from favorites'
+ : 'Add to favorites'
+ }
+ onClick={() => void props.favoriteAction.execute([props.review])}
+ />
+ <MenuItem
+ icon={CopyIcon}
+ text="Copy link"
+ onClick={() => void copyLink.execute([props.review])}
+ />
+ <MenuItem
+ icon={ArrowSquareOutIcon}
+ text="Open on GitHub"
+ onClick={() =>
+ window.open(
+ props.review.metadata.url,
+ '_blank',
+ 'noopener,noreferrer'
+ )
+ }
+ />
+ </ContextMenuContent>
+ </ContextMenu.Portal>
+ </ContextMenu>
+ );
+}
+
+export function ReviewsList(props: ReviewsListProps) {
+ const panel = useSplitPanelOrThrow();
+ const favoriteAction = makeFavoriteAction();
+ const source = props.source;
+ const list = props.list;
+ const reviews = list.items.all;
+ const selectedReviews = list.selection.items;
+ const missingIdentity = () =>
+ props.scope === 'authored' && !props.authorLogin && !props.authorId;
+ const [listElement, setListElement] = createSignal<HTMLDivElement>();
+ const [sentinel, setSentinel] = createSignal<HTMLDivElement>();
+ const listSize = createElementSize(listElement);
+ const [virtualizer, setVirtualizer] = createSignal<VirtualizerHandle>();
+ const listInteractions = useListInteractions({
+ controller: list,
+ scopeId: panel.splitHotkeyScope,
+ enabled: panel.isPanelActive,
+ scrollHandle: virtualizer,
+ activation: {
+ createMetadata: (intent) => ({ newSplit: intent === 'alternate' }),
+ alternateDescription: 'Open in new split',
+ },
+ });
+ const actionState = toEntityActionListState({
+ controller: list,
+ getEntity: (review) => review,
+ onFocus: (target) => {
+ if (target)
+ virtualizer()?.scrollToIndex(target.index, { align: 'nearest' });
+ listElement()?.focus();
+ },
+ });
+ useEntityActionHotkeys({
+ scopeId: panel.splitHotkeyScope,
+ list: actionState,
+ selectedEntities: list.selection.items,
+ focusedEntity: list.focus.item,
+ restoreFocus: () => listElement()?.focus(),
+ viewContext: () => ({ supportsMarkDone: false, senderBucket: undefined }),
+ splitHandle: panel.handle,
+ condition: panel.isPanelActive,
+ });
+ let active = true;
+ onCleanup(() => (active = false));
+ let loadingNextPage = false;
+ const loadMore = async () => {
+ if (loadingNextPage || source.isLoadingMore() || !source.hasMore()) return;
+ loadingNextPage = true;
+ try {
+ await source.loadMore();
+ } catch {
+ // The query owns the page error and exposes a manual retry below the list.
+ } finally {
+ loadingNextPage = false;
+ }
+ };
+ const checkNearEnd = () => {
+ const element = listElement();
+ if (
+ !active ||
+ !element ||
+ missingIdentity() ||
+ source.isLoading() ||
+ source.isLoadingMore() ||
+ source.pageError() ||
+ !source.hasMore() ||
+ (props.scope === 'authored' && props.githubIdentityLoading)
+ )
+ return;
+ if (element.scrollHeight - element.scrollTop - element.clientHeight < 320)
+ void loadMore();
+ };
+
+ useInfiniteScrollSentinel({
+ sentinel,
+ hasNextPage: () =>
+ source.hasMore() && !source.pageError() && !missingIdentity(),
+ isFetchingNextPage: source.isLoadingMore,
+ fetchNextPage: () => void loadMore(),
+ rootMargin: '320px',
+ });
+
+ // The visible rows can be sparser than the fetched pages after local filters.
+ // Measure the scroll area after rendering each page and keep fetching until
+ // the viewport fills, a result is reachable, or pagination ends.
+ createEffect(() => {
+ reviews().length;
+ listSize.height;
+ source.isLoadingMore();
+ source.hasMore();
+ source.pageError();
+ listElement();
+ queueMicrotask(checkNearEnd);
+ });
+
+ return (
+ <section aria-label="Reviews" class="flex size-full min-h-0 flex-col">
+ <Suspense
+ fallback={
+ <div
+ role="status"
+ class="grid flex-1 place-items-center text-ink-muted"
+ >
+ <SpinnerIcon
+ aria-label="Loading reviews"
+ class="size-5 animate-spin"
+ />
+ </div>
+ }
+ >
+ <Switch>
+ <Match
+ when={
+ source.isLoading() ||
+ (props.scope === 'authored' && props.githubIdentityLoading)
+ }
+ >
+ <div
+ role="status"
+ class="grid flex-1 place-items-center text-ink-muted"
+ >
+ <SpinnerIcon
+ aria-label="Loading reviews"
+ class="size-5 animate-spin"
+ />
+ </div>
+ </Match>
+ <Match when={source.error()}>
+ <div
+ role="alert"
+ class="flex flex-1 flex-col items-center justify-center gap-3 text-sm text-ink-muted"
+ >
+ <span>Reviews couldn’t be loaded.</span>
+ <Button
+ variant="outline"
+ size="sm"
+ onClick={() => void source.retry()}
+ >
+ Try again
+ </Button>
+ </div>
+ </Match>
+ <Match when={true}>
+ <div
+ ref={setListElement}
+ role="group"
+ aria-label="Pull requests"
+ tabIndex={0}
+ class="min-h-0 flex-1 overflow-auto"
+ >
+ <Show
+ when={reviews().length > 0}
+ fallback={
+ <Show
+ when={
+ source.hasMore() &&
+ !source.pageError() &&
+ !missingIdentity()
+ }
+ fallback={
+ <Show
+ when={source.pageError() && !missingIdentity()}
+ fallback={
+ <ReviewsEmptyState
+ scope={props.scope}
+ search={props.search}
+ hasFilters={
+ props.selectedRepositories.length > 0 ||
+ props.selectedAuthors.length > 0
+ }
+ hasAuthorIdentity={Boolean(
+ props.authorLogin || props.authorId
+ )}
+ githubAccountStatus={props.githubAccountStatus}
+ onClearSearch={props.onClearSearch}
+ onClearFilters={props.onClearFilters}
+ />
+ }
+ >
+ <div
+ role="alert"
+ class="grid min-h-32 place-items-center text-sm text-ink-muted"
+ >
+ More pull requests couldn’t be loaded. Retry below.
+ </div>
+ </Show>
+ }
+ >
+ <div
+ role="status"
+ class="grid min-h-32 place-items-center text-sm text-ink-muted"
+ >
+ Searching more pull requests…
+ </div>
+ </Show>
+ }
+ >
+ <ListLayoutProvider ref={listElement}>
+ <Virtualizer
+ as={ReviewListElement}
+ item="li"
+ data={reviews()}
+ scrollRef={listElement()}
+ ref={setVirtualizer}
+ keepMounted={
+ list.focus.index() >= 0 ? [list.focus.index()] : undefined
+ }
+ bufferSize={320}
+ itemSize={48}
+ onScroll={checkNearEnd}
+ >
+ {(review) => (
+ <ReviewRow
+ review={review}
+ checked={list.selection.isSelected(review.id)}
+ authorDisplayName={
+ isAuthoredBy(
+ review,
+ props.authorLogin,
+ props.authorId
+ )
+ ? props.viewerName
+ : undefined
+ }
+ favoriteAction={favoriteAction}
+ onOpen={props.onOpen}
+ onChecked={(checked, shiftKey) =>
+ listInteractions.selection.set(review.id, checked, {
+ range: shiftKey,
+ })
+ }
+ onFocus={() =>
+ list.focus.set(review.id, { reason: 'pointer' })
+ }
+ onClick={(event) => {
+ if (event.metaKey || event.ctrlKey) {
+ listInteractions.selection.toggle(review.id);
+ return;
+ }
+ list.activate.key(review.id, {
+ reason: 'pointer',
+ metadata: { newSplit: event.shiftKey },
+ });
+ }}
+ onActivate={(newSplit) =>
+ list.activate.key(review.id, {
+ reason: 'keyboard',
+ metadata: { newSplit },
+ })
+ }
+ />
+ )}
+ </Virtualizer>
+ </ListLayoutProvider>
+ </Show>
+ <Show
+ when={
+ source.hasMore() && !source.pageError() && !missingIdentity()
+ }
+ >
+ <div ref={setSentinel} aria-hidden="true" class="h-px" />
+ </Show>
+ <Show
+ when={
+ !missingIdentity() && (source.hasMore() || source.pageError())
+ }
+ >
+ <div class="flex justify-center p-3">
+ <Button
+ variant="outline"
+ size="sm"
+ disabled={source.isLoadingMore()}
+ onClick={() =>
+ void (source.hasMore() ? loadMore() : source.retry())
+ }
+ >
+ <Show
+ when={source.isLoadingMore()}
+ fallback={
+ source.pageError()
+ ? source.hasMore()
+ ? 'Retry loading more'
+ : 'Retry loading'
+ : 'Load more'
+ }
+ >
+ <SpinnerIcon class="size-3 animate-spin" /> Loading…
+ </Show>
+ </Button>
+ </div>
+ </Show>
+ </div>
+ </Match>
+ </Switch>
+ <Show when={selectedReviews().length > 0}>
+ <EntitySelectionToolbar
+ selected={selectedReviews()}
+ onClear={listInteractions.selection.clear}
+ analyticsSource="reviews"
+ />
+ </Show>
+ </Suspense>
+ </section>
+ );
+}
diff --git a/apps/web/src/features/tasks-view/components/TasksPrDetail.tsx b/apps/web/src/features/reviews-view/components/ReviewsPrDetail.tsx
similarity index 90%
rename from apps/web/src/features/tasks-view/components/TasksPrDetail.tsx
rename to apps/web/src/features/reviews-view/components/ReviewsPrDetail.tsx
index 149fafef80..90a9c8a5d2 100644
--- a/apps/web/src/features/tasks-view/components/TasksPrDetail.tsx
+++ b/apps/web/src/features/reviews-view/components/ReviewsPrDetail.tsx
@@ -13,9 +13,9 @@ import { SplitFileMenu } from '@components/app/split-layout/components/SplitFile
import { SplitPanel } from '@components/app/split-panel';
import { Permissions } from '@core/component/SharePermissions';
import { onMount } from 'solid-js';
-import { tasksPrRoute } from '../route';
+import { reviewsPrRoute } from '../route';
-function TasksPrBreadcrumb(props: {
+function ReviewsPrBreadcrumb(props: {
foreignEntityId: string;
name: string;
status?: string;
@@ -56,7 +56,7 @@ function TasksPrBreadcrumb(props: {
);
}
-export function TasksPrDetail(props: { foreignEntityId: string }) {
+export function ReviewsPrDetail(props: { foreignEntityId: string }) {
const analytics = useAnalytics();
const detail = usePrDetail(() => props.foreignEntityId);
const name = () => {
@@ -86,7 +86,7 @@ export function TasksPrDetail(props: { foreignEntityId: string }) {
<ViewBreadcrumbs.Outlet aria-label="Pull request location" />
<PrDetailActions url={githubUrl()} />
</ViewShell.TopBar>
- <TasksPrBreadcrumb
+ <ReviewsPrBreadcrumb
foreignEntityId={props.foreignEntityId}
name={name()}
status={detail.data()?.pullRequest.status ?? undefined}
@@ -103,7 +103,7 @@ export function TasksPrDetail(props: { foreignEntityId: string }) {
);
}
-export function TasksPrDetailRouteView() {
- const params = useRouteParams(tasksPrRoute);
- return <TasksPrDetail foreignEntityId={params.foreignEntityId} />;
+export function ReviewsPrDetailRouteView() {
+ const params = useRouteParams(reviewsPrRoute);
+ return <ReviewsPrDetail foreignEntityId={params.foreignEntityId} />;
}
diff --git a/apps/web/src/features/reviews-view/components/ReviewsSidebar.tsx b/apps/web/src/features/reviews-view/components/ReviewsSidebar.tsx
new file mode 100644
index 0000000000..5a72681e73
--- /dev/null
+++ b/apps/web/src/features/reviews-view/components/ReviewsSidebar.tsx
@@ -0,0 +1,195 @@
+import {
+ CollapsibleSection,
+ useViewTabHotkeys,
+ ViewSidebar,
+} from '@app/components/view-shell';
+import { globalSplitManager } from '@app/signal/splitLayout';
+import { PrStatusIcon } from '@block-pr/component/PrStatus';
+import {
+ type PrForeignEntityData,
+ prForeignEntityQueryOptions,
+} from '@block-pr/data/queries';
+import { prDisplayName } from '@block-pr/util/prKey';
+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
+import { ContextMenuContent, MenuItem } from '@core/component/ContextMenu';
+import { ContextMenu } from '@kobalte/core/context-menu';
+import SplitIcon from '@phosphor/columns.svg';
+import GitPullRequestIcon from '@phosphor/git-pull-request.svg';
+import StarIcon from '@phosphor/star.svg';
+import UserIcon from '@phosphor/user.svg';
+import UsersThreeIcon from '@phosphor/users-three.svg';
+import {
+ useFavoritesData,
+ useRemoveFavoriteMutation,
+} from '@queries/favorites/favorites';
+import type { Favorite } from '@service-storage/generated/schemas/favorite';
+import { makePersisted } from '@solid-primitives/storage';
+import { useQueries } from '@tanstack/solid-query';
+import { createMemo, createSignal, For, Show } from 'solid-js';
+import type { ReviewsScope } from '../reviews-types';
+
+function ReviewFavoriteRow(props: {
+ favorite: Favorite;
+ data: PrForeignEntityData;
+ onOpenReview: (id: string, newSplit: boolean) => void;
+ activeForeignEntityId?: string;
+}) {
+ const removeFavorite = useRemoveFavoriteMutation();
+ const name = () =>
+ props.data.pullRequest.name ?? prDisplayName(props.data.prRef);
+
+ return (
+ <ContextMenu>
+ <ContextMenu.Trigger as="div" class="w-full">
+ <ViewSidebar.Item
+ title={name()}
+ active={props.activeForeignEntityId === props.favorite.entityId}
+ onClick={(event) =>
+ props.onOpenReview(props.favorite.entityId, event.shiftKey)
+ }
+ >
+ <ViewSidebar.Icon>
+ <PrStatusIcon
+ status={props.data.pullRequest.status ?? 'open'}
+ class="size-4"
+ />
+ </ViewSidebar.Icon>
+ <span class="truncate">{name()}</span>
+ </ViewSidebar.Item>
+ </ContextMenu.Trigger>
+ <ContextMenu.Portal>
+ <ContextMenuContent class="w-56 text-xs text-ink-muted">
+ <MenuItem
+ icon={SplitIcon}
+ text="Open in new split"
+ disabled={!globalSplitManager()?.canAppendSplit()}
+ onClick={() => {
+ if (globalSplitManager()?.canAppendSplit())
+ props.onOpenReview(props.favorite.entityId, true);
+ }}
+ />
+ <MenuItem
+ icon={StarIcon}
+ text="Remove from favorites"
+ onClick={() =>
+ removeFavorite.mutate({
+ entityType: 'foreign_entity',
+ entityId: props.favorite.entityId,
+ })
+ }
+ />
+ </ContextMenuContent>
+ </ContextMenu.Portal>
+ </ContextMenu>
+ );
+}
+
+function ReviewFavorites(props: {
+ onOpenReview: (id: string, newSplit: boolean) => void;
+ activeForeignEntityId?: string;
+}) {
+ const favoritesData = useFavoritesData({ entityType: ['foreign_entity'] });
+ const favorites = createMemo(() =>
+ (favoritesData()?.favorites ?? [])
+ .filter((favorite) => favorite.entityType === 'foreign_entity')
+ .sort((left, right) => left.sortOrder - right.sortOrder)
+ );
+ const queries = useQueries(() => ({
+ queries: favorites().map((favorite) =>
+ prForeignEntityQueryOptions(favorite.entityId)
+ ),
+ }));
+ const pullRequests = () =>
+ favorites().flatMap((favorite, index) => {
+ const query = queries[index];
+ const data = query?.isPending ? undefined : query?.data;
+ return data?.id === favorite.entityId ? [{ favorite, data }] : [];
+ });
+ const [open, setOpen] = makePersisted(createSignal(true), {
+ name: 'reviews-favorites-open',
+ });
+
+ return (
+ <Show when={pullRequests().length > 0}>
+ <CollapsibleSection.Root open={open()} onOpenChange={setOpen}>
+ <CollapsibleSection.Trigger>
+ <span class="min-w-0 truncate">Favorites</span>
+ <CollapsibleSection.Indicator />
+ </CollapsibleSection.Trigger>
+ <CollapsibleSection.Content>
+ <ViewSidebar.Nav aria-label="Favorite pull requests">
+ <For each={pullRequests()}>
+ {({ favorite, data }) => (
+ <ReviewFavoriteRow
+ favorite={favorite}
+ data={data}
+ onOpenReview={props.onOpenReview}
+ activeForeignEntityId={props.activeForeignEntityId}
+ />
+ )}
+ </For>
+ </ViewSidebar.Nav>
+ </CollapsibleSection.Content>
+ </CollapsibleSection.Root>
+ </Show>
+ );
+}
+
+export function ReviewsSidebar(props: {
+ scope: ReviewsScope;
+ onScopeChange: (scope: ReviewsScope) => void;
+ onOpenReview: (id: string, newSplit: boolean) => void;
+ activeForeignEntityId?: string;
+}) {
+ const panel = useSplitPanelOrThrow();
+ useViewTabHotkeys({
+ scopeId: panel.splitHotkeyScope,
+ enabled: panel.isPanelActive,
+ ids: () => ['involving', 'all', 'authored'] as ReviewsScope[],
+ activeId: () => props.scope,
+ setActiveId: props.onScopeChange,
+ });
+
+ return (
+ <ViewSidebar.Root aria-label="Reviews navigation">
+ <ViewSidebar.Header>
+ <ViewSidebar.Title>Reviews</ViewSidebar.Title>
+ </ViewSidebar.Header>
+ <ViewSidebar.Content>
+ <ViewSidebar.Nav aria-label="Pull request views">
+ <ViewSidebar.Item
+ active={props.scope === 'involving'}
+ onClick={() => props.onScopeChange('involving')}
+ >
+ <ViewSidebar.Icon>
+ <UsersThreeIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">Involving me</span>
+ </ViewSidebar.Item>
+ <ViewSidebar.Item
+ active={props.scope === 'all'}
+ onClick={() => props.onScopeChange('all')}
+ >
+ <ViewSidebar.Icon>
+ <GitPullRequestIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">All PRs</span>
+ </ViewSidebar.Item>
+ <ViewSidebar.Item
+ active={props.scope === 'authored'}
+ onClick={() => props.onScopeChange('authored')}
+ >
+ <ViewSidebar.Icon>
+ <UserIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">Authored by me</span>
+ </ViewSidebar.Item>
+ </ViewSidebar.Nav>
+ <ReviewFavorites
+ onOpenReview={props.onOpenReview}
+ activeForeignEntityId={props.activeForeignEntityId}
+ />
+ </ViewSidebar.Content>
+ </ViewSidebar.Root>
+ );
+}
diff --git a/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.test.ts b/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.test.ts
new file mode 100644
index 0000000000..0651d4ec8c
--- /dev/null
+++ b/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.test.ts
@@ -0,0 +1,51 @@
+import type { GithubPullRequestEntity } from '@entity';
+import { createRoot, createSignal } from 'solid-js';
+import { describe, expect, it, vi } from 'vitest';
+import { createReviewsListController } from './create-reviews-list-controller';
+
+const review = (id: string) => ({ id }) as GithubPullRequestEntity;
+
+describe('Reviews list controller', () => {
+ it('keeps focus and selection across a temporarily disabled detail query', () => {
+ createRoot((dispose) => {
+ const rows = [review('a'), review('b'), review('c')];
+ const [items, setItems] = createSignal(rows);
+ const list = createReviewsListController(items, vi.fn());
+
+ list.focus.set('b');
+ list.selection.set('a', true);
+ list.selection.set('c', true, { range: true });
+ expect(list.selection.items().map((item) => item.id)).toEqual([
+ 'a',
+ 'b',
+ 'c',
+ ]);
+
+ setItems([]);
+ expect(list.focus.requestedKey()).toBe('b');
+ expect(list.selection.items()).toEqual([]);
+
+ setItems(rows);
+ expect(list.focus.key()).toBe('b');
+ expect(list.selection.items().map((item) => item.id)).toEqual([
+ 'a',
+ 'b',
+ 'c',
+ ]);
+ dispose();
+ });
+ });
+
+ it('routes keyboard activation with the requested split intent', () => {
+ createRoot((dispose) => {
+ const onOpen = vi.fn();
+ const list = createReviewsListController(() => [review('pr')], onOpen);
+ list.activate.key('pr', {
+ reason: 'keyboard',
+ metadata: { newSplit: true },
+ });
+ expect(onOpen).toHaveBeenCalledWith('pr', true);
+ dispose();
+ });
+ });
+});
diff --git a/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.ts b/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.ts
new file mode 100644
index 0000000000..6aa9070509
--- /dev/null
+++ b/apps/web/src/features/reviews-view/primitives/create-reviews-list-controller.ts
@@ -0,0 +1,25 @@
+import { createListController } from '@app/components/list';
+import type { GithubPullRequestEntity } from '@entity';
+import type { Accessor } from 'solid-js';
+
+export type ReviewActivationMetadata = { newSplit?: boolean };
+
+/** Keep review focus and selection alive while a detail route replaces the list. */
+export function createReviewsListController(
+ items: Accessor<readonly GithubPullRequestEntity[]>,
+ onOpen: (id: string, newSplit: boolean) => void
+) {
+ return createListController<
+ GithubPullRequestEntity,
+ ReviewActivationMetadata
+ >({
+ items,
+ getKey: (review) => review.id,
+ onActivate: ({ item, metadata }) =>
+ onOpen(item.id, metadata?.newSplit === true),
+ });
+}
+
+export type ReviewsListController = ReturnType<
+ typeof createReviewsListController
+>;
diff --git a/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts b/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts
new file mode 100644
index 0000000000..ec0443e3e6
--- /dev/null
+++ b/apps/web/src/features/reviews-view/queries/use-reviews-query.test.ts
@@ -0,0 +1,31 @@
+import { describe, expect, it, vi } from 'vitest';
+import { reviewsQueryBody } from './use-reviews-query';
+
+// Soup query imports websocket clients that cannot connect in jsdom.
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+
+describe('Reviews Soup filter', () => {
+ it.each(['all', 'authored'] as const)(
+ 'requests accessible GitHub pull requests for %s',
+ (scope) => {
+ expect(reviewsQueryBody(scope).fef).toEqual({
+ l: { fes: 'github_pull_request' },
+ });
+ }
+ );
+
+ it('filters Involving me by the backend participant predicate', () => {
+ expect(reviewsQueryBody('involving').fef).toEqual({
+ '&': [{ l: { fes: 'github_pull_request' } }, { l: 'me' }],
+ });
+ });
+});
diff --git a/apps/web/src/features/reviews-view/queries/use-reviews-query.ts b/apps/web/src/features/reviews-view/queries/use-reviews-query.ts
new file mode 100644
index 0000000000..044a66e5b6
--- /dev/null
+++ b/apps/web/src/features/reviews-view/queries/use-reviews-query.ts
@@ -0,0 +1,54 @@
+import { clause, compileClause, confine } from '@app/features/soup/filters';
+import { type GithubPullRequestEntity, isGithubPrEntity } from '@entity';
+import { useSoupAstItemsQuery } from '@queries/soup/items';
+import type { Accessor } from 'solid-js';
+import type { ReviewsScope, ReviewsSortId } from '../reviews-types';
+
+/** Backend participant matching requires the viewer's linked GitHub user ID. */
+export const reviewsQueryBody = (scope: ReviewsScope) =>
+ compileClause(
+ confine({
+ fef:
+ scope === 'involving'
+ ? clause.and(
+ clause.eq('foreignEntitySource', 'github_pull_request'),
+ clause.eq('foreignEntityIncludesMe', true)
+ )
+ : clause.eq('foreignEntitySource', 'github_pull_request'),
+ })
+ );
+
+/** GitHub pull requests accessible through Soup, with pagination. */
+export function useReviewsQuery(
+ sort: Accessor<ReviewsSortId>,
+ scope: Accessor<ReviewsScope>,
+ enabled: Accessor<boolean>
+) {
+ const query = useSoupAstItemsQuery(
+ () => ({
+ params: {
+ expand: true,
+ limit: 100,
+ sort_method: sort(),
+ sort_direction: 'desc',
+ },
+ body: reviewsQueryBody(scope()),
+ }),
+ () => ({ enabled: enabled(), showSupportedForeignEntities: true })
+ );
+
+ const reviews = (): GithubPullRequestEntity[] => {
+ if (!query.isEnabled || query.isLoading) return [];
+ return (query.data?.entities ?? []).filter(isGithubPrEntity);
+ };
+ return {
+ reviews,
+ isLoading: () => query.isLoading,
+ error: () => (reviews().length === 0 ? query.error : undefined),
+ pageError: () => query.error,
+ hasMore: () => query.hasNextPage,
+ isLoadingMore: () => query.isFetchingNextPage,
+ loadMore: () => query.fetchNextPage(),
+ retry: () => query.refetch(),
+ };
+}
diff --git a/apps/web/src/features/reviews-view/reviews-filter.ts b/apps/web/src/features/reviews-view/reviews-filter.ts
new file mode 100644
index 0000000000..db50915611
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-filter.ts
@@ -0,0 +1,68 @@
+import type { GithubPullRequestEntity } from '@entity';
+import type { ReviewsScope } from './reviews-types';
+
+export type ReviewsFilter = {
+ scope: ReviewsScope;
+ authorLogin?: string;
+ authorId?: string;
+ search: string;
+ repositories: readonly string[];
+ authors: readonly string[];
+};
+
+export function isAuthoredBy(
+ review: GithubPullRequestEntity,
+ authorLogin?: string,
+ authorId?: string
+): boolean {
+ const reviewAuthorId = review.metadata.authorId;
+ if (authorId && reviewAuthorId !== undefined) {
+ if (String(reviewAuthorId) === authorId) return true;
+ }
+
+ const reviewAuthor = review.metadata.authorLogin;
+ if (!authorLogin || !reviewAuthor) return false;
+
+ return reviewAuthor.toLowerCase() === authorLogin.toLowerCase();
+}
+
+export function filterReviews(
+ reviews: readonly GithubPullRequestEntity[],
+ filter: ReviewsFilter
+): GithubPullRequestEntity[] {
+ const search = filter.search.trim().toLocaleLowerCase();
+
+ return reviews.filter((review) => {
+ if (
+ filter.scope === 'authored' &&
+ !isAuthoredBy(review, filter.authorLogin, filter.authorId)
+ ) {
+ return false;
+ }
+
+ const repository = `${review.metadata.owner}/${review.metadata.repo}`;
+ if (
+ filter.repositories.length > 0 &&
+ !filter.repositories.includes(repository)
+ ) {
+ return false;
+ }
+
+ const author = review.metadata.authorLogin;
+ if (filter.authors.length > 0) {
+ if (!author || !filter.authors.includes(author)) return false;
+ }
+
+ if (!search) return true;
+
+ const searchableFields = [
+ review.metadata.name,
+ repository,
+ String(review.metadata.number),
+ author ?? '',
+ ];
+ return searchableFields.some((value) =>
+ value.toLocaleLowerCase().includes(search)
+ );
+ });
+}
diff --git a/apps/web/src/features/reviews-view/reviews-hosted-content.test.ts b/apps/web/src/features/reviews-view/reviews-hosted-content.test.ts
new file mode 100644
index 0000000000..20f21582ed
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-hosted-content.test.ts
@@ -0,0 +1,27 @@
+import { describe, expect, it } from 'vitest';
+import { reviewsHostedContent } from './reviews-hosted-content';
+import { reviewsTabSearchCodec } from './reviews-tab-search';
+
+describe('Reviews PR navigation', () => {
+ it('preserves the selected tab in a new split', () => {
+ const tab = reviewsTabSearchCodec.serialize({ tab: 'authored' });
+ const content = reviewsHostedContent(
+ { type: 'pr', id: 'pr-1' },
+ tab ? { reviews: tab } : undefined
+ );
+
+ expect(content).toEqual({
+ type: 'component',
+ id: 'reviews',
+ entryMetadata: {
+ search: { reviews: { tab: ['authored'] } },
+ route: {
+ matches: [
+ { id: 'view-reviews', params: {} },
+ { id: 'reviews-pr', params: { foreignEntityId: 'pr-1' } },
+ ],
+ },
+ },
+ });
+ });
+});
diff --git a/apps/web/src/features/tasks-view/tasks-hosted-content.ts b/apps/web/src/features/reviews-view/reviews-hosted-content.ts
similarity index 50%
rename from apps/web/src/features/tasks-view/tasks-hosted-content.ts
rename to apps/web/src/features/reviews-view/reviews-hosted-content.ts
index 605a731300..f048640f6e 100644
--- a/apps/web/src/features/tasks-view/tasks-hosted-content.ts
+++ b/apps/web/src/features/reviews-view/reviews-hosted-content.ts
@@ -1,18 +1,18 @@
-import type { SplitRouteMatch } from '@app/lib/split-router';
+import type { SplitLocation, SplitRouteMatch } from '@app/lib/split-router';
import type { SplitContent } from '@components/app/split-layout/layoutManager';
const hostedDetailRoutes = {
pr: (id: string): SplitRouteMatch => ({
- id: 'tasks-pr',
+ id: 'reviews-pr',
params: { foreignEntityId: id },
}),
} satisfies Record<string, (id: string) => SplitRouteMatch>;
-/** Open a Tasks-hosted detail without mounting its legacy block. */
-export function tasksHostedContent(content: {
- type: string;
- id: string;
-}): SplitContent | undefined {
+/** Open a Reviews-hosted detail without mounting its legacy block. */
+export function reviewsHostedContent(
+ content: { type: string; id: string },
+ search?: SplitLocation['search']
+): SplitContent | undefined {
const detail = hostedDetailRoutes[
content.type as keyof typeof hostedDetailRoutes
]?.(content.id);
@@ -20,9 +20,10 @@ export function tasksHostedContent(content: {
return {
type: 'component',
- id: 'tasks',
+ id: 'reviews',
entryMetadata: {
- route: { matches: [{ id: 'view-tasks', params: {} }, detail] },
+ route: { matches: [{ id: 'view-reviews', params: {} }, detail] },
+ ...(search ? { search } : {}),
},
};
}
diff --git a/apps/web/src/features/reviews-view/reviews-tab-search.test.ts b/apps/web/src/features/reviews-view/reviews-tab-search.test.ts
new file mode 100644
index 0000000000..1d6daeba2f
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-tab-search.test.ts
@@ -0,0 +1,26 @@
+import { describe, expect, it } from 'vitest';
+import { reviewsTabSearchCodec } from './reviews-tab-search';
+
+describe('Reviews tab URL', () => {
+ it.each(['involving', 'all', 'authored'] as const)(
+ 'round-trips the %s tab',
+ (tab) => {
+ const encoded = reviewsTabSearchCodec.serialize({ tab });
+ expect(reviewsTabSearchCodec.parse(encoded)).toEqual({
+ value: { tab },
+ valid: true,
+ });
+ }
+ );
+
+ it('defaults to involving for invalid or missing tabs', () => {
+ expect(reviewsTabSearchCodec.parse({})).toEqual({
+ value: { tab: 'involving' },
+ valid: true,
+ });
+ expect(reviewsTabSearchCodec.parse({ tab: ['invalid'] })).toEqual({
+ value: { tab: 'involving' },
+ valid: false,
+ });
+ });
+});
diff --git a/apps/web/src/features/reviews-view/reviews-tab-search.ts b/apps/web/src/features/reviews-view/reviews-tab-search.ts
new file mode 100644
index 0000000000..0b4324b9ed
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-tab-search.ts
@@ -0,0 +1,11 @@
+import { createSearchParamsCodec } from '@app/lib/split-router';
+import { z } from 'zod';
+import type { ReviewsScope } from './reviews-types';
+
+export const reviewsTabSearch = {
+ namespace: 'reviews',
+ schema: z.object({ tab: z.enum(['involving', 'all', 'authored']) }),
+ defaults: { tab: 'involving' as ReviewsScope },
+};
+
+export const reviewsTabSearchCodec = createSearchParamsCodec(reviewsTabSearch);
diff --git a/apps/web/src/features/reviews-view/reviews-types.ts b/apps/web/src/features/reviews-view/reviews-types.ts
new file mode 100644
index 0000000000..10ca9f2817
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-types.ts
@@ -0,0 +1,2 @@
+export type ReviewsScope = 'all' | 'involving' | 'authored';
+export type ReviewsSortId = 'updated_at' | 'created_at';
diff --git a/apps/web/src/features/reviews-view/reviews-view.tsx b/apps/web/src/features/reviews-view/reviews-view.tsx
new file mode 100644
index 0000000000..dde49199cd
--- /dev/null
+++ b/apps/web/src/features/reviews-view/reviews-view.tsx
@@ -0,0 +1,323 @@
+import {
+ SearchBar,
+ ViewBreadcrumbs,
+ ViewShell,
+} from '@app/components/view-shell';
+import {
+ createSearchParams,
+ SplitRouter,
+ useNavigate,
+ useParams,
+} from '@app/lib/split-router';
+import { type PillTabItem, PillTabs } from '@components/app/mobile/PillTabs';
+import { useSplitLayout } from '@components/app/split-layout/layout';
+import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
+import { SplitPanel } from '@components/app/split-panel';
+import { useUserContext } from '@core/context/user';
+import { isTouchDevice } from '@core/mobile/isTouchDevice';
+import { ListEntityMetadataQueryProvider } from '@entity';
+import { useGithubLinkStatusQuery } from '@queries/auth/github-link';
+import {
+ createMemo,
+ createRenderEffect,
+ createSignal,
+ onMount,
+ Show,
+ Suspense,
+} from 'solid-js';
+import {
+ ReviewsControls,
+ ReviewsFilterDrawer,
+ type ReviewsFilterId,
+} from './components/ReviewsControls';
+import { ReviewsList } from './components/ReviewsList';
+import { ReviewsSidebar } from './components/ReviewsSidebar';
+import { createReviewsListController } from './primitives/create-reviews-list-controller';
+import { useReviewsQuery } from './queries/use-reviews-query';
+import { filterReviews } from './reviews-filter';
+import { reviewsHostedContent } from './reviews-hosted-content';
+import { reviewsTabSearch, reviewsTabSearchCodec } from './reviews-tab-search';
+import type { ReviewsScope, ReviewsSortId } from './reviews-types';
+import { reviewsPrRoute, reviewsSplitRoute } from './route';
+
+const REVIEW_SCOPE_TITLES: Record<ReviewsScope, string> = {
+ all: 'All PRs',
+ involving: 'Involving me',
+ authored: 'Authored by me',
+};
+const REVIEW_SCOPE_TABS: PillTabItem<ReviewsScope>[] = [
+ { value: 'involving', label: REVIEW_SCOPE_TITLES.involving },
+ { value: 'all', label: REVIEW_SCOPE_TITLES.all },
+ { value: 'authored', label: REVIEW_SCOPE_TITLES.authored },
+];
+function ReviewsRoot() {
+ const panel = useSplitPanelOrThrow();
+ const layout = useSplitLayout();
+ createRenderEffect(() =>
+ panel.handle.updateMeta?.({ splitPanelLayout: 'composable' })
+ );
+ const navigate = useNavigate();
+ const params = useParams<{ foreignEntityId?: string }>();
+ const [tabSearch] = createSearchParams(reviewsTabSearch);
+ const scope = (): ReviewsScope => tabSearch.tab;
+ const scopeTitle = () => REVIEW_SCOPE_TITLES[scope()];
+ const [search, setSearch] = createSignal('');
+ const [sort, setSort] = createSignal<ReviewsSortId>('updated_at');
+ const [selectedRepositories, setSelectedRepositories] = createSignal<
+ string[]
+ >([]);
+ const [selectedAuthors, setSelectedAuthors] = createSignal<string[]>([]);
+ const listEnabled = () => !params.foreignEntityId;
+ const source = useReviewsQuery(sort, scope, listEnabled);
+ const githubLink = useGithubLinkStatusQuery({ enabled: listEnabled });
+ const viewer = useUserContext();
+ const authorLogin = () =>
+ githubLink.isPending ? undefined : githubLink.data?.username;
+ const authorId = () =>
+ githubLink.isPending ? undefined : githubLink.data?.userId;
+ const repositories = createMemo(() =>
+ [
+ ...new Set(
+ source
+ .reviews()
+ .map((review) => `${review.metadata.owner}/${review.metadata.repo}`)
+ ),
+ ]
+ .sort()
+ .map((id) => ({ id, label: id }))
+ );
+ const authors = createMemo(() =>
+ [
+ ...new Set(
+ source
+ .reviews()
+ .flatMap((review) =>
+ review.metadata.authorLogin ? [review.metadata.authorLogin] : []
+ )
+ ),
+ ]
+ .sort()
+ .map((id) => ({ id, label: id }))
+ );
+ const changeFilter = (
+ group: ReviewsFilterId,
+ id: string,
+ selected: boolean
+ ) => {
+ const setter =
+ group === 'repository' ? setSelectedRepositories : setSelectedAuthors;
+ setter((current) => {
+ if (!selected) return current.filter((value) => value !== id);
+ return current.includes(id) ? current : [...current, id];
+ });
+ };
+ const clearFilters = () => {
+ setSelectedRepositories([]);
+ setSelectedAuthors([]);
+ };
+ const clearSearch = () => setSearch('');
+ const searchForTab = (tab: ReviewsScope) => ({
+ [reviewsTabSearch.namespace]: reviewsTabSearchCodec.serialize({ tab }),
+ });
+ const openList = () =>
+ navigate(
+ { route: reviewsSplitRoute, params: {} },
+ { search: searchForTab(scope()) }
+ );
+ const selectScope = (next: ReviewsScope) =>
+ navigate(
+ { route: reviewsSplitRoute, params: {} },
+ { search: searchForTab(next) }
+ );
+ const openReview = (foreignEntityId: string, newSplit: boolean) => {
+ if (newSplit) {
+ const tabSearchParams = reviewsTabSearchCodec.serialize({ tab: scope() });
+ const content = reviewsHostedContent(
+ { type: 'pr', id: foreignEntityId },
+ tabSearchParams
+ ? { [reviewsTabSearch.namespace]: tabSearchParams }
+ : undefined
+ );
+ if (content)
+ layout.openWithSplit(content, {
+ preferNewSplit: true,
+ // List and detail share the Reviews shell component identity.
+ allowDuplicate: true,
+ });
+ return;
+ }
+ navigate(
+ { route: reviewsPrRoute, params: { foreignEntityId } },
+ { search: searchForTab(scope()) }
+ );
+ };
+ const reviews = createMemo(() =>
+ filterReviews(source.reviews(), {
+ scope: scope(),
+ authorLogin: authorLogin(),
+ authorId: authorId(),
+ search: search(),
+ repositories: selectedRepositories(),
+ authors: selectedAuthors(),
+ })
+ );
+ const listController = createReviewsListController(reviews, openReview);
+ const controls = () => ({
+ sort: sort(),
+ onSortChange: setSort,
+ repositories: repositories(),
+ authors: authors(),
+ selectedRepositories: selectedRepositories(),
+ selectedAuthors: selectedAuthors(),
+ onFilterChange: changeFilter,
+ onClearFilters: clearFilters,
+ });
+ const list = () => (
+ <>
+ <ViewShell.TopBar>
+ <h1 class="hidden min-w-0 truncate text-sm font-semibold text-ink @max-[720px]/view-shell:block">
+ {scopeTitle()}
+ </h1>
+ <ViewBreadcrumbs.Outlet
+ class="@max-[720px]/view-shell:hidden"
+ aria-label="Review location"
+ />
+ </ViewShell.TopBar>
+ <ViewShell.Header>
+ <Show
+ when={isTouchDevice()}
+ fallback={
+ <div class="flex min-w-0 flex-col @max-[720px]/view-shell:gap-3">
+ <div class="hidden h-8 items-center @max-[720px]/view-shell:flex">
+ <h1 class="truncate text-xl font-semibold text-ink">
+ {scopeTitle()}
+ </h1>
+ </div>
+ <div class="flex min-w-0 items-center justify-between gap-3">
+ <SearchBar
+ label="Search reviews"
+ value={search()}
+ onValueChange={setSearch}
+ placeholder="Search reviews"
+ class="max-w-md flex-1"
+ />
+ <ReviewsControls {...controls()} />
+ </div>
+ </div>
+ }
+ >
+ <div class="flex min-w-0 flex-col gap-3">
+ <div class="h-10 min-w-0 flex-1">
+ <PillTabs
+ scrollable
+ leading={<ReviewsFilterDrawer {...controls()} />}
+ items={REVIEW_SCOPE_TABS}
+ value={scope()}
+ onChange={selectScope}
+ />
+ </div>
+ <SearchBar
+ label="Search reviews"
+ value={search()}
+ onValueChange={setSearch}
+ placeholder="Search reviews"
+ />
+ </div>
+ </Show>
+ </ViewShell.Header>
+ <ViewShell.Content>
+ <ReviewsList
+ list={listController}
+ source={source}
+ scope={scope()}
+ authorLogin={authorLogin()}
+ authorId={authorId()}
+ viewerName={viewer.userInfo()?.name ?? undefined}
+ githubIdentityLoading={githubLink.isPending}
+ githubAccountStatus={
+ githubLink.isError
+ ? 'error'
+ : githubLink.isPending
+ ? undefined
+ : githubLink.data?.status
+ }
+ search={search()}
+ selectedRepositories={selectedRepositories()}
+ selectedAuthors={selectedAuthors()}
+ onClearFilters={clearFilters}
+ onClearSearch={clearSearch}
+ onOpen={openReview}
+ />
+ </ViewShell.Content>
+ </>
+ );
+
+ onMount(() => panel.handle.setDisplayName('Reviews'));
+ return (
+ <ViewBreadcrumbs.Root
+ value={
+ params.foreignEntityId ? `pr:${params.foreignEntityId}` : 'reviews-view'
+ }
+ onChange={(next) => {
+ if (next === 'reviews-view') openList();
+ }}
+ >
+ <ViewBreadcrumbs.Item
+ value="reviews-view"
+ order={0}
+ metadata={{ type: 'reviews' }}
+ >
+ {(item) => (
+ <ViewBreadcrumbs.ReturnButton
+ isActive={item.isActive()}
+ onClick={item.onSelect}
+ tooltip={scopeTitle()}
+ >
+ {scopeTitle()}
+ </ViewBreadcrumbs.ReturnButton>
+ )}
+ </ViewBreadcrumbs.Item>
+ <SplitPanel.Root>
+ <SplitPanel.Body>
+ <ViewShell.Root
+ asidePreferenceKey="reviews"
+ resizable
+ aside={{ preserveDuringResize: false }}
+ main={{ preferredWidth: 640 }}
+ >
+ <ViewShell.Aside>
+ <ReviewsSidebar
+ scope={scope()}
+ onScopeChange={selectScope}
+ onOpenReview={openReview}
+ activeForeignEntityId={params.foreignEntityId}
+ />
+ </ViewShell.Aside>
+ <ViewShell.Main>
+ <Suspense
+ fallback={
+ <div
+ role="status"
+ class="grid size-full place-items-center text-ink-muted"
+ >
+ Loading reviews…
+ </div>
+ }
+ >
+ <SplitRouter.Outlet fallback={list} />
+ </Suspense>
+ </ViewShell.Main>
+ </ViewShell.Root>
+ </SplitPanel.Body>
+ </SplitPanel.Root>
+ </ViewBreadcrumbs.Root>
+ );
+}
+
+export function ReviewsView() {
+ return (
+ <ListEntityMetadataQueryProvider>
+ <ReviewsRoot />
+ </ListEntityMetadataQueryProvider>
+ );
+}
diff --git a/apps/web/src/features/reviews-view/route.tsx b/apps/web/src/features/reviews-view/route.tsx
new file mode 100644
index 0000000000..e520978ad6
--- /dev/null
+++ b/apps/web/src/features/reviews-view/route.tsx
@@ -0,0 +1,43 @@
+import { defineRoute } from '@app/lib/split-router';
+import {
+ usePageViewTracking,
+ withAuth,
+} from '@components/app/split-layout/split-router/app-route-shell';
+import { lazy } from 'solid-js';
+import { z } from 'zod';
+import { reviewsTabSearch } from './reviews-tab-search';
+
+const ReviewsView = lazy(async () => ({
+ default: (await import('./reviews-view')).ReviewsView,
+}));
+const ReviewsPrDetailRouteView = lazy(async () => ({
+ default: (await import('./components/ReviewsPrDetail'))
+ .ReviewsPrDetailRouteView,
+}));
+
+function TrackedReviewsView() {
+ usePageViewTracking('reviews');
+ return <ReviewsView />;
+}
+
+export const ReviewsRouteView = withAuth(TrackedReviewsView);
+
+export const reviewsPrRoute = defineRoute({
+ id: 'reviews-pr',
+ path: 'pr/:foreignEntityId',
+ params: z.object({ foreignEntityId: z.string().min(1) }),
+ component: ReviewsPrDetailRouteView,
+ remountKey: ({ foreignEntityId }) => foreignEntityId,
+ claim: ({ foreignEntityId }) => ({
+ namespace: 'block',
+ id: `pr:${foreignEntityId}`,
+ }),
+});
+
+export const reviewsSplitRoute = defineRoute({
+ id: 'view-reviews',
+ path: 'reviews',
+ component: ReviewsRouteView,
+ search: [reviewsTabSearch.namespace],
+ children: [reviewsPrRoute],
+});
diff --git a/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx b/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
index 42237975a0..5342875901 100644
--- a/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksMobileTabs.tsx
@@ -1,17 +1,29 @@
+import { reviewsSplitRoute } from '@app/features/reviews-view/route';
+import { useFeatureFlag } from '@app/lib/analytics/posthog';
+import { useNavigate } from '@app/lib/split-router';
import { type PillTabItem, PillTabs } from '@components/app/mobile/PillTabs';
+import { enableTasksReviews } from '@core/constant/featureFlags';
+import type { JSX } from 'solid-js';
import { TASK_TABS, type TaskTabItem } from '../constants';
import { useTasksView } from '../tasks-view-context';
-import type { TaskTab } from '../types';
+import type { TasksTab } from '../types';
import { TasksFilterDrawer } from './TasksFilterDrawer';
-const toPill = (tab: TaskTabItem): PillTabItem<TaskTab> => ({
+const toPill = (tab: TaskTabItem): PillTabItem<TasksTab> => ({
value: tab.id,
label: tab.label,
});
-export function TasksMobileTabs() {
+export function TasksMobileTabs(props: { leading?: JSX.Element }) {
const { state, setTab } = useTasksView();
- const items = (): PillTabItem<TaskTab>[] => TASK_TABS.map(toPill);
+ const navigate = useNavigate();
+ const flag = useFeatureFlag(enableTasksReviews);
+ const items = (): PillTabItem<TasksTab | 'reviews'>[] => [
+ ...(flag().enabled
+ ? [{ value: 'reviews' as const, label: 'Reviews' }]
+ : []),
+ ...TASK_TABS.map(toPill),
+ ];
return (
<div class="h-10 min-w-0 flex-1">
@@ -19,10 +31,14 @@ export function TasksMobileTabs() {
scrollable
class="-ml-(--mobile-chrome-gutter) w-[calc(100%+2*var(--mobile-chrome-gutter))] max-w-none flex-none"
contentClass="px-(--mobile-chrome-gutter)"
- leading={<TasksFilterDrawer />}
+ leading={props.leading ?? <TasksFilterDrawer />}
items={items()}
value={state.tab}
- onChange={setTab}
+ onChange={(tab) => {
+ if (tab === 'reviews')
+ navigate({ route: reviewsSplitRoute, params: {} });
+ else setTab(tab);
+ }}
/>
</div>
);
diff --git a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
index 3accf4533d..4999ee7be0 100644
--- a/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
+++ b/apps/web/src/features/tasks-view/components/TasksSidebar.tsx
@@ -6,6 +6,9 @@ import {
import { SidebarCreateHeader } from '@app/components/view-shell/SidebarCreateButton';
import { FavoriteContextMenu } from '@app/features/favorites/FavoriteContextMenu';
import { FavoriteIcon } from '@app/features/favorites/FavoriteIcon';
+import { reviewsSplitRoute } from '@app/features/reviews-view/route';
+import { useFeatureFlag } from '@app/lib/analytics/posthog';
+import { useNavigate } from '@app/lib/split-router';
import {
favoriteSplitContent,
useFavoriteDisplayName,
@@ -13,7 +16,9 @@ import {
import { useSplitLayout } from '@components/app/split-layout/layout';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { toast } from '@core/component/Toast/Toast';
+import { enableTasksReviews } from '@core/constant/featureFlags';
import CheckSquareIcon from '@phosphor/check-square.svg';
+import GitPullRequestIcon from '@phosphor/git-pull-request.svg';
import ListChecksIcon from '@phosphor/list-checks.svg';
import NoteIcon from '@phosphor/note-pencil.svg';
import { SidebarTagsSection } from '@property/tags/SidebarTagsSection';
@@ -22,19 +27,37 @@ import type { Favorite } from '@service-storage/generated/schemas/favorite';
import { createMemo, For, Show } from 'solid-js';
import { Dynamic } from 'solid-js/web';
import { useTasksView } from '../tasks-view-context';
-import type { TaskTab } from '../types';
+import type { TasksTab } from '../types';
const TASK_NAV_ITEMS = [
{ id: 'my-tasks', label: 'My Tasks', icon: CheckSquareIcon },
{ id: 'team-tasks', label: 'All Tasks', icon: ListChecksIcon },
{ id: 'created-by-me', label: 'Created by me', icon: NoteIcon },
-] satisfies { id: TaskTab; label: string; icon: typeof NoteIcon }[];
+] satisfies { id: TasksTab; label: string; icon: typeof NoteIcon }[];
-export function TasksNavigation(props: { onNavigate?: () => void }) {
+export function TasksNavigation(props: {
+ reviewsEnabled: boolean;
+ onNavigate?: () => void;
+}) {
const { state, setTab } = useTasksView();
+ const navigate = useNavigate();
return (
<ViewSidebar.Nav aria-label="Task views">
+ <Show when={props.reviewsEnabled}>
+ <ViewSidebar.Item
+ class="mb-3"
+ onClick={() => {
+ navigate({ route: reviewsSplitRoute, params: {} });
+ props.onNavigate?.();
+ }}
+ >
+ <ViewSidebar.Icon>
+ <GitPullRequestIcon class="size-4" />
+ </ViewSidebar.Icon>
+ <span class="truncate">Reviews</span>
+ </ViewSidebar.Item>
+ </Show>
<For each={TASK_NAV_ITEMS}>
{(item) => (
<ViewSidebar.Item
@@ -134,7 +157,10 @@ function TaskFavorites(props: {
export function TasksSidebar() {
const layout = useSplitLayout();
+ const navigate = useNavigate();
const panel = useSplitPanelOrThrow();
+ const reviewsFlag = useFeatureFlag(enableTasksReviews);
+ const reviewsEnabled = () => reviewsFlag().enabled;
const {
state,
setTab,
@@ -146,9 +172,15 @@ export function TasksSidebar() {
useViewTabHotkeys({
scopeId: panel.splitHotkeyScope,
enabled: panel.isPanelActive,
- ids: () => TASK_NAV_ITEMS.map((tab) => tab.id),
+ ids: () =>
+ reviewsEnabled()
+ ? ['reviews', ...TASK_NAV_ITEMS.map((tab) => tab.id)]
+ : TASK_NAV_ITEMS.map((tab) => tab.id),
activeId: () => state.tab,
- setActiveId: setTab,
+ setActiveId: (id) => {
+ if (id === 'reviews') navigate({ route: reviewsSplitRoute, params: {} });
+ else setTab(id as TasksTab);
+ },
});
return (
@@ -162,14 +194,12 @@ export function TasksSidebar() {
/>
<ViewSidebar.Content>
- <TasksNavigation />
+ <TasksNavigation reviewsEnabled={reviewsEnabled()} />
<TaskFavorites
open={isSidebarSectionOpen('favorites')}
onOpenChange={(open) => setSidebarSectionOpen('favorites', open)}
/>
-
- {/* Tags narrow the current tab; switching tabs clears them like any facet. */}
<SidebarTagsSection
activeIds={state.facets.tags ?? []}
onActiveIdsChange={(ids) => setFacets({ ...state.facets, tags: ids })}
diff --git a/apps/web/src/features/tasks-view/constants.ts b/apps/web/src/features/tasks-view/constants.ts
index 8ae0a27292..d1fc346234 100644
--- a/apps/web/src/features/tasks-view/constants.ts
+++ b/apps/web/src/features/tasks-view/constants.ts
@@ -1,10 +1,10 @@
import type { SortDefinition } from '@app/features/soup';
import { compareDateDesc } from '@core/util/date';
import type { TaskEntityWithProperties } from '@entity';
-import type { TaskGroupBy, TaskSortId, TaskTab } from './types';
+import type { TaskGroupBy, TaskSortId, TasksTab } from './types';
export type TaskTabItem = {
- id: TaskTab;
+ id: TasksTab;
label: string;
};
@@ -19,7 +19,7 @@ export const TEAM_TASK_TABS: TaskTabItem[] = [
export const TASK_TABS = [...PERSONAL_TASK_TABS, ...TEAM_TASK_TABS];
-export const TASK_DEFAULT_GROUP_BY: Record<TaskTab, TaskGroupBy> = {
+export const TASK_DEFAULT_GROUP_BY: Record<TasksTab, TaskGroupBy> = {
'my-tasks': 'priority',
'created-by-me': 'status',
'team-tasks': 'priority',
diff --git a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts b/apps/web/src/features/tasks-view/queries/use-tasks-query.ts
index d31dbee7a8..7630b113c4 100644
--- a/apps/web/src/features/tasks-view/queries/use-tasks-query.ts
+++ b/apps/web/src/features/tasks-view/queries/use-tasks-query.ts
@@ -43,6 +43,7 @@ export type UseTasksDataSourceOptions = {
tagSets: Accessor<readonly TagSetResponse[]>;
tagSetsReady: Accessor<boolean>;
isGroupExpanded: (groupId: string) => boolean;
+ enabled?: Accessor<boolean>;
};
export type TasksDataSourceItem = SoupRow<TaskEntityWithProperties>;
@@ -70,8 +71,8 @@ export function useTasksDataSource(
const facetContext = createMemo(
(): TaskFacetContext => createTagFacetContext(options.tagSets())
);
-
const facetOptionsReady = () =>
+ (options.enabled?.() ?? true) &&
tagFacetReady(state.facets, options.tagSetsReady());
const queryArgs = () =>
diff --git a/apps/web/src/features/tasks-view/route.tsx b/apps/web/src/features/tasks-view/route.tsx
index 7cf75669b9..ce9d3ea646 100644
--- a/apps/web/src/features/tasks-view/route.tsx
+++ b/apps/web/src/features/tasks-view/route.tsx
@@ -14,9 +14,6 @@ import { TasksView } from './tasks-view';
const SoupView = lazy(async () => ({
default: (await import('../next-soup/soup-view/soup-view')).SoupView,
}));
-const TasksPrDetailRouteView = lazy(async () => ({
- default: (await import('./components/TasksPrDetail')).TasksPrDetailRouteView,
-}));
function LegacyTasksView() {
const user = useUserContext();
@@ -44,19 +41,14 @@ function TasksLegacyRouteView() {
}
export const TasksRouteView = withAuth(() => {
- const params = useParams<{ taskId?: string; foreignEntityId?: string }>();
- const detailRequested = () =>
- typeof params.taskId === 'string' ||
- typeof params.foreignEntityId === 'string';
-
+ const params = useParams<{ taskId?: string }>();
return (
<NewAppView
id="tasks"
composableOnTouch
- detailDesktopOnly={!params.foreignEntityId}
- detailRequested={detailRequested}
+ detailDesktopOnly
+ detailRequested={() => typeof params.taskId === 'string'}
detailFallback={<TasksLegacyRouteView />}
- alwaysRenderDetail={!!params.foreignEntityId}
fallback={<LegacyTasksView />}
>
<TasksView />
@@ -64,18 +56,6 @@ export const TasksRouteView = withAuth(() => {
);
});
-export const tasksPrRoute = defineRoute({
- id: 'tasks-pr',
- path: 'pr/:foreignEntityId',
- params: z.object({ foreignEntityId: z.string().min(1) }),
- component: TasksPrDetailRouteView,
- remountKey: ({ foreignEntityId }) => foreignEntityId,
- claim: ({ foreignEntityId }) => ({
- namespace: 'block',
- id: `pr:${foreignEntityId}`,
- }),
-});
-
export const taskDetailRoute = defineRoute({
id: 'tasks-task',
path: ':taskId',
@@ -93,5 +73,5 @@ export const tasksSplitRoute = defineRoute({
path: 'tasks',
component: TasksRouteView,
search: '*' as const,
- children: [tasksPrRoute, taskDetailRoute],
+ children: [taskDetailRoute],
});
diff --git a/apps/web/src/features/tasks-view/tasks-tab-search.ts b/apps/web/src/features/tasks-view/tasks-tab-search.ts
index 3eb47167a5..911b67e348 100644
--- a/apps/web/src/features/tasks-view/tasks-tab-search.ts
+++ b/apps/web/src/features/tasks-view/tasks-tab-search.ts
@@ -1,13 +1,13 @@
import { createSearchParamsCodec } from '@app/lib/split-router';
import { z } from 'zod';
-import type { TaskTab } from './types';
+import type { TasksTab } from './types';
export const tasksTabSearch = {
namespace: 'tasks',
schema: z.object({
tab: z.enum(['my-tasks', 'created-by-me', 'team-tasks']),
}),
- defaults: { tab: 'my-tasks' as TaskTab },
+ defaults: { tab: 'my-tasks' as TasksTab },
};
export const tasksTabSearchCodec = createSearchParamsCodec(tasksTabSearch);
diff --git a/apps/web/src/features/tasks-view/tasks-view-context.tsx b/apps/web/src/features/tasks-view/tasks-view-context.tsx
index e7750f065c..864599304b 100644
--- a/apps/web/src/features/tasks-view/tasks-view-context.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view-context.tsx
@@ -50,9 +50,9 @@ import { tasksTabSearch, tasksTabSearchCodec } from './tasks-tab-search';
import type {
TaskDetailTarget,
TaskSortId,
+ TasksTab,
TasksViewState,
TasksViewStateOptions,
- TaskTab,
} from './types';
type TasksViewProviderProps = ContextProviderProps & {
@@ -89,7 +89,7 @@ export type TasksViewContext = {
options?: EntityDetailNavigationOptions
) => boolean;
closeTask: () => void;
- setTab: (tab: TaskTab) => void;
+ setTab: (tab: TasksTab) => void;
setFacets: (facets: TasksViewState['facets']) => void;
setPrimarySort: (id: TaskSortId) => void;
isSidebarSectionOpen: (id: string) => boolean;
@@ -136,25 +136,20 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
})
);
+ const routeTab = (): TasksTab => tabSearch.tab;
createEffect(
- on(
- () => tabSearch.tab,
- (tab) => {
- if (state.tab === tab) return;
- setState(
- produce((draft) => {
- draft.tab = tab;
- draft.groupBy = TASK_DEFAULT_GROUP_BY[tab];
- draft.facets = normalizeFacetSelection(
- DEFAULT_TASK_FACET_SELECTION
- );
- draft.collapsedGroupIds = [];
- })
- );
- }
- )
+ on(routeTab, (tab) => {
+ if (state.tab === tab) return;
+ setState(
+ produce((draft) => {
+ draft.tab = tab;
+ draft.groupBy = TASK_DEFAULT_GROUP_BY[tab];
+ draft.facets = normalizeFacetSelection(DEFAULT_TASK_FACET_SELECTION);
+ draft.collapsedGroupIds = [];
+ })
+ );
+ })
);
-
const isGroupExpanded = (groupId: string) =>
!state.collapsedGroupIds.includes(groupId);
const source = withSplitPanelOwner(listOwnedSlotName('data-source'), () =>
@@ -281,7 +276,7 @@ export const [TasksViewProvider, useTasksView] = createAssertedContextProvider<
})
);
- const setTab = (tab: TaskTab) => {
+ const setTab = (tab: TasksTab) => {
if (state.tab === tab) {
closeTask();
return;
diff --git a/apps/web/src/features/tasks-view/tasks-view.tsx b/apps/web/src/features/tasks-view/tasks-view.tsx
index 09bf8b1651..d8ee7e7c5b 100644
--- a/apps/web/src/features/tasks-view/tasks-view.tsx
+++ b/apps/web/src/features/tasks-view/tasks-view.tsx
@@ -1,5 +1,5 @@
import { ViewBreadcrumbs, ViewShell } from '@app/components/view-shell';
-import { SplitRouter, useParams } from '@app/lib/split-router';
+import { SplitRouter } from '@app/lib/split-router';
import { useSplitPanelOrThrow } from '@components/app/split-layout/layoutUtils';
import { SplitPanel } from '@components/app/split-panel';
import { ListEntityMetadataQueryProvider } from '@entity';
@@ -30,9 +30,7 @@ function TasksListFallback() {
function TasksViewBreadcrumbs(props: ParentProps) {
const { closeTask, selectedTask } = useTasksView();
- const params = useParams<{ foreignEntityId?: string }>();
const value = () => {
- if (params.foreignEntityId) return `pr:${params.foreignEntityId}`;
const task = selectedTask();
return task ? `task:${task.id}` : 'tasks-view';
};
@@ -56,7 +54,7 @@ function TasksViewRoot() {
onMount(() => panel.handle.setDisplayName('Tasks'));
- const list = () => (
+ const taskList = () => (
<>
<TasksTopBar />
<ViewShell.Header>
@@ -84,7 +82,7 @@ function TasksViewRoot() {
</ViewShell.Aside>
<ViewShell.Main>
<Suspense fallback={<TasksListFallback />}>
- <SplitRouter.Outlet fallback={list} />
+ <SplitRouter.Outlet fallback={taskList} />
</Suspense>
</ViewShell.Main>
</ViewShell.Root>
diff --git a/apps/web/src/features/tasks-view/types.ts b/apps/web/src/features/tasks-view/types.ts
index 88d3a61885..f6a2d6e6dd 100644
--- a/apps/web/src/features/tasks-view/types.ts
+++ b/apps/web/src/features/tasks-view/types.ts
@@ -1,6 +1,7 @@
import type { FacetSelection, SortSelection } from '@app/features/soup';
export type TaskTab = 'my-tasks' | 'created-by-me' | 'team-tasks';
+export type TasksTab = TaskTab;
export type TaskGroupBy =
| 'none'
@@ -18,7 +19,7 @@ export type TaskDetailTarget = {
};
export type TasksViewState = {
- tab: TaskTab;
+ tab: TasksTab;
search: string;
groupBy: TaskGroupBy;
sort: SortSelection<TaskSortId>[];
diff --git a/apps/web/src/lib/core/constant/featureFlags.ts b/apps/web/src/lib/core/constant/featureFlags.ts
index 0c4cbf1e3a..1b00312ac9 100644
--- a/apps/web/src/lib/core/constant/featureFlags.ts
+++ b/apps/web/src/lib/core/constant/featureFlags.ts
@@ -126,6 +126,13 @@ export const PROD_MODE_ENV = import.meta.env.MODE === 'production';
const onInDev = DEV_MODE_ENV || undefined;
+/** Shows the Reviews shortcut in Tasks; copied Reviews links remain accessible. */
+export const enableTasksReviews = defineFlag({
+ key: 'enable-tasks-reviews',
+ env: 'ENABLE_TASKS_REVIEWS',
+ default: onInDev,
+});
+
// Claude Cloud demo onboarding and harness/model discovery. Off until PostHog
// enables it, including in dev; override locally with VITE_CLAUDE_CLOUD.
export const claudeCloud = defineFlag({
diff --git a/apps/web/src/lib/queries/auth/github-link.ts b/apps/web/src/lib/queries/auth/github-link.ts
index 76c00e6000..7397dcc1be 100644
--- a/apps/web/src/lib/queries/auth/github-link.ts
+++ b/apps/web/src/lib/queries/auth/github-link.ts
@@ -14,9 +14,9 @@ export type GithubLinkStatus =
export type GithubLink = {
status: GithubLinkStatus;
- // Populated once auth-service includes the linked account handle on
- // /link/github/status.
+ /** Linked account identity, when the auth service exposes it. */
username?: string;
+ userId?: string;
};
type UseGithubLinkStatusQueryOptions = {
@@ -33,15 +33,18 @@ export async function fetchGithubLinkStatus(): Promise<GithubLink> {
const response = await authServiceClient.checkGithubLinkStatus();
if (response.isOk()) {
- const username =
- (response.value as { github_username?: string | null }).github_username ??
- undefined;
+ // The deployed auth service can lag the identity fields in the API schema.
+ const link = response.value as typeof response.value & {
+ github_username?: string | null;
+ github_user_id?: string | null;
+ };
return {
- status: response.value.reauthentication_required
+ status: link.reauthentication_required
? 'reauthentication_required'
: 'linked',
- username,
+ username: link.github_username ?? undefined,
+ userId: link.github_user_id ?? undefined,
};
}
diff --git a/apps/web/src/lib/queries/favorites/favorites.test.tsx b/apps/web/src/lib/queries/favorites/favorites.test.tsx
index b6012950c4..f442ef7c86 100644
--- a/apps/web/src/lib/queries/favorites/favorites.test.tsx
+++ b/apps/web/src/lib/queries/favorites/favorites.test.tsx
@@ -103,6 +103,9 @@ describe('favorites transport', () => {
it('maps agent sessions to their canonical favorite entity type', () => {
expect(favoriteEntityType('agent_session')).toBe('agent_session');
});
+ it('maps foreign entities to backend favorites', () => {
+ expect(favoriteEntityType('foreign')).toBe('foreign_entity');
+ });
beforeEach(() => {
vi.clearAllMocks();
diff --git a/apps/web/src/lib/queries/favorites/favorites.ts b/apps/web/src/lib/queries/favorites/favorites.ts
index c1107f7a5f..c7c55471a5 100644
--- a/apps/web/src/lib/queries/favorites/favorites.ts
+++ b/apps/web/src/lib/queries/favorites/favorites.ts
@@ -60,6 +60,8 @@ export function favoriteEntityType(
return 'crm_company';
case 'crm_contact':
return 'crm_contact';
+ case 'foreign':
+ return 'foreign_entity';
default:
return undefined;
}
diff --git a/apps/web/src/lib/split-router/layout.ts b/apps/web/src/lib/split-router/layout.ts
index 54e718e69d..103e5ae072 100644
--- a/apps/web/src/lib/split-router/layout.ts
+++ b/apps/web/src/lib/split-router/layout.ts
@@ -118,7 +118,11 @@ export function createLayoutAdapter<TSplitId>(
return { changed: true, layoutChanged: false, splitId: targetId };
}
- layout.updateCurrentLocation(targetId, () => options.entry.location);
+ layout.updateCurrentLocation(
+ targetId,
+ () => options.entry.location,
+ options.replace
+ );
const applied = find(targetId);
if (!deepEqual(applied?.location, options.entry.location)) {
throw new Error('Split layout did not apply the requested location');
diff --git a/apps/web/src/lib/split-router/types.ts b/apps/web/src/lib/split-router/types.ts
index b8c992d8c5..21f9e2af37 100644
--- a/apps/web/src/lib/split-router/types.ts
+++ b/apps/web/src/lib/split-router/types.ts
@@ -451,9 +451,11 @@ export type SplitRouterLayoutOpenResult<TSplitId> =
export interface SplitRouterLayout<TSplitId> {
snapshot(): SplitRouterLayoutSnapshot<TSplitId>;
+ /** The replace flag controls split history when mounted content changes. */
updateCurrentLocation(
splitId: TSplitId,
- update: (current: SplitRouterLayoutEntry<TSplitId>) => SplitLocation
+ update: (current: SplitRouterLayoutEntry<TSplitId>) => SplitLocation,
+ replace?: boolean
): void;
open(request: {
location: SplitLocation;
diff --git a/apps/web/src/lib/utils/favorites.test.ts b/apps/web/src/lib/utils/favorites.test.ts
new file mode 100644
index 0000000000..95ee8ba3b2
--- /dev/null
+++ b/apps/web/src/lib/utils/favorites.test.ts
@@ -0,0 +1,50 @@
+import type { Favorite } from '@service-storage/generated/schemas/favorite';
+import { describe, expect, it, vi } from 'vitest';
+import { favoriteBlockName, favoriteSplitContent } from './favorites';
+
+// Keep this routing test independent of the eager block registry and icon UI.
+vi.mock('@core/component/EntityIcon', () => ({
+ getIconConfig: vi.fn(),
+}));
+vi.mock('@core/constant/allBlocks', () => ({
+ fileTypeToBlockName: (type: string) => type,
+}));
+vi.mock('@queries/preview', () => ({
+ useItemPreview: vi.fn(),
+ isAccessiblePreviewItem: vi.fn(),
+}));
+vi.mock('@service-storage/websocket', () => ({
+ storageWS: { reconnectIfDisconnected: vi.fn() },
+ createWebSocketJob: vi.fn(),
+}));
+vi.mock('@service-connection/websocket', () => ({
+ ws: { addEventListener: vi.fn(), send: vi.fn() },
+ state: () => 'closed',
+ createConnectionBlockWebsocketEffect: vi.fn(),
+ createConnectionWebsocketEffect: vi.fn(),
+}));
+
+const pullRequestFavorite: Favorite = {
+ entityType: 'foreign_entity',
+ entityId: 'pr-1',
+ sortOrder: 0,
+ createdAt: '2026-01-01T00:00:00Z',
+};
+
+describe('foreign-entity favorites', () => {
+ it('uses the PR icon and opens the detail in the Reviews shell', () => {
+ expect(favoriteBlockName(pullRequestFavorite)).toBe('pr');
+ expect(favoriteSplitContent(pullRequestFavorite)).toEqual({
+ type: 'component',
+ id: 'reviews',
+ entryMetadata: {
+ route: {
+ matches: [
+ { id: 'view-reviews', params: {} },
+ { id: 'reviews-pr', params: { foreignEntityId: 'pr-1' } },
+ ],
+ },
+ },
+ });
+ });
+});
diff --git a/apps/web/src/lib/utils/favorites.ts b/apps/web/src/lib/utils/favorites.ts
index 277407697f..0d9b74e3a3 100644
--- a/apps/web/src/lib/utils/favorites.ts
+++ b/apps/web/src/lib/utils/favorites.ts
@@ -1,4 +1,7 @@
+import { reviewsHostedContent } from '@app/features/reviews-view/reviews-hosted-content';
import { getChannelParams } from '@block-channel/utils/link';
+import { usePrForeignEntityQuery } from '@block-pr/data/queries';
+import { prDisplayName } from '@block-pr/util/prKey';
import type { SplitContent } from '@components/app/split-layout/layoutManager';
import type { EntityIconSelector } from '@core/component/EntityIcon';
import { getIconConfig } from '@core/component/EntityIcon';
@@ -14,12 +17,13 @@ import { ChannelTypeEnum } from '@service-storage/client';
import type { Favorite } from '@service-storage/generated/schemas/favorite';
import { type Accessor, createMemo } from 'solid-js';
-/** The block to open for a favorite (also its URL type segment). */
+/** Icon and legacy block name for a favorite; hosted details use their own route. */
export function favoriteBlockName(favorite: Favorite) {
if (favorite.entityType === 'document') {
return fileTypeToBlockName(favorite.documentSubType ?? favorite.fileType);
}
if (favorite.entityType === 'email_thread') return 'email' as const;
+ if (favorite.entityType === 'foreign_entity') return 'pr' as const;
// Passes chat/channel/project/call through and remaps channel_message and
// CRM entity types to their block names.
return fileTypeToBlockName(favorite.entityType);
@@ -27,9 +31,13 @@ export function favoriteBlockName(favorite: Favorite) {
/**
* The split content that opens a favorite. Channel-message favorites open
- * their owning channel (hydrated as `channelId`) focused on the message.
+ * their owning channel; PR favorites open the Reviews detail route.
*/
export function favoriteSplitContent(favorite: Favorite): SplitContent {
+ if (favorite.entityType === 'foreign_entity') {
+ // GitHub PRs are the only foreign-entity favorites exposed by the app today.
+ return reviewsHostedContent({ type: 'pr', id: favorite.entityId })!;
+ }
if (favorite.entityType === 'channel_message' && favorite.channelId) {
return {
type: 'channel',
@@ -131,6 +139,15 @@ export function useFavoriteDmRecipientId(
* the component's lifetime (favorites lists key rows by entity, so it is).
*/
export function useFavoriteDisplayName(favorite: Favorite): Accessor<string> {
+ if (favorite.entityType === 'foreign_entity') {
+ const query = usePrForeignEntityQuery(() => favorite.entityId);
+ return () => {
+ const data = query.isPending ? undefined : query.data;
+ return data
+ ? (data.pullRequest.name ?? prDisplayName(data.prRef))
+ : favoriteDisplayName(favorite);
+ };
+ }
const entity = favoritePreviewEntity(favorite);
if (!entity) return () => favoriteDisplayName(favorite);
const [preview] = useItemPreview(() => entity);
diff --git a/docs/AGENT_GUIDE/surfaces.md b/docs/AGENT_GUIDE/surfaces.md
index acdbf43539..b9f00d6087 100644
--- a/docs/AGENT_GUIDE/surfaces.md
+++ b/docs/AGENT_GUIDE/surfaces.md
@@ -289,6 +289,11 @@ the task in a new split instead. While the list is visible, `J` and `K` move
focus without opening a task until activation. In an open task detail, they
replace it with the next or previous task in the same filtered order.
+When `enable-tasks-reviews` is enabled, `Reviews` appears above `My Tasks` as a
+shortcut to the separate Reviews view. It lists relevant open GitHub pull requests;
+selecting one opens `/app/reviews/pr/<foreignEntityId>` with a Reviews breadcrumb.
+See [Tasks](tasks.md#reviews-view) for verification.
+
The desktop `Create` → `Task` modal uses the standard dialog panel, circular
icon controls, and a pill-shaped `Create Task` button with 16px outer padding.
The mobile task drawer retains its existing layout.
@@ -830,16 +835,16 @@ Every calendar mention's hover card shows the schedule, location, organizer and
count, plus the first lines of the event description (its links open), and no last-updated
byline.
-## Pull requests — `/app/tasks/pr/<foreignEntityId>`
+## Pull requests — `/app/reviews/pr/<foreignEntityId>`
-Macro-linked GitHub pull requests open inside the Tasks shell, with a Tasks breadcrumb,
-PR title/status, GitHub action, discussion timeline, and Details/Checks side panel below
-the top bar. PRs are not tasks and do not appear in the Tasks list.
-Old `/app/pr/<foreignEntityId>` links redirect to the Tasks detail.
-Check an old link, a PR opened from a list or agent session,
-a second split, breadcrumb return, side-panel toggle, and phone layout. If cached
-GitHub data fails, the detail shows an error banner with a Retry button; pressing it
-refetches the PR without leaving the current detail.
+Macro-linked GitHub pull requests open inside the Reviews shell, with a Reviews
+breadcrumb, PR title/status, GitHub action, discussion timeline, and Details/Checks
+side panel below the top bar. PRs are not tasks and do not appear in the Tasks list.
+Copy Link from a PR in Quick Access copies `/app/reviews/pr/<foreignEntityId>`.
+Old `/app/pr/<foreignEntityId>` links redirect to Reviews. Check a copied link,
+a PR opened from a list or agent session, a second split, breadcrumb return,
+side-panel toggle, and phone layout. If no GitHub data loads, the detail shows
+an error banner with a Retry button; pressing it refetches the PR in place.
## Calls — `/app/component/calls`
diff --git a/docs/AGENT_GUIDE/tasks.md b/docs/AGENT_GUIDE/tasks.md
index 1e28ac8c3d..52c1499380 100644
--- a/docs/AGENT_GUIDE/tasks.md
+++ b/docs/AGENT_GUIDE/tasks.md
@@ -27,6 +27,47 @@ the originating tab breadcrumb, a task tab, or a tag to return to the list.
Shift-click a row or favorite to open it in a new split
instead. Keyboard list navigation only moves focus; press Enter to open the focused task.
+## Reviews view
+
+With `enable-tasks-reviews` enabled (on by default in development), a
+`Reviews` shortcut appears above `My Tasks` in the Tasks sidebar and mobile tabs.
+It opens a separate `/app/reviews` shell with `Involving me` first and selected
+by default, followed by `All PRs` and `Authored by me`. The selected tab is
+stored in the URL and survives opening a PR and returning through the breadcrumb.
+The list contains accessible GitHub pull requests of any status. `Involving me`
+uses the server's participant filter for your linked GitHub account: author,
+requested reviewer, assignee, commenter, or reviewer. Participant IDs are retained
+across partial GitHub refreshes, so this is not strictly a list of current
+review requests.
+`Authored by me` matches the linked GitHub login or user ID. If the link-status
+endpoint has no identity, the list explains why Authored by me is unavailable.
+Search, repository and author filters, and Updated/Created sort controls appear
+above the list. PR rows use the shared entity layout with selection checkboxes,
+author avatars and names, and a context menu. The current user's Macro display
+name appears when their linked GitHub identity matches the PR author; other
+authors fall back to GitHub names. The virtualized list fetches more pages as
+you scroll, including when local filtering removes most fetched rows.
+
+PR rows can be added to or removed from Favorites through their context menu or
+bulk entity actions. When at least one accessible PR is favorited, Reviews shows
+a collapsible Favorites section below the views; the section is hidden otherwise.
+Favorite rows open the PR in Reviews (Shift-click opens another split), and their
+context menu can remove the favorite. PR favorites also open in Reviews from the
+global Favorites sidebar or command menu.
+
+Select a PR to open `/app/reviews/pr/<foreignEntityId>` in the Reviews shell.
+Its breadcrumb returns to the Reviews list. Old `/app/pr/<id>` links redirect
+to the Reviews detail. When the flag is off, the Reviews shortcut is hidden,
+but copied PR detail links still work.
+
+Check all three tab URLs, author avatars and display names, row selection and
+context menu, favorites add/remove and collapse/empty visibility, filters, sort,
+illustrated empty states, loading, errors, and pagination after filtering. Use
+Open in new split from a PR row's context menu; verify the Reviews list stays in
+the original split and the PR appears beside it. Open a favorite from the global
+sidebar, return through the breadcrumb, and open a copied link in a second split.
+Use existing PRs and do not modify hosted data.
+
## Create a task
On touch devices, task creation opens in a bottom sheet with a drag handle and