🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
✨ feat(acceptance): give /acceptance a shell top bar and move the list into a drawer (#19149)
Arvin Xu2acb5c9b3bb4
diff --git a/locales/en-US/verify.json b/locales/en-US/verify.jsonindex f76a00fe1b7..067c3ed29df 100644--- a/locales/en-US/verify.json+++ b/locales/en-US/verify.json@@ -207,6 +207,8 @@"acceptance.sharedNotice.reviewableDescription": "You can browse every check and its evidence, and review them on behalf of your workspace.","acceptance.sharedNotice.title": "Shared with you","acceptance.sharedNotice.titleWithName": "Shared by {{name}}",+ "acceptance.shell.back": "Back",+ "acceptance.shell.menu": "Show deliveries","acceptance.stats.failed": "{{count}} failed","acceptance.stats.notExecuted": "{{count}} not executed","acceptance.stats.passed": "{{count}} passed",@@ -284,7 +286,7 @@"acceptance.workspace.deleteConfirmTitle": "Delete acceptance","acceptance.workspace.deleteError": "Failed to delete acceptance","acceptance.workspace.deleteSuccess": "Acceptance deleted",- "acceptance.workspace.emptyDetail.description": "Pick an acceptance on the left to review its checks, rounds and evidence.",+ "acceptance.workspace.emptyDetail.description": "Open the deliveries menu to pick a record and inspect its checks, rounds and evidence.","acceptance.workspace.emptyDetail.title": "Select an acceptance","acceptance.workspace.filters.active": "In progress","acceptance.workspace.filters.all": "All acceptances",diff --git a/locales/zh-CN/verify.json b/locales/zh-CN/verify.jsonindex c6fb4e45dd8..035f5a181d0 100644--- a/locales/zh-CN/verify.json+++ b/locales/zh-CN/verify.json@@ -207,6 +207,8 @@"acceptance.sharedNotice.reviewableDescription": "你可以查看所有检查项及其证据,并代表你的工作区参与评审。","acceptance.sharedNotice.title": "来自他人的分享","acceptance.sharedNotice.titleWithName": "来自 {{name}} 的分享",+ "acceptance.shell.back": "返回",+ "acceptance.shell.menu": "查看交付列表","acceptance.stats.failed": "{{count}} 失败","acceptance.stats.notExecuted": "{{count}} 未执行","acceptance.stats.passed": "{{count}} 通过",@@ -284,7 +286,7 @@"acceptance.workspace.deleteConfirmTitle": "删除验收","acceptance.workspace.deleteError": "删除验收失败","acceptance.workspace.deleteSuccess": "验收已删除",- "acceptance.workspace.emptyDetail.description": "在左侧选择一条验收记录,查看它的检查项、轮次与证据。",+ "acceptance.workspace.emptyDetail.description": "打开交付列表,选择一条验收记录,查看它的检查项、轮次与证据。","acceptance.workspace.emptyDetail.title": "选择一条验收","acceptance.workspace.filters.active": "进行中","acceptance.workspace.filters.all": "全部验收",diff --git a/packages/locales/src/default/verify.ts b/packages/locales/src/default/verify.tsindex 6647b12f3a6..7c69c22bba5 100644--- a/packages/locales/src/default/verify.ts+++ b/packages/locales/src/default/verify.ts@@ -255,6 +255,8 @@ export default {'acceptance.status.rejected': 'Delivery rejected','acceptance.status.repairing': 'Repair in progress','acceptance.status.verifying': 'Verification in progress',+ 'acceptance.shell.back': 'Back',+ 'acceptance.shell.menu': 'Show deliveries','acceptance.subject.document': 'Document','acceptance.subject.standalone': 'Standalone','acceptance.subject.task': 'Task',@@ -325,7 +327,7 @@ export default {'acceptance.workspace.deleteError': 'Failed to delete acceptance','acceptance.workspace.deleteSuccess': 'Acceptance deleted','acceptance.workspace.emptyDetail.description':- 'Pick an acceptance on the left to review its checks, rounds and evidence.',+ 'Open the deliveries menu to pick a record and inspect its checks, rounds and evidence.','acceptance.workspace.emptyDetail.title': 'Select an acceptance','acceptance.workspace.filters.active': 'In progress','acceptance.workspace.filters.all': 'All acceptances',diff --git a/src/features/Acceptance/Workspace/AcceptanceListPanel.tsx b/src/features/Acceptance/Workspace/AcceptanceListPanel.tsxindex f98d795ff15..f76b663f661 100644--- a/src/features/Acceptance/Workspace/AcceptanceListPanel.tsx+++ b/src/features/Acceptance/Workspace/AcceptanceListPanel.tsx@@ -271,6 +271,12 @@ const styles = createStaticStyles(({ css }) => ({interface AcceptanceListPanelProps extends ReportPanelExpand {headerLeading?: ReactNode;+ /**+ * Rendered inside a host that already supplies the collection title and the+ * way to dismiss it (the shell top bar plus its drawer). Drops the panel's+ * own resizable frame and title row so the title is not stated twice.+ */+ hosted?: boolean;/*** The per-project entries, as MENU ITEMS. Injected by the main app rather* than imported here: they open the create-project modal and navigate to@@ -289,7 +295,7 @@ interface AcceptanceListPanelProps extends ReportPanelExpand {* same persisted panel-width preference so the two surfaces read as one family.*/const AcceptanceListPanel = memo<AcceptanceListPanelProps>(- ({ expand, headerLeading, isNarrow, projectActionItems, projectId, setExpand }) => {+ ({ expand, headerLeading, hosted, isNarrow, projectActionItems, projectId, setExpand }) => {const { t } = useTranslation('verify');const navigate = useNavigate();const { acceptanceId } = useParams<{ acceptanceId: string }>();@@ -666,21 +672,10 @@ const AcceptanceListPanel = memo<AcceptanceListPanelProps>(updateSystemStatus({ verifyReportPanelWidth: w });};- return (- <DraggablePanel- className={styles.panel}- defaultSize={{ width: panelWidth }}- expand={expand}- maxWidth={PANEL_MAX}- minWidth={PANEL_MIN}- mode={isNarrow ? 'float' : 'fixed'}- placement={'left'}- size={{ height: '100%', width: panelWidth }}- onExpandChange={setExpand}- onSizeChange={handleSizeChange}- >- <DraggablePanelContainer style={{ flex: 'none', height: '100%', minWidth: PANEL_MIN }}>- <div className={headerLeading ? styles.headWithBrand : styles.head}>+ const body = (+ <>+ <div className={headerLeading ? styles.headWithBrand : styles.head}>+ {!hosted && (<div className={headerLeading ? styles.titleRowWithBrand : styles.titleRow}><Flexboxhorizontal@@ -711,203 +706,227 @@ const AcceptanceListPanel = memo<AcceptanceListPanelProps>(<Icon icon={PanelLeftClose} size={16} /></button></div>- <div className={styles.searchRow}>- <label className={styles.search}>- <Icon icon={Search} size={13} />- <input- placeholder={t('workspace.search')}- type={'search'}- value={query}- onChange={(e) => setQuery(e.target.value)}- />- </label>- <DropdownMenu items={filterItems} placement={'bottomRight'}>- <ActionIcon- active={filter !== 'all'}- className={styles.filterButton}- icon={ListFilter}- size={'small'}- title={t('acceptance.workspace.filters.title')}- />- </DropdownMenu>- <DropdownMenu items={overflowItems} placement={'bottomRight'}>- <ActionIcon- active={selecting}- className={styles.filterButton}- icon={MoreHorizontal}- size={'small'}- title={t('acceptance.workspace.actions.more')}- />- </DropdownMenu>+ )}+ <div className={styles.searchRow}>+ <label className={styles.search}>+ <Icon icon={Search} size={13} />+ <input+ placeholder={t('workspace.search')}+ type={'search'}+ value={query}+ onChange={(e) => setQuery(e.target.value)}+ />+ </label>+ <DropdownMenu items={filterItems} placement={'bottomRight'}>+ <ActionIcon+ active={filter !== 'all'}+ className={styles.filterButton}+ icon={ListFilter}+ size={'small'}+ title={t('acceptance.workspace.filters.title')}+ />+ </DropdownMenu>+ <DropdownMenu items={overflowItems} placement={'bottomRight'}>+ <ActionIcon+ active={selecting}+ className={styles.filterButton}+ icon={MoreHorizontal}+ size={'small'}+ title={t('acceptance.workspace.actions.more')}+ />+ </DropdownMenu>+ </div>+ {selecting && (+ <div className={styles.selectionRow}>+ <Checkbox+ checked={selectAllState === 'all'}+ disabled={items.length === 0}+ indeterminate={selectAllState === 'partial'}+ onChange={() => setSelected((previous) => nextAcceptanceSelectAll(previous, items))}+ >+ {t('acceptance.workspace.batch.selectAll')}+ </Checkbox>+ <Flexbox flex={1} />+ <Text fontSize={12} type={'secondary'}>+ {t('acceptance.workspace.batch.selected', { count: selectedVisible.length })}+ </Text>+ <Button size={'small'} type={'text'} onClick={leaveSelecting}>+ {t('acceptance.workspace.batch.exit')}+ </Button></div>- {selecting && (- <div className={styles.selectionRow}>- <Checkbox- checked={selectAllState === 'all'}- disabled={items.length === 0}- indeterminate={selectAllState === 'partial'}- onChange={() =>- setSelected((previous) => nextAcceptanceSelectAll(previous, items))- }+ )}+ </div>++ <Flexbox flex={1} style={{ minHeight: 0, overflowX: 'hidden', overflowY: 'auto' }}>+ {error ? (+ // A failed fetch must read as an error with a retry — never as an+ // empty "no acceptances" page.+ <Center className={styles.emptyState} gap={12}>+ <Empty+ description={t('workspace.loadError')}+ icon={TriangleAlert}+ title={t('workspace.loadErrorTitle')}+ />+ <button className={styles.retryBtn} type={'button'} onClick={() => void mutate()}>+ {t('workspace.retry')}+ </button>+ </Center>+ ) : isLoading ? (+ <SkeletonList rows={6} style={{ paddingBlock: 6, paddingInline: 8 }} />+ ) : items.length === 0 ? (+ emptyVariant === 'filtered' ? (+ // A zero-result FILTER must read as "no match for this query",+ // never as the first-run empty state.+ <div className={styles.searchEmpty}>+ <span className={styles.searchEmptyMsg}>+ {trimmedQuery+ ? t('acceptance.workspace.filters.noSearchResults', { query: trimmedQuery })+ : filter === 'all'+ ? null+ : t(EMPTY_FILTER_KEYS[filter])}+ </span>+ <button+ className={styles.retryBtn}+ type={'button'}+ onClick={() => {+ setQuery('');+ setStoredFilter('all');+ }}>- {t('acceptance.workspace.batch.selectAll')}- </Checkbox>- <Flexbox flex={1} />- <Text fontSize={12} type={'secondary'}>- {t('acceptance.workspace.batch.selected', { count: selectedVisible.length })}- </Text>- <Button size={'small'} type={'text'} onClick={leaveSelecting}>- {t('acceptance.workspace.batch.exit')}- </Button>+ {t('acceptance.workspace.filters.showAll')}+ </button></div>- )}- </div>-- <Flexbox flex={1} style={{ minHeight: 0, overflowX: 'hidden', overflowY: 'auto' }}>- {error ? (- // A failed fetch must read as an error with a retry — never as an- // empty "no acceptances" page.- <Center className={styles.emptyState} gap={12}>+ ) : (+ <Center className={styles.emptyState}>+ {/* The dashed circle is the acceptance "awaiting" glyph+ (AcceptanceStatusPill) — the domain's own mark, not the+ generic inbox. */}<Empty- description={t('workspace.loadError')}- icon={TriangleAlert}- title={t('workspace.loadErrorTitle')}+ description={t('acceptance.workspace.listEmpty')}+ icon={CircleDashed}+ title={t('acceptance.workspace.listEmptyTitle')}/>- <button className={styles.retryBtn} type={'button'} onClick={() => void mutate()}>- {t('workspace.retry')}- </button></Center>- ) : isLoading ? (- <SkeletonList rows={6} style={{ paddingBlock: 6, paddingInline: 8 }} />- ) : items.length === 0 ? (- emptyVariant === 'filtered' ? (- // A zero-result FILTER must read as "no match for this query",- // never as the first-run empty state.- <div className={styles.searchEmpty}>- <span className={styles.searchEmptyMsg}>- {trimmedQuery- ? t('acceptance.workspace.filters.noSearchResults', { query: trimmedQuery })- : filter === 'all'- ? null- : t(EMPTY_FILTER_KEYS[filter])}- </span>- <button- className={styles.retryBtn}- type={'button'}- onClick={() => {- setQuery('');- setStoredFilter('all');- }}- >- {t('acceptance.workspace.filters.showAll')}- </button>- </div>- ) : (- <Center className={styles.emptyState}>- {/* The dashed circle is the acceptance "awaiting" glyph- (AcceptanceStatusPill) — the domain's own mark, not the- generic inbox. */}- <Empty- description={t('acceptance.workspace.listEmpty')}- icon={CircleDashed}- title={t('acceptance.workspace.listEmptyTitle')}- />- </Center>- )- ) : (- <div className={styles.list}>- {showGroups ? (- <Accordion- expandedKeys={expandedAcceptanceGroupKeys(groups, collapsedGroups)}- gap={4}- onExpandedChange={(keys) =>- setCollapsedGroups((previous) =>- nextCollapsedGroupKeys(previous, groups, keys.map(String)),- )- }- >- {groups.map((group) => (- <AccordionItem- itemKey={group.key}- key={group.key}- paddingBlock={4}- paddingInline={8}- action={- groupMode === 'project' && projectActionItems ? (- <DropdownMenu- items={projectActionItems(group.projectName ? group.key : undefined)}- placement={'bottomRight'}- >- <ActionIcon- icon={MoreHorizontal}- size={'small'}- title={t('acceptance.workspace.groups.actions')}- />- </DropdownMenu>- ) : undefined- }- title={- <span className={styles.groupTitle}>- {/* The folder reads as "project"; a status or age+ )+ ) : (+ <div className={styles.list}>+ {showGroups ? (+ <Accordion+ expandedKeys={expandedAcceptanceGroupKeys(groups, collapsedGroups)}+ gap={4}+ onExpandedChange={(keys) =>+ setCollapsedGroups((previous) =>+ nextCollapsedGroupKeys(previous, groups, keys.map(String)),+ )+ }+ >+ {groups.map((group) => (+ <AccordionItem+ itemKey={group.key}+ key={group.key}+ paddingBlock={4}+ paddingInline={8}+ action={+ groupMode === 'project' && projectActionItems ? (+ <DropdownMenu+ items={projectActionItems(group.projectName ? group.key : undefined)}+ placement={'bottomRight'}+ >+ <ActionIcon+ icon={MoreHorizontal}+ size={'small'}+ title={t('acceptance.workspace.groups.actions')}+ />+ </DropdownMenu>+ ) : undefined+ }+ title={+ <span className={styles.groupTitle}>+ {/* The folder reads as "project"; a status or agebucket is not a folder and must not wear one. */}- {groupMode === 'project' && <Icon icon={FolderClosed} size={14} />}- <span>- {group.name ??- t(group.labelKey as 'acceptance.workspace.groups.ungrouped')}- </span>+ {groupMode === 'project' && <Icon icon={FolderClosed} size={14} />}+ <span>+ {group.name ??+ t(group.labelKey as 'acceptance.workspace.groups.ungrouped')}</span>- }- >- <div className={styles.groupList}>- {group.items.map((item) => (- <AcceptanceRow- active={item.id === acceptanceId}- item={item}- key={item.id}- showProject={showRowProject}- onChanged={mutate}- {...rowSelectionProps(item.id)}- />- ))}- </div>- </AccordionItem>- ))}- </Accordion>- ) : (- items.map((item) => (- <AcceptanceRow- active={item.id === acceptanceId}- item={item}- key={item.id}- showProject={showRowProject}- onChanged={mutate}- {...rowSelectionProps(item.id)}- />- ))- )}- {!searching && (- <>- <div ref={setSentinel} style={{ height: 1 }} />- {isLoadingMore && (- <SkeletonList rows={2} style={{ paddingBlock: 4, paddingInline: 0 }} />- )}- </>- )}- </div>- )}- </Flexbox>- {selecting && (- <AcceptanceBatchBar- acceptCount={acceptanceBatchTargets(items, selectedVisible, 'accept').length}- canRemoveProject={acceptanceProjectTargets(items, selectedVisible, null).length > 0}- closeCount={acceptanceBatchTargets(items, selectedVisible, 'close').length}- pending={batchPending || selectedVisible.length === 0}- onAccept={() => void sweepStatus('accept', 'accepted')}- onClose={() => void sweepStatus('close', 'closed')}- onDelete={deleteSelected}- onMoveToProject={(projectId) => void sweepProject(projectId)}- />+ </span>+ }+ >+ <div className={styles.groupList}>+ {group.items.map((item) => (+ <AcceptanceRow+ active={item.id === acceptanceId}+ item={item}+ key={item.id}+ showProject={showRowProject}+ onChanged={mutate}+ {...rowSelectionProps(item.id)}+ />+ ))}+ </div>+ </AccordionItem>+ ))}+ </Accordion>+ ) : (+ items.map((item) => (+ <AcceptanceRow+ active={item.id === acceptanceId}+ item={item}+ key={item.id}+ showProject={showRowProject}+ onChanged={mutate}+ {...rowSelectionProps(item.id)}+ />+ ))+ )}+ {!searching && (+ <>+ <div ref={setSentinel} style={{ height: 1 }} />+ {isLoadingMore && (+ <SkeletonList rows={2} style={{ paddingBlock: 4, paddingInline: 0 }} />+ )}+ </>+ )}+ </div>)}+ </Flexbox>+ {selecting && (+ <AcceptanceBatchBar+ acceptCount={acceptanceBatchTargets(items, selectedVisible, 'accept').length}+ canRemoveProject={acceptanceProjectTargets(items, selectedVisible, null).length > 0}+ closeCount={acceptanceBatchTargets(items, selectedVisible, 'close').length}+ pending={batchPending || selectedVisible.length === 0}+ onAccept={() => void sweepStatus('accept', 'accepted')}+ onClose={() => void sweepStatus('close', 'closed')}+ onDelete={deleteSelected}+ onMoveToProject={(projectId) => void sweepProject(projectId)}+ />+ )}+ </>+ );++ if (hosted)+ return (+ <Flexbox height={'100%'} style={{ overflow: 'hidden' }} width={'100%'}>+ {body}+ </Flexbox>+ );++ return (+ <DraggablePanel+ className={styles.panel}+ defaultSize={{ width: panelWidth }}+ expand={expand}+ maxWidth={PANEL_MAX}+ minWidth={PANEL_MIN}+ mode={isNarrow ? 'float' : 'fixed'}+ placement={'left'}+ size={{ height: '100%', width: panelWidth }}+ onExpandChange={setExpand}+ onSizeChange={handleSizeChange}+ >+ <DraggablePanelContainer style={{ flex: 'none', height: '100%', minWidth: PANEL_MIN }}>+ {body}</DraggablePanelContainer></DraggablePanel>);diff --git a/src/features/Acceptance/Workspace/index.tsx b/src/features/Acceptance/Workspace/index.tsxindex 0c9e8f5ccfe..27a4e7b7e29 100644--- a/src/features/Acceptance/Workspace/index.tsx+++ b/src/features/Acceptance/Workspace/index.tsx@@ -1,15 +1,18 @@'use client';import { Flexbox, Icon } from '@lobehub/ui';+import { ActionIcon, Drawer } from '@lobehub/ui/base-ui';import { createStaticStyles, cssVar } from 'antd-style';-import { PanelLeftOpen } from 'lucide-react';-import { memo } from 'react';+import { Menu, PanelLeftOpen } from 'lucide-react';+import { memo, useEffect, useState } from 'react';import { useTranslation } from 'react-i18next';-import { Outlet, useParams, useSearchParams } from 'react-router';+import { Outlet, useNavigate, useParams, useSearchParams } from 'react-router';+import { ShellTopBar } from '@/features/PageShell';import { RouteMetaBridge } from '@/features/RouteMeta';import { useAcceptanceList } from '../hooks';+import { acceptanceHomePath } from '../Viewer/routes';import AcceptanceListPanel from './AcceptanceListPanel';import AcceptanceOnboarding from './AcceptanceOnboarding';import { useAcceptanceProjectActionItems } from './AcceptanceProjectActions';@@ -58,13 +61,8 @@ interface AcceptanceOnboardingState {data?: unknown[];enabled: boolean;error?: unknown;- /**- * A deep-linked `:acceptanceId` must render even when the viewer's own list- * is empty — a shared link is often the very first acceptance a user opens,- * and the install onboarding would swallow it entirely.- */hasDeepLink?: boolean;- isLoading: boolean;+ isLoading?: boolean;}export const shouldShowAcceptanceOnboarding = ({@@ -82,30 +80,68 @@ interface AcceptanceWorkspaceProps {const AcceptanceWorkspace = memo<AcceptanceWorkspaceProps>(({ projectId }) => {const { t } = useTranslation('verify');+ const navigate = useNavigate();const panel = useReportPanelExpand();const projectActionItems = useAcceptanceProjectActionItems();const { acceptanceId, checkId } = useParams<{ acceptanceId: string; checkId: string }>();const [searchParams] = useSearchParams();const hasFocusedCheck = Boolean(checkId || searchParams.get('check'));++ /**+ * Inside a project the workspace is already wearing the `(main)` shell's+ * chrome, so it keeps its inline rail. Only the standalone `/acceptance`+ * route — registered outside `(main)`, with nothing above it — grows a top+ * bar of its own, and there the list becomes a drawer so a record can own+ * the full width without the collection having to disappear to give it.+ */+ const standalone = !projectId;const showList = !hasFocusedCheck;+ const [listOpen, setListOpen] = useState(false);+ // Picking a row is what the drawer was opened to cause; once the route has+ // changed the drawer has nothing left to do.+ useEffect(() => {+ setListOpen(false);+ }, [acceptanceId]);+const {data: allAcceptances,error,isLoading,- } = useAcceptanceList(showList, {+ } = useAcceptanceList(standalone ? !acceptanceId : showList, {filter: 'all',projectId,});const isFirstUse = shouldShowAcceptanceOnboarding({data: allAcceptances,- enabled: showList && !projectId,+ enabled: standalone ? !acceptanceId : showList && !projectId,error,hasDeepLink: Boolean(acceptanceId),isLoading,});+ const topBar = standalone ? (+ <ShellTopBar+ title={t('acceptance.workspace.title')}+ titleExtra={+ <ActionIcon+ icon={Menu}+ size={'small'}+ title={t('acceptance.shell.menu')}+ onClick={() => setListOpen(true)}+ />+ }+ onBack={() => navigate(acceptanceHomePath())}+ />+ ) : null;+if (isFirstUse) {- return (+ return standalone ? (+ <Flexbox height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}>+ <RouteMetaBridge />+ {topBar}+ <AcceptanceOnboarding />+ </Flexbox>+ ) : (<><RouteMetaBridge /><AcceptanceOnboarding />@@ -113,30 +149,55 @@ const AcceptanceWorkspace = memo<AcceptanceWorkspaceProps>(({ projectId }) => {);}+ if (!standalone)+ return (+ <Flexbox horizontal height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}>+ <RouteMetaBridge />+ {showList && (+ <AcceptanceListPanel+ {...panel}+ projectActionItems={projectActionItems}+ projectId={projectId}+ />+ )}+ <div className={styles.main}>+ {showList && !panel.expand && (+ <button+ aria-label={t('workspace.expand')}+ className={styles.expandBtn}+ title={t('workspace.expand')}+ type={'button'}+ onClick={() => panel.setExpand(true)}+ >+ <Icon icon={PanelLeftOpen} size={16} />+ </button>+ )}+ <Outlet />+ </div>+ </Flexbox>+ );+return (- <Flexbox horizontal height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}>+ <Flexbox height={'100dvh'} style={{ overflow: 'hidden' }} width={'100%'}><RouteMetaBridge />- {showList && (- <AcceptanceListPanel- {...panel}- projectActionItems={projectActionItems}- projectId={projectId}- />- )}- <div className={styles.main}>- {showList && !panel.expand && (- <button- aria-label={t('workspace.expand')}- className={styles.expandBtn}- title={t('workspace.expand')}- type={'button'}- onClick={() => panel.setExpand(true)}- >- <Icon icon={PanelLeftOpen} size={16} />- </button>- )}- <Outlet />- </div>+ {topBar}+ <Drawer+ noHeader+ closable={false}+ containerMaxWidth={'100%'}+ open={listOpen}+ placement={'left'}+ styles={{ bodyContent: { height: '100%', minHeight: 0, overflow: 'hidden', padding: 0 } }}+ width={'min(360px, 88vw)'}+ onClose={() => setListOpen(false)}+ >+ <AcceptanceListPanel hosted {...panel} projectActionItems={projectActionItems} />+ </Drawer>+ <Flexbox horizontal flex={1} style={{ minHeight: 0 }} width={'100%'}>+ <div className={styles.main}>+ <Outlet />+ </div>+ </Flexbox></Flexbox>);});diff --git a/src/features/PageShell/ShellTopBar.tsx b/src/features/PageShell/ShellTopBar.tsxnew file mode 100644index 00000000000..2e7095dc307--- /dev/null+++ b/src/features/PageShell/ShellTopBar.tsx@@ -0,0 +1,146 @@+'use client';++import { Flexbox, Icon } from '@lobehub/ui';+import { Text } from '@lobehub/ui/base-ui';+import { createStaticStyles, cssVar } from 'antd-style';+import { ArrowLeft, ChevronsUpDownIcon } from 'lucide-react';+import type { ReactNode } from 'react';++import { useActiveWorkspace } from '@/business/client/hooks/useActiveWorkspace';+import { useWorkspaces } from '@/business/client/hooks/useWorkspaces';+import Avatar from '@/components/Avatar';+import { ProductLogo } from '@/components/Branding';+import UserAvatar from '@/features/User/UserAvatar';++/**+ * The application bar for pages that live OUTSIDE the main left-nav shell.+ *+ * The product's primary chrome is a vertical rail, which suits surfaces you+ * browse. A page someone was linked to needs the opposite: name the product+ * and the collection along the top edge, then get out of the way. Routes like+ * `/acceptance` are registered outside `(main)`, so without this bar they+ * begin at the very top of the window with no chrome at all — which is what+ * makes a standalone, shareable page read as an inner pane of a console.+ *+ * The bar owns no data beyond the workspace scope; the collection supplies its+ * own title, its menu, and where "back" goes.+ */+interface ShellTopBarProps {+ /** Trailing controls placed before the user avatar. */+ actions?: ReactNode;+ /**+ * Brand click target. The brand mark doubles as the way out: hovering swaps+ * it for a back arrow rather than spending a second slot on a control that+ * is only occasionally wanted.+ */+ onBack?: () => void;+ /** The collection this page belongs to, e.g. Deliveries. */+ title?: ReactNode;+ /** Sits right after the title — typically the button opening the list drawer. */+ titleExtra?: ReactNode;+}++const styles = createStaticStyles(({ css }) => ({+ back: css`+ position: absolute;+ inset: 0;++ display: grid;+ place-items: center;++ opacity: 0;+ `,+ brand: css`+ position: relative;+ inline-size: 26px;+ block-size: 26px;+ border-radius: ${cssVar.borderRadius};+ `,+ brandInteractive: css`+ cursor: pointer;++ &:hover .shell-brand-mark {+ opacity: 0;+ }++ &:hover .shell-brand-back {+ opacity: 1;+ }+ `,+ mark: css`+ position: absolute;+ inset: 0;++ display: grid;+ place-items: center;++ opacity: 1;+ `,+ root: css`+ flex: none;++ block-size: 48px;+ padding-inline: 12px;+ border-block-end: 1px solid ${cssVar.colorBorderSecondary};++ background: ${cssVar.colorBgLayout};+ `,+ scopePill: css`+ cursor: default;+ padding-block: 3px;+ padding-inline: 6px;+ border-radius: ${cssVar.borderRadius};+ `,+}));++const ShellTopBar = ({ actions, onBack, title, titleExtra }: ShellTopBarProps) => {+ const workspace = useActiveWorkspace();+ const workspaces = useWorkspaces();++ // The pill is a SCOPE SWITCHER, not an identity label. Personal scope has no+ // scope to switch to, so the bar is the product, the collection, and you.+ const switchable = workspaces.length > 1;+ const scopeName = workspace?.name;+ const scopeAvatar = workspace?.avatar || scopeName;++ return (+ <Flexbox horizontal align={'center'} className={styles.root} gap={8}>+ <div+ className={onBack ? `${styles.brand} ${styles.brandInteractive}` : styles.brand}+ onClick={onBack}+ >+ <div className={`shell-brand-mark ${styles.mark}`}>+ <ProductLogo size={22} />+ </div>+ {onBack && (+ <div className={`shell-brand-back ${styles.back}`}>+ <Icon icon={ArrowLeft} size={17} />+ </div>+ )}+ </div>++ {title && (+ <Text ellipsis fontSize={15} style={{ minWidth: 0 }} weight={600}>+ {title}+ </Text>+ )}+ {titleExtra}++ {scopeName && (+ <Flexbox horizontal align={'center'} className={styles.scopePill} gap={6}>+ <Avatar avatar={scopeAvatar} shape={'square'} size={20} />+ <Text fontSize={13} weight={600}>+ {scopeName}+ </Text>+ {switchable && <ChevronsUpDownIcon color={cssVar.colorTextQuaternary} size={12} />}+ </Flexbox>+ )}++ <Flexbox flex={1} />+ {actions}+ <UserAvatar clickable size={26} />+ </Flexbox>+ );+};++export default ShellTopBar;diff --git a/src/features/PageShell/index.ts b/src/features/PageShell/index.tsnew file mode 100644index 00000000000..881513a7e67--- /dev/null+++ b/src/features/PageShell/index.ts@@ -0,0 +1 @@+export { default as ShellTopBar } from './ShellTopBar';