@xrn1997/dsh-session-delete 0.12.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/THIRD_PARTY_NOTICES.md +2 -2
- package/lib/client.js +7856 -5511
- package/lib/index.js +1147 -174
- package/lib/types/api/project-ranks.d.ts +3 -0
- package/lib/types/api/search.d.ts +7 -0
- package/lib/types/api/trash-rows.d.ts +1 -1
- package/lib/types/client/{batch-bar.d.ts → batch/batch-bar.d.ts} +2 -2
- package/lib/types/client/{batch-menu-item.d.ts → batch/batch-menu-item.d.ts} +1 -1
- package/lib/types/client/{batch-pick.d.ts → batch/batch-pick.d.ts} +1 -1
- package/lib/types/client/{batch-select.d.ts → batch/batch-select.d.ts} +2 -2
- package/lib/types/client/{delete-menu-item.d.ts → batch/delete-menu-item.d.ts} +1 -1
- package/lib/types/client/batch/index.d.ts +10 -0
- package/lib/types/client/{copy.d.ts → core/copy.d.ts} +41 -2
- package/lib/types/client/{receipt.d.ts → core/receipt.d.ts} +1 -1
- package/lib/types/client/{remote.d.ts → core/remote.d.ts} +23 -2
- package/lib/types/client/detail/block-render.d.ts +22 -0
- package/lib/types/client/{detail-blocks.d.ts → detail/detail-blocks.d.ts} +1 -1
- package/lib/types/client/detail/detail-style.d.ts +62 -0
- package/lib/types/client/detail/detail-text.d.ts +18 -0
- package/lib/types/client/detail/index.d.ts +17 -0
- package/lib/types/client/{markdown.d.ts → detail/markdown.d.ts} +2 -2
- package/lib/types/client/{prompt-rail.d.ts → detail/prompt-rail.d.ts} +2 -2
- package/lib/types/client/{session-detail.d.ts → detail/session-detail.d.ts} +20 -13
- package/lib/types/client/{subagent-section.d.ts → detail/subagent-section.d.ts} +2 -2
- package/lib/types/client/{use-archive-detail-reader.d.ts → detail/use-archive-detail-reader.d.ts} +2 -2
- package/lib/types/client/{use-detail-pager.d.ts → detail/use-detail-pager.d.ts} +1 -1
- package/lib/types/client/{use-detail-rail.d.ts → detail/use-detail-rail.d.ts} +3 -1
- package/lib/types/client/{use-detail-reader.d.ts → detail/use-detail-reader.d.ts} +3 -3
- package/lib/types/client/{use-prompt-rail.d.ts → detail/use-prompt-rail.d.ts} +1 -1
- package/lib/types/client/{use-trash-detail-reader.d.ts → detail/use-trash-detail-reader.d.ts} +2 -2
- package/lib/types/client/{context-menu-actions.d.ts → host/context-menu-actions.d.ts} +2 -2
- package/lib/types/client/host/guard.d.ts +16 -0
- package/lib/types/client/{host-archive-watch.d.ts → host/host-archive-watch.d.ts} +1 -1
- package/lib/types/client/host/index.d.ts +11 -0
- package/lib/types/client/panel/archive-detail.d.ts +22 -0
- package/lib/types/client/{archive-pane.d.ts → panel/archive-pane.d.ts} +28 -9
- package/lib/types/client/{detail-pane.d.ts → panel/detail-pane.d.ts} +3 -3
- package/lib/types/client/panel/index.d.ts +9 -0
- package/lib/types/client/panel/panel-tab.d.ts +61 -0
- package/lib/types/client/{session-list.d.ts → panel/session-list.d.ts} +4 -4
- package/lib/types/client/{trash-confirm.d.ts → panel/trash-confirm.d.ts} +2 -12
- package/lib/types/client/{trash-detail.d.ts → panel/trash-detail.d.ts} +10 -7
- package/lib/types/client/{trash-drop.d.ts → panel/trash-drop.d.ts} +1 -1
- package/lib/types/client/{trash-entry.d.ts → panel/trash-entry.d.ts} +2 -2
- package/lib/types/client/{trash-panel.d.ts → panel/trash-panel.d.ts} +1 -1
- package/lib/types/client/panel/trash-tab.d.ts +42 -0
- package/lib/types/client/{use-archive-panel-controller.d.ts → panel/use-archive-panel-controller.d.ts} +7 -5
- package/lib/types/client/{use-archive-query.d.ts → panel/use-archive-query.d.ts} +2 -2
- package/lib/types/client/{use-list-selection.d.ts → panel/use-list-selection.d.ts} +1 -1
- package/lib/types/client/{use-panel-child-view.d.ts → panel/use-panel-child-view.d.ts} +1 -1
- package/lib/types/client/{use-panel-tab.d.ts → panel/use-panel-tab.d.ts} +9 -12
- package/lib/types/client/{use-trash-panel-controller.d.ts → panel/use-trash-panel-controller.d.ts} +10 -4
- package/lib/types/client/{use-trash-query.d.ts → panel/use-trash-query.d.ts} +4 -4
- package/lib/types/client/panel/view-switches.d.ts +29 -0
- package/lib/types/client/scene.d.ts +8 -8
- package/lib/types/client/search/index.d.ts +12 -0
- package/lib/types/client/search/search-box.d.ts +24 -0
- package/lib/types/client/search/search-preview.d.ts +46 -0
- package/lib/types/client/search/search-results.d.ts +62 -0
- package/lib/types/client/search/search-text.d.ts +13 -0
- package/lib/types/client/search/use-search-view.d.ts +59 -0
- package/lib/types/client/search/use-search.d.ts +62 -0
- package/lib/types/client/{config-settings.d.ts → settings/config-settings.d.ts} +2 -2
- package/lib/types/client/settings/index.d.ts +8 -0
- package/lib/types/client/{maintenance-parts.d.ts → settings/maintenance-parts.d.ts} +1 -1
- package/lib/types/client/{maintenance-settings.d.ts → settings/maintenance-settings.d.ts} +1 -1
- package/lib/types/client/settings/orphan-confirm.d.ts +12 -0
- package/lib/types/client/{orphan-maintenance.d.ts → settings/orphan-maintenance.d.ts} +3 -3
- package/lib/types/client/{settings-cards.d.ts → settings/settings-cards.d.ts} +2 -2
- package/lib/types/client/{use-maintenance-section.d.ts → settings/use-maintenance-section.d.ts} +1 -1
- package/lib/types/client/{use-maintenance.d.ts → settings/use-maintenance.d.ts} +4 -4
- package/lib/types/client/{batch-selection-store.d.ts → state/batch-selection-store.d.ts} +11 -4
- package/lib/types/client/state/delete-action.d.ts +16 -0
- package/lib/types/client/{main-view.d.ts → state/main-view.d.ts} +1 -1
- package/lib/types/client/{trash-snapshot.d.ts → state/trash-snapshot.d.ts} +1 -1
- package/lib/types/client/{undo-notices.d.ts → state/undo-notices.d.ts} +9 -22
- package/lib/types/client/ui/Button.d.ts +2 -1
- package/lib/types/client/ui/ErrorBoundary.d.ts +4 -8
- package/lib/types/client/ui/Modal.d.ts +4 -3
- package/lib/types/client/ui/Toast.d.ts +13 -3
- package/lib/types/client/ui/Tooltip.d.ts +3 -2
- package/lib/types/client/ui/anchor-fit.d.ts +42 -0
- package/lib/types/client/ui/icons.d.ts +13 -2
- package/lib/types/client/ui/inert.d.ts +15 -0
- package/lib/types/client/{attachment-view.d.ts → widgets/attachment-view.d.ts} +3 -3
- package/lib/types/client/{confirm-dialog.d.ts → widgets/confirm-dialog.d.ts} +4 -0
- package/lib/types/client/{trash-view.d.ts → widgets/trash-view.d.ts} +8 -5
- package/lib/types/client/write/delete-action-host.d.ts +4 -0
- package/lib/types/client/write/index.d.ts +13 -0
- package/lib/types/client/{undo-toast.d.ts → write/undo-toast.d.ts} +2 -2
- package/lib/types/client/{use-write-progress.d.ts → write/use-write-progress.d.ts} +2 -2
- package/lib/types/client/{write-progress.d.ts → write/write-progress.d.ts} +1 -1
- package/lib/types/client/{write-seats.d.ts → write/write-seats.d.ts} +7 -15
- package/lib/types/ports/agent-handles.d.ts +2 -1
- package/lib/types/ports/host-port.d.ts +6 -1
- package/lib/types/shared/wire.d.ts +135 -3
- package/lib/types/trash/content-text.d.ts +10 -0
- package/lib/types/trash/groups.d.ts +18 -6
- package/lib/types/trash/search-corpus.d.ts +40 -0
- package/lib/types/trash/search-text.d.ts +43 -0
- package/lib/types/trash/shrinking-view.d.ts +6 -4
- package/lib/types/verbs/permanent-removal.d.ts +22 -6
- package/lib/types/verbs/search.d.ts +53 -0
- package/lib/types/verbs/trash-scope.d.ts +5 -1
- package/package.json +7 -7
- package/lib/types/client/archive-detail.d.ts +0 -19
- package/lib/types/client/delete-action.d.ts +0 -23
- package/lib/types/client/panel-tab.d.ts +0 -39
- package/lib/types/client/trash-tab.d.ts +0 -22
- package/lib/types/client/ui/Tag.d.ts +0 -16
- /package/lib/types/client/{api-base.d.ts → core/api-base.d.ts} +0 -0
- /package/lib/types/client/{context.d.ts → core/context.d.ts} +0 -0
- /package/lib/types/client/{detail-ledger.d.ts → core/detail-ledger.d.ts} +0 -0
- /package/lib/types/client/{plugin.d.ts → core/plugin.d.ts} +0 -0
- /package/lib/types/client/{use-gated-refresh.d.ts → core/use-gated-refresh.d.ts} +0 -0
- /package/lib/types/client/{use-prefetch.d.ts → core/use-prefetch.d.ts} +0 -0
- /package/lib/types/client/{store.d.ts → core/value-store.d.ts} +0 -0
- /package/lib/types/client/{use-detail-frame.d.ts → detail/use-detail-frame.d.ts} +0 -0
- /package/lib/types/client/{session-live.d.ts → host/session-live.d.ts} +0 -0
- /package/lib/types/client/{drop-machine.d.ts → panel/drop-machine.d.ts} +0 -0
- /package/lib/types/client/{trash-nav.d.ts → panel/trash-nav.d.ts} +0 -0
- /package/lib/types/client/{use-column-resize.d.ts → panel/use-column-resize.d.ts} +0 -0
- /package/lib/types/client/{use-panel-list-read.d.ts → panel/use-panel-list-read.d.ts} +0 -0
- /package/lib/types/client/{use-panel-selection.d.ts → panel/use-panel-selection.d.ts} +0 -0
- /package/lib/types/client/{use-panel-width.d.ts → panel/use-panel-width.d.ts} +0 -0
- /package/lib/types/client/{settings-view.d.ts → settings/settings-view.d.ts} +0 -0
- /package/lib/types/client/{archive-store.d.ts → state/archive-store.d.ts} +0 -0
- /package/lib/types/client/{host-rows.d.ts → state/host-rows.d.ts} +0 -0
- /package/lib/types/client/{pending-open.d.ts → state/pending-open.d.ts} +0 -0
- /package/lib/types/client/{trash-store.d.ts → state/trash-store.d.ts} +0 -0
- /package/lib/types/client/{notice.d.ts → widgets/notice.d.ts} +0 -0
- /package/lib/types/client/{busy-gate.d.ts → write/busy-gate.d.ts} +0 -0
|
@@ -3,19 +3,21 @@
|
|
|
3
3
|
* 装配线住 `use-panel-tab.ts`、四格版面住 `panel-tab.tsx`;这里只回答归档档与回收站不同的那几格。
|
|
4
4
|
*/
|
|
5
5
|
import { type RefObject } from 'react';
|
|
6
|
-
import { type Translate } from '
|
|
7
|
-
import type { ArchiveRowWire } from '
|
|
8
|
-
import { type ProjectGroup } from '
|
|
6
|
+
import { type Translate } from '../core/copy.js';
|
|
7
|
+
import type { ArchiveRowWire } from '../../shared/wire.js';
|
|
8
|
+
import { type ProjectGroup } from '../widgets/trash-view.js';
|
|
9
9
|
import { type ListDom } from './session-list.js';
|
|
10
|
-
import type { ArchiveDetailLike } from '
|
|
11
|
-
import type
|
|
10
|
+
import type { ArchiveDetailLike } from '../core/remote.js';
|
|
11
|
+
import { type ArchiveDetailSubject } from '../detail/index.js';
|
|
12
12
|
import type { ArchiveQuery } from './use-archive-query.js';
|
|
13
13
|
import type { ListSelection } from './use-list-selection.js';
|
|
14
14
|
import { type ArchivePanelController } from './use-archive-panel-controller.js';
|
|
15
15
|
import type { TrashNav } from './trash-nav.js';
|
|
16
|
-
import type { DelayedPrefetch } from '
|
|
16
|
+
import type { DelayedPrefetch } from '../core/use-prefetch.js';
|
|
17
17
|
import { type PanelTabFrameLayout } from './panel-tab.js';
|
|
18
18
|
import { type PanelTab, type PanelTabAdapter, type PanelTabContext } from './use-panel-tab.js';
|
|
19
|
+
import { type SearchInputRef } from '../search/index.js';
|
|
20
|
+
import type { PanelTabDeps } from './use-panel-tab.js';
|
|
19
21
|
/** 这一档进 DOM 的身份:行身份是会话 id(回收站那边是条目 id)。 */
|
|
20
22
|
export declare const ARCHIVE_LIST_DOM: ListDom;
|
|
21
23
|
/** 行身份:模块级稳定引用(面板把导航接在这里)。 */
|
|
@@ -26,7 +28,7 @@ export interface ArchiveListProps {
|
|
|
26
28
|
groups: readonly ProjectGroup<ArchiveRowWire>[];
|
|
27
29
|
controller: Pick<ArchivePanelController, 'selectRow' | 'unarchive' | 'deleteOne' | 'actionFailure' | 'busy'>;
|
|
28
30
|
prefetch: DelayedPrefetch<ArchiveRowWire>;
|
|
29
|
-
listRef: RefObject<HTMLDivElement>;
|
|
31
|
+
listRef: RefObject<HTMLDivElement | null>;
|
|
30
32
|
/** 键盘契约(导航状态住档的装配线,窄档下钻时清单卸载也不丢 Esc 与焦点交还)。 */
|
|
31
33
|
nav: TrashNav;
|
|
32
34
|
/** 当前活动行(选中优先,回落光标):只在非多选态参与 `aria-selected`。 */
|
|
@@ -38,9 +40,15 @@ export declare function ArchiveList({ query, selection, groups, controller, pref
|
|
|
38
40
|
export interface ArchiveToolbarProps {
|
|
39
41
|
selection: ListSelection<ArchiveRowWire>;
|
|
40
42
|
groups: readonly ProjectGroup<ArchiveRowWire>[];
|
|
43
|
+
searchQuery: string;
|
|
44
|
+
onSearchQuery: (next: string) => void;
|
|
45
|
+
searchInputRef: SearchInputRef;
|
|
41
46
|
t: Translate;
|
|
42
47
|
}
|
|
43
|
-
|
|
48
|
+
/** 工具行的**内容**(三件),容器归 `PanelTabFrame`(`toolbarAttr="archive-toolbar"`)与回收站档同一份。
|
|
49
|
+
* 不在这里再包一层:自宽 flex 包裹作为帧工具行的 flex item 会按内容宽收缩,检索框拿不到自己的
|
|
50
|
+
* 240px basis、两颗开关被压窄并左移(2026-12-02 真机反馈的「走形」)。 */
|
|
51
|
+
export declare function ArchiveToolbar({ selection, groups, searchQuery, onSearchQuery, searchInputRef, t }: ArchiveToolbarProps): import("react").JSX.Element;
|
|
44
52
|
export interface ArchiveFooterProps {
|
|
45
53
|
selection: ListSelection<ArchiveRowWire>;
|
|
46
54
|
controller: Pick<ArchivePanelController, 'unarchive' | 'deleteMany' | 'busy'>;
|
|
@@ -52,12 +60,23 @@ export declare function ArchiveFooter({ selection, controller, t }: ArchiveFoote
|
|
|
52
60
|
/** 归档档 adapter:两档差异里属于归档的那一半。 */
|
|
53
61
|
export declare const ARCHIVE_TAB_ADAPTER: PanelTabAdapter<ArchiveQuery, ArchiveRowWire, ArchiveDetailSubject, ArchiveDetailLike, ArchivePanelController>;
|
|
54
62
|
export type ArchivePanelTab = PanelTab<ArchiveQuery, ArchiveRowWire, ArchiveDetailSubject, ArchiveDetailLike, ArchivePanelController>;
|
|
63
|
+
/** 进入检索前的视图态(归档没有独立 drilled 位:选中即窄档下钻,孩子视图 id 一并存)。 */
|
|
64
|
+
export interface ArchiveSearchView {
|
|
65
|
+
readonly row: ArchiveRowWire | null;
|
|
66
|
+
readonly childSessionId: string | null;
|
|
67
|
+
}
|
|
55
68
|
export interface ArchiveTabViewProps {
|
|
56
69
|
readonly tab: ArchivePanelTab;
|
|
57
70
|
readonly layout: PanelTabFrameLayout;
|
|
71
|
+
readonly deps: PanelTabDeps;
|
|
72
|
+
readonly searchQuery: string;
|
|
73
|
+
readonly onSearchQuery: (next: string) => void;
|
|
74
|
+
readonly searchInputRef: SearchInputRef;
|
|
75
|
+
/** 面板壳持有的还原点:切档往返时视图会卸载,本地 ref 活不过去。 */
|
|
76
|
+
readonly searchRestoreRef: RefObject<ArchiveSearchView | null>;
|
|
58
77
|
readonly t: Translate;
|
|
59
78
|
}
|
|
60
79
|
/** 归档档的四格视图:清单列 / 工具行 / 页脚三件住本文件,详情 `ArchiveDetail` 原样转交;
|
|
61
80
|
* 四格容器与分栏/下钻分支由 `PanelTabFrame` 画(与回收站档同一份)。 */
|
|
62
|
-
export declare function ArchiveTabView({ tab, layout, t }: ArchiveTabViewProps): import("react").JSX.Element;
|
|
81
|
+
export declare function ArchiveTabView({ tab, layout, deps, searchQuery, onSearchQuery, searchInputRef, searchRestoreRef, t, }: ArchiveTabViewProps): import("react").JSX.Element;
|
|
63
82
|
export declare function useArchiveTab(ctx: PanelTabContext): ArchivePanelTab;
|
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
* 就是第二份事实,迟早漂开(`tests/layout-css.test.ts` 钉住这条)。
|
|
5
5
|
*/
|
|
6
6
|
import type { CSSProperties, ReactNode, RefObject } from 'react';
|
|
7
|
-
import type { Translate } from '
|
|
7
|
+
import type { Translate } from '../core/copy.js';
|
|
8
|
+
import { type DetailRail } from '../detail/index.js';
|
|
8
9
|
import type { ListDom } from './session-list.js';
|
|
9
|
-
import type { DetailRail } from './use-detail-rail.js';
|
|
10
10
|
/** 详情正文的收口宽度:中央列再宽也不把文字拉成长线。 */
|
|
11
11
|
export declare const DETAIL_TEXT_MAX_WIDTH = 860;
|
|
12
12
|
export interface DetailPaneProps {
|
|
13
13
|
/** 这一档的 DOM 身份:详情容器标成 `<kind>-detail`。 */
|
|
14
14
|
kind: ListDom['kind'];
|
|
15
15
|
/** 详情栏的滚动容器:分页 prepend 后按高度差补偿滚动位置,提问轨也按它算当前那句。 */
|
|
16
|
-
scrollRef: RefObject<HTMLDivElement>;
|
|
16
|
+
scrollRef: RefObject<HTMLDivElement | null>;
|
|
17
17
|
/** 这一档的提问轨接线(`useDetailRail`):没有轨那一拍只画正文。 */
|
|
18
18
|
rail: DetailRail;
|
|
19
19
|
children: ReactNode;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 面板模块的入口:左侧栏那一格(`sidebar.panellist`)的行与面板本体。面板骨架、两档装配线、
|
|
3
|
+
* 清单 DOM 与键盘契约、选择面、两组控制器、详情适配器、拖放与拖入回收站都在这一层的内部实现里
|
|
4
|
+
* (ADR-0060 / ADR-0065 / ADR-0071)。
|
|
5
|
+
*
|
|
6
|
+
* 外部只 import 本文件——注册处只取行组件与面板组件两颗。边界由 `tests/dependency-direction.test.ts` 钉住。
|
|
7
|
+
*/
|
|
8
|
+
export { TrashPanelIcon } from './trash-entry.js';
|
|
9
|
+
export { TrashPanel } from './trash-panel.js';
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 一档的**四格版面**:工具行 / 清单 / 详情 / 页脚。两档共用容器与分栏/下钻分支,视图件只交四个槽位与
|
|
3
|
+
* 三格布局事实。版面判据住 `docs/ui-spec.md` §3:工具行住在 body **之外**(长清单滚到底也不滚走);
|
|
4
|
+
* 两栏成立时清单可拖定宽、详情吃余下,否则铺满。工具行**不是常驻格**:清单没有行时整条不画
|
|
5
|
+
* ({@link toolbarVisible}),视图交 `null`,本组件连容器一起不渲染。返回 **fragment**(不新增 DOM 容器)。
|
|
6
|
+
*/
|
|
7
|
+
import type { ReactNode, RefObject } from 'react';
|
|
8
|
+
import type { Translate } from '../core/copy.js';
|
|
9
|
+
import type { ListDom } from './session-list.js';
|
|
10
|
+
import type { ColumnResizeHandleProps } from './use-column-resize.js';
|
|
11
|
+
import type { DetailRail } from '../detail/index.js';
|
|
12
|
+
/** 工具行出场判据的三个事实:清单这一帧有没有行、是否在多选态、有没有检索词。 */
|
|
13
|
+
export interface ToolbarVisibility {
|
|
14
|
+
/** 清单这一帧有行(`ready` 且非空)——空表 / 读失败 / 语料不可见 / 首读在飞都没有可操作的东西。 */
|
|
15
|
+
readonly hasRows: boolean;
|
|
16
|
+
readonly selectMode: boolean;
|
|
17
|
+
readonly searchQuery: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* 工具行的出场判据(两档共用,视图在交槽位前先问一次):清单**没有行**时整条工具行退场——
|
|
21
|
+
* 检索框、折叠与多选一起,连容器都不画。清单没有行还摆出整行,只会让宽档(此时不分栏)的
|
|
22
|
+
* 检索框按整块面板铺开,而折叠与多选本来也无事可做。
|
|
23
|
+
*
|
|
24
|
+
* 两个例外,各是一条出口:
|
|
25
|
+
* - **多选态**:清单被清空或读失败后「退出多选」仍要能点——退出入口只在工具行里(回收站档页脚此时也已退场);
|
|
26
|
+
* - **带检索词**:切档保留检索词,检索在填词那一刻已经跑起来;检索框是唯一可见的清空入口
|
|
27
|
+
* (结果区只有焦点在里面时的 Esc),藏掉它会把「切档 + 新档首读」变成一个没有出口的结果页。
|
|
28
|
+
*/
|
|
29
|
+
export declare function toolbarVisible({ hasRows, selectMode, searchQuery }: ToolbarVisibility): boolean;
|
|
30
|
+
/** 详情格的槽位:外壳由帧统一画,调用方只交外壳要的四格(档位、滚动容器、轨接线、正文)。 */
|
|
31
|
+
export interface PanelTabDetail {
|
|
32
|
+
readonly kind: ListDom['kind'];
|
|
33
|
+
readonly scrollRef: RefObject<HTMLDivElement | null>;
|
|
34
|
+
readonly rail: DetailRail;
|
|
35
|
+
readonly children: ReactNode;
|
|
36
|
+
}
|
|
37
|
+
/** 一档视图要的布局事实(几何住面板:断点与列宽拖拽不搬进档里;帧与视图只消费这两格)。 */
|
|
38
|
+
export interface PanelTabFrameLayout {
|
|
39
|
+
readonly listWidth: number;
|
|
40
|
+
readonly handleProps: ColumnResizeHandleProps;
|
|
41
|
+
}
|
|
42
|
+
export interface PanelTabFrameProps {
|
|
43
|
+
/** 两栏成立(宽槽 + 清单有行)。 */
|
|
44
|
+
readonly split: boolean;
|
|
45
|
+
/** 窄档下详情栏在 DOM 里(宽档恒真,本组件按 `split` 先用)。 */
|
|
46
|
+
readonly detailMounted: boolean;
|
|
47
|
+
readonly listWidth: number;
|
|
48
|
+
readonly handleProps: ColumnResizeHandleProps;
|
|
49
|
+
/** 工具行的 DOM 身份(回收站档 `trash-toolbar`、归档档 `archive-toolbar`):两档都交给帧这一层带,
|
|
50
|
+
* 档自己的视图件只交内容——再包一层自宽 flex 会按内容宽收缩,把检索框与视图开关压窄。 */
|
|
51
|
+
readonly toolbarAttr?: string;
|
|
52
|
+
/** 工具行内容;`null` = 这一帧不画工具行({@link toolbarVisible} 判为退场)——容器一并省掉,
|
|
53
|
+
* 不留一条空行。 */
|
|
54
|
+
readonly toolbar: ReactNode | null;
|
|
55
|
+
readonly list: ReactNode;
|
|
56
|
+
readonly detail: PanelTabDetail;
|
|
57
|
+
readonly footer: ReactNode;
|
|
58
|
+
readonly t: Translate;
|
|
59
|
+
}
|
|
60
|
+
/** 四格版面本体。`split` 时清单定宽 + 把手 + 详情;否则 `detailMounted` 时详情铺满,其余清单铺满。 */
|
|
61
|
+
export declare function PanelTabFrame({ split, detailMounted, listWidth, handleProps, toolbarAttr, toolbar, list, detail, footer, t, }: PanelTabFrameProps): import("react").JSX.Element;
|
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
* 底色(详情正画这一条)与 `aria-selected`(勾选集)是两套判据,互不冒充;行 id 在这侧编码,原始身份留 `dom.idAttr`。
|
|
6
6
|
*/
|
|
7
7
|
import { type ReactNode, type RefObject } from 'react';
|
|
8
|
-
import { type ProjectGroup } from '
|
|
8
|
+
import { type ProjectGroup } from '../widgets/trash-view.js';
|
|
9
9
|
import type { ListSelection } from './use-list-selection.js';
|
|
10
10
|
import type { TrashNav } from './trash-nav.js';
|
|
11
|
-
import type { DelayedPrefetch } from '
|
|
12
|
-
import type { Translate } from '
|
|
11
|
+
import type { DelayedPrefetch } from '../core/use-prefetch.js';
|
|
12
|
+
import type { Translate } from '../core/copy.js';
|
|
13
13
|
/** 一档清单进 DOM 的身份:档位名与行身份属性成对出现(`useRowFocus` 也读它)。 */
|
|
14
14
|
export interface ListDom {
|
|
15
15
|
/** 档位名前缀:拼容器/行/组头的 `data-dsh-session-delete` 与 DOM id(`sd-trash-` / `sd-archive-`)。 */
|
|
@@ -35,7 +35,7 @@ export interface SessionRowView {
|
|
|
35
35
|
readonly onSelect: () => void;
|
|
36
36
|
}
|
|
37
37
|
export interface SessionListProps<R> {
|
|
38
|
-
listRef: RefObject<HTMLDivElement>;
|
|
38
|
+
listRef: RefObject<HTMLDivElement | null>;
|
|
39
39
|
dom: ListDom;
|
|
40
40
|
gridLabel: string;
|
|
41
41
|
/** 重读在飞 ⇒ 容器 `aria-busy`(不是第四态,ADR-0048)。 */
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { type Translate } from '
|
|
2
|
-
import type {
|
|
3
|
-
import type { OneShotDeps, TrashEntryLike } from './remote.js';
|
|
1
|
+
import { type Translate } from '../core/copy.js';
|
|
2
|
+
import type { OneShotDeps, TrashEntryLike } from '../core/remote.js';
|
|
4
3
|
import type { PendingAction } from './use-trash-panel-controller.js';
|
|
5
4
|
/** 两种批量动作共用确认框壳:批量恢复把条目列成卡片(去向是每条各自的旧项目目录);批量彻底删除
|
|
6
5
|
* 只给条数——"不可恢复"那句警告才是要读的。 */
|
|
@@ -14,12 +13,3 @@ export declare function TrashConfirm({ deps, pending, restoreEntries, busy, t, o
|
|
|
14
13
|
onConfirmPurge: () => void;
|
|
15
14
|
onConfirmRestore: (ids: readonly string[]) => void;
|
|
16
15
|
}): import("react").JSX.Element;
|
|
17
|
-
/** 无主子会话的清理确认框。载荷是刚扫出来的那份报告,界面不重算。 */
|
|
18
|
-
export declare function OrphanConfirm({ deps, report, busy, t, onCancel, onConfirm, }: {
|
|
19
|
-
deps: OneShotDeps;
|
|
20
|
-
report: OrphanReportWire;
|
|
21
|
-
busy: boolean;
|
|
22
|
-
t: Translate;
|
|
23
|
-
onCancel: () => void;
|
|
24
|
-
onConfirm: () => void;
|
|
25
|
-
}): import("react").JSX.Element;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* 回收站详情块:`session-detail.tsx` 的回收站投影。取数与账本住 `use-trash-detail-reader.ts`。
|
|
3
3
|
*/
|
|
4
|
-
import type { Translate } from '
|
|
5
|
-
import type { TrashEntryWire } from '
|
|
6
|
-
import type { TrashDetailLike } from '
|
|
7
|
-
import { type DetailNav } from '
|
|
8
|
-
import type { DetailFrame } from './use-detail-frame.js';
|
|
9
|
-
import type { DetailState } from './use-detail-reader.js';
|
|
4
|
+
import type { Translate } from '../core/copy.js';
|
|
5
|
+
import type { TrashEntryWire } from '../../shared/wire.js';
|
|
6
|
+
import type { TrashDetailLike } from '../core/remote.js';
|
|
7
|
+
import { type DetailJump, type DetailNav, type DetailFrame, type DetailState } from '../detail/index.js';
|
|
10
8
|
/** 详情主体只承诺清册那一行:孩子视图看的那条不在客户端清单里,没有只读数可配对(判据住 `TrashDetailLike`);
|
|
11
9
|
* 形状与通用详情读路同为 `DetailState`。 */
|
|
12
10
|
export type TrashDetailState = DetailState<TrashEntryWire, TrashDetailLike>;
|
|
@@ -20,6 +18,11 @@ export interface TrashDetailProps {
|
|
|
20
18
|
onBack: () => void;
|
|
21
19
|
/** 孩子视图的开与回(控制器派生,判据见 `DetailNav`):缺席 = 不画入口/返回,组件只画状态,不自己造动作。 */
|
|
22
20
|
detailNav: DetailNav;
|
|
21
|
+
/** 检索跳转目标(命中块的时间与查询串):给了就对齐到命中块(只对齐、不画落地框)。 */
|
|
22
|
+
jump?: DetailJump | undefined;
|
|
23
|
+
onJumpDone?: (() => void) | undefined;
|
|
24
|
+
/** 详情头的一条明确提示(例:命中所在的子会话不在摘要里)。 */
|
|
25
|
+
notice?: string | null;
|
|
23
26
|
t: Translate;
|
|
24
27
|
}
|
|
25
|
-
export declare function TrashDetail({ frame, busy, wide, onRetry, onBack, detailNav, t, }: TrashDetailProps): import("react").JSX.Element;
|
|
28
|
+
export declare function TrashDetail({ frame, busy, wide, onRetry, onBack, detailNav, jump, onJumpDone, notice, t, }: TrashDetailProps): import("react").JSX.Element;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* 3. 多选态且拖的行在勾选集里 ⇒ `batch`(一拖删整集,items = 当前勾选集);
|
|
11
11
|
* 4. 其余 ⇒ `single`。
|
|
12
12
|
*/
|
|
13
|
-
import { type PickItem } from '
|
|
13
|
+
import { type PickItem } from '../state/batch-selection-store.js';
|
|
14
14
|
export type DropPlan =
|
|
15
15
|
/** 未登记 id / 空 payload:什么都不做。 */
|
|
16
16
|
{
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Translate } from '
|
|
2
|
-
import type { OneShotDeps } from '
|
|
1
|
+
import { type Translate } from '../core/copy.js';
|
|
2
|
+
import type { OneShotDeps } from '../core/remote.js';
|
|
3
3
|
/** 宿主 `SidebarPanelIconOwnerProps`:请求的方形边长;`deps`/`t` 由 `deps+t` 注入面给。 */
|
|
4
4
|
export interface TrashPanelIconProps {
|
|
5
5
|
size?: number | undefined;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 回收站档:adapter(两档差异的回收站那一半)+ 本档四个视图件(清单行读数 / 详情投影 / 工具行 / 页脚)。
|
|
3
|
+
* 装配线住 `use-panel-tab.ts`,四格版面住 `panel-tab.tsx`;判据与 DOM 身份不变。
|
|
4
|
+
*/
|
|
5
|
+
import { type RefObject } from 'react';
|
|
6
|
+
import { type TrashEntryWire } from '../../shared/wire.js';
|
|
7
|
+
import type { Translate } from '../core/copy.js';
|
|
8
|
+
import type { TrashDetailLike } from '../core/remote.js';
|
|
9
|
+
import type { TrashEntryLike } from '../core/remote.js';
|
|
10
|
+
import { type TrashQuery } from './use-trash-query.js';
|
|
11
|
+
import { type TrashPanelController } from './use-trash-panel-controller.js';
|
|
12
|
+
import { type PanelTab, type PanelTabAdapter, type PanelTabContext } from './use-panel-tab.js';
|
|
13
|
+
import { type PanelTabFrameLayout } from './panel-tab.js';
|
|
14
|
+
import { type SearchInputRef } from '../search/index.js';
|
|
15
|
+
import type { PanelTabDeps } from './use-panel-tab.js';
|
|
16
|
+
export declare const TRASH_TAB_ADAPTER: PanelTabAdapter<TrashQuery, TrashEntryLike, TrashEntryWire, TrashDetailLike, TrashPanelController>;
|
|
17
|
+
export type TrashPanelTab = PanelTab<TrashQuery, TrashEntryLike, TrashEntryWire, TrashDetailLike, TrashPanelController>;
|
|
18
|
+
/**
|
|
19
|
+
* 进入检索前的视图态。`childId` 必须一起存:检索前在看孩子视图时,只还原父行会把那层详情丢掉。
|
|
20
|
+
* 面板壳持有它(`searchRestoreRef`),切档卸载后仍能还原。
|
|
21
|
+
*/
|
|
22
|
+
export interface TrashSearchView {
|
|
23
|
+
readonly entry: TrashEntryLike | null;
|
|
24
|
+
readonly drilled: boolean;
|
|
25
|
+
readonly childId: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface TrashTabViewProps {
|
|
28
|
+
readonly tab: TrashPanelTab;
|
|
29
|
+
readonly layout: PanelTabFrameLayout;
|
|
30
|
+
/** 检索两段要从这里取;面板壳把同一份 deps 交下来(与装配线同源,不另造一份通道)。 */
|
|
31
|
+
readonly deps: PanelTabDeps;
|
|
32
|
+
/** 受控查询串与输入框 ref:两档共用一个检索框,查询归面板壳。 */
|
|
33
|
+
readonly searchQuery: string;
|
|
34
|
+
readonly onSearchQuery: (next: string) => void;
|
|
35
|
+
readonly searchInputRef: SearchInputRef;
|
|
36
|
+
/** 面板壳持有的还原点:切档往返时视图会卸载,本地 ref 活不过去。 */
|
|
37
|
+
readonly searchRestoreRef: RefObject<TrashSearchView | null>;
|
|
38
|
+
readonly t: Translate;
|
|
39
|
+
}
|
|
40
|
+
/** 回收站档的四格视图:清单、详情、工具行(折叠 / 多选)、页脚(「不自动过期」+ 清空 / 批量两颗)。 */
|
|
41
|
+
export declare function TrashTabView({ tab, layout, deps, searchQuery, onSearchQuery, searchInputRef, searchRestoreRef, t, }: TrashTabViewProps): import("react").JSX.Element;
|
|
42
|
+
export declare function useTrashTab(ctx: PanelTabContext): TrashPanelTab;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type { ArchiveRowWire, ArchiveSubagentWire } from '
|
|
2
|
-
import type
|
|
3
|
-
import type { Translate } from '
|
|
4
|
-
import type { ArchiveDetailLike, SessionDeleteRemote } from '
|
|
5
|
-
import type
|
|
1
|
+
import type { ArchiveRowWire, ArchiveSubagentWire } from '../../shared/wire.js';
|
|
2
|
+
import { type BusyGate } from '../write/index.js';
|
|
3
|
+
import type { Translate } from '../core/copy.js';
|
|
4
|
+
import type { ArchiveDetailLike, SessionDeleteRemote } from '../core/remote.js';
|
|
5
|
+
import { type ArchiveDetailSubject } from '../detail/index.js';
|
|
6
6
|
import { type ArchiveQuery } from './use-archive-query.js';
|
|
7
7
|
import { type PanelTabController } from './use-panel-tab.js';
|
|
8
8
|
/** 归档档离清单的孩子视图:父仍是清单选中那条已归档行,看的却是它的一个子会话。 */
|
|
@@ -19,6 +19,8 @@ export interface ArchivePanelController extends PanelTabController<ArchiveRowWir
|
|
|
19
19
|
selectRow: (row: ArchiveRowWire, options?: {
|
|
20
20
|
drill?: boolean;
|
|
21
21
|
}) => Promise<void>;
|
|
22
|
+
/** 只收选中、不动读路(清空检索还原到「原来没有选中」的清单用):与 `back()` 不同,它不关心下钻位。 */
|
|
23
|
+
drop: () => void;
|
|
22
24
|
prefetch: (sessionId: string) => void;
|
|
23
25
|
/** 单条/批量解除归档:`/apply` 的 `unarchive`,无确认框(幂等)、无撤销座位。 */
|
|
24
26
|
unarchive: (ids: readonly string[]) => Promise<void>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ArchiveRowWire } from '
|
|
2
|
-
import type { SessionDeleteRemote } from '
|
|
1
|
+
import type { ArchiveRowWire } from '../../shared/wire.js';
|
|
2
|
+
import type { SessionDeleteRemote } from '../core/remote.js';
|
|
3
3
|
export type ArchiveListState = {
|
|
4
4
|
readonly status: 'loading';
|
|
5
5
|
} | {
|
|
@@ -4,21 +4,18 @@
|
|
|
4
4
|
* (两个 `usePanelTab` 实例互不读写,ADR-0060 决定第 4 条);布局事实由面板算好交进来。
|
|
5
5
|
*/
|
|
6
6
|
import { type RefObject } from 'react';
|
|
7
|
-
import type
|
|
8
|
-
import type { Translate } from '
|
|
9
|
-
import type { SessionDeleteRemote } from '
|
|
10
|
-
import type
|
|
7
|
+
import { type BusyGate } from '../write/index.js';
|
|
8
|
+
import type { Translate } from '../core/copy.js';
|
|
9
|
+
import type { SessionDeleteRemote } from '../core/remote.js';
|
|
10
|
+
import { type DetailNav, type DetailFrame, type DetailState, type RailDetailLike } from '../detail/index.js';
|
|
11
11
|
import { type ListDom } from './session-list.js';
|
|
12
12
|
import { type TrashNav } from './trash-nav.js';
|
|
13
|
-
import type { ProjectGroup } from '
|
|
14
|
-
import { type
|
|
15
|
-
import type { DetailState } from './use-detail-reader.js';
|
|
16
|
-
import type { RailDetailLike } from './use-detail-rail.js';
|
|
17
|
-
import { type DelayedPrefetch } from './use-prefetch.js';
|
|
13
|
+
import type { ProjectGroup } from '../widgets/trash-view.js';
|
|
14
|
+
import { type DelayedPrefetch } from '../core/use-prefetch.js';
|
|
18
15
|
import { type ListSelection } from './use-list-selection.js';
|
|
19
16
|
/** 一档的依赖面:面板的两条读 + 一段 `/apply` + 清空 + 进度读(`progress` 面板自己不读,随座位的
|
|
20
17
|
* `OneShotDeps` 面向下转发,认领轮询归 `use-write-progress.ts`);控制器/查询的输入是它的窄切片。 */
|
|
21
|
-
export type PanelTabDeps = Pick<SessionDeleteRemote, 'list' | 'detail' | 'applyOutcomes' | 'emptyTrash' | 'archiveList' | 'archiveDetail' | 'progress'>;
|
|
18
|
+
export type PanelTabDeps = Pick<SessionDeleteRemote, 'list' | 'detail' | 'applyOutcomes' | 'emptyTrash' | 'archiveList' | 'archiveDetail' | 'progress' | 'search' | 'searchPreview'>;
|
|
22
19
|
/** 清单读数对视图的**共用两格**:行与「重读在飞」。空/缺/失败由各档视图按自己的状态选卡片。 */
|
|
23
20
|
export interface PanelTabListView<R> {
|
|
24
21
|
readonly rows: readonly R[] | null;
|
|
@@ -103,8 +100,8 @@ export interface PanelTab<Q, R, S, D extends RailDetailLike, C extends PanelTabC
|
|
|
103
100
|
readonly nav: TrashNav;
|
|
104
101
|
readonly prefetch: DelayedPrefetch<R>;
|
|
105
102
|
readonly frame: DetailFrame<S, D>;
|
|
106
|
-
readonly listRef: RefObject<HTMLDivElement>;
|
|
107
|
-
readonly scrollRef: RefObject<HTMLDivElement>;
|
|
103
|
+
readonly listRef: RefObject<HTMLDivElement | null>;
|
|
104
|
+
readonly scrollRef: RefObject<HTMLDivElement | null>;
|
|
108
105
|
/** 盒子够宽且清单有行:两栏成立(空态/读失败不分栏)。 */
|
|
109
106
|
readonly split: boolean;
|
|
110
107
|
/** 窄档下详情栏该不该在 DOM 里(宽档恒真)。 */
|
package/lib/types/client/{use-trash-panel-controller.d.ts → panel/use-trash-panel-controller.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type SessionDeleteRemote, type TrashDetailLike, type TrashEntryLike } from '
|
|
3
|
-
import type { TrashEntryWire } from '
|
|
1
|
+
import { type BusyGate } from '../write/index.js';
|
|
2
|
+
import { type SessionDeleteRemote, type TrashDetailLike, type TrashEntryLike } from '../core/remote.js';
|
|
3
|
+
import type { TrashEntryWire } from '../../shared/wire.js';
|
|
4
4
|
import { type PanelTabController } from './use-panel-tab.js';
|
|
5
5
|
import { type TrashQuery } from './use-trash-query.js';
|
|
6
6
|
/** 待确认的动作:一条、整个回收站、或多选一批(`ids` 已按清单顺序排好);类型归状态机。 */
|
|
@@ -19,7 +19,7 @@ export type PendingAction = {
|
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
21
|
* 控制器要的面:`query` 取清单、`reload`、清空与附件读数上屏;`ordered` 是屏幕上的顺序。
|
|
22
|
-
* 输入的引用**不需稳定**:reload 回调经 `useLatest` 读最新那一份(判据住 `store.ts`)。
|
|
22
|
+
* 输入的引用**不需稳定**:reload 回调经 `useLatest` 读最新那一份(判据住 `core/value-store.ts`)。
|
|
23
23
|
*/
|
|
24
24
|
export interface TrashPanelControllerInput {
|
|
25
25
|
/** `progress` 不在这里读:slice 按「自己读或向下转发的」收——座位吃 `OneShotDeps`(含认领轮询那一格)。 */
|
|
@@ -47,8 +47,14 @@ export interface TrashPanelController extends PanelTabController<TrashEntryLike,
|
|
|
47
47
|
select: (entry: TrashEntryLike, options?: {
|
|
48
48
|
drill?: boolean;
|
|
49
49
|
}) => Promise<void>;
|
|
50
|
+
/** 收掉窄档下钻与孩子视图(选中不动):清空检索还原「原来在清单」时不能只靠 `select`。 */
|
|
51
|
+
clearDrill: () => void;
|
|
52
|
+
/** 只收选中(不动下钻位):检索前没有选中时还原成清单。 */
|
|
53
|
+
drop: () => void;
|
|
50
54
|
/** 只热身、不改选中:hover / focus 时把详情读进账本与首帧快照。 */
|
|
51
55
|
prefetch: (entry: TrashEntryLike) => void;
|
|
56
|
+
/** 检索期间暂停把选中写进跨挂载快照:检索的临时选中不该在面板重开后冒充「上次看的那条」。 */
|
|
57
|
+
setSnapshotPaused: (paused: boolean) => void;
|
|
52
58
|
/** 构造待确认动作(唯一入口:新增一种确认只改 `PendingAction` 与确认框,不再加一串转调)。 */
|
|
53
59
|
request: (action: PendingAction) => void;
|
|
54
60
|
cancelPending: () => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { type SessionDeleteRemote, type TrashEntryLike } from '
|
|
3
|
-
import type { Translate } from '
|
|
4
|
-
import type { AttachmentCleanupWire } from '
|
|
1
|
+
import { type BusyGate, type GateRun } from '../write/index.js';
|
|
2
|
+
import { type SessionDeleteRemote, type TrashEntryLike } from '../core/remote.js';
|
|
3
|
+
import type { Translate } from '../core/copy.js';
|
|
4
|
+
import type { AttachmentCleanupWire } from '../../shared/wire.js';
|
|
5
5
|
export type TrashQueryDeps = Pick<SessionDeleteRemote, 'list' | 'emptyTrash'>;
|
|
6
6
|
/** 清单的唯一状态:加载中 / 有行 / 未知。`unknown` 不向下游交出任何行——旧行不许继续可操作。 */
|
|
7
7
|
export type TrashListState = {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 两档工具行的**视图开关**(全部折叠 / 展开、多选)——唯一实现。
|
|
3
|
+
* 两档各写一份就是「归档档工具行走形」那类漂移的温床(上一笔 `dbad2be` 的根因);这里只收状态与回调,
|
|
4
|
+
* 「进多选先清检索」归面板(只有它知道查询串)。
|
|
5
|
+
*
|
|
6
|
+
* 图标语义:
|
|
7
|
+
* - 折叠 / 展开:字形跟**当前状态**(与分组头同一规则:展开=开盖、全折叠=闭盒),文案跟**动作**;
|
|
8
|
+
* - 多选:字形跟**模式**(叠层勾选框 / 框+叉),按下态由 `.sd-toolbar` 的规则给(`aria-pressed`)。
|
|
9
|
+
*
|
|
10
|
+
* 两颗钮都钉行尾:`marginLeft: auto` 在检索框退场(多选态)时才起作用;检索框在场时它吃满余量。
|
|
11
|
+
*
|
|
12
|
+
* **禁用态**(例外帧:工具行因多选态或检索词仍在场,而清单没有行):被禁用的那颗走
|
|
13
|
+
* `.sd-toolbar .sd-icon-btn:disabled` 压暗到 0.4 且 `not-allowed`(多选态下「退出多选」保持可点)
|
|
14
|
+
* (与旧文字钮同档)。原生 disabled 按钮不吃 hover / focus,所以这时 tooltip 不出现,名字仍由
|
|
15
|
+
* `aria-label` 交给读屏——不为提示再包一层锚点(上一笔 `dbad2be` 的教训)。
|
|
16
|
+
*/
|
|
17
|
+
import type { ReactElement } from 'react';
|
|
18
|
+
import type { Translate } from '../core/copy.js';
|
|
19
|
+
export interface ViewSwitchesProps {
|
|
20
|
+
readonly allCollapsed: boolean;
|
|
21
|
+
readonly selectMode: boolean;
|
|
22
|
+
readonly collapseDisabled: boolean;
|
|
23
|
+
/** 没东西可选时不可进多选;**已经进来的**仍能退出(面板按 `!selectMode` 放行,与既有判据同一条)。 */
|
|
24
|
+
readonly selectDisabled: boolean;
|
|
25
|
+
readonly onToggleAll: () => void;
|
|
26
|
+
readonly onToggleSelect: () => void;
|
|
27
|
+
readonly t: Translate;
|
|
28
|
+
}
|
|
29
|
+
export declare function ViewSwitches({ allCollapsed, selectMode, collapseDisabled, selectDisabled, onToggleAll, onToggleSelect, t, }: ViewSwitchesProps): ReactElement;
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
* **环内模块顶层只许字面量初始化**:本文件与八个现场模块互相 import,顶层读环内导出会踩 TDZ / `undefined`。
|
|
6
6
|
*/
|
|
7
7
|
import { type ReactElement, type ReactNode } from 'react';
|
|
8
|
-
import { type ArchiveRevisionScene } from './archive-store.js';
|
|
9
|
-
import { type BatchSelectionScene } from './batch-selection-store.js';
|
|
10
|
-
import { type DeleteActionScene } from './delete-action.js';
|
|
11
|
-
import { type HostRowsScene } from './host-rows.js';
|
|
12
|
-
import { type MainViewScene } from './main-view.js';
|
|
13
|
-
import { type TrashRevisionScene } from './trash-store.js';
|
|
14
|
-
import { type TrashSnapshotScene } from './trash-snapshot.js';
|
|
15
|
-
import { type UndoNoticeScene } from './undo-notices.js';
|
|
8
|
+
import { type ArchiveRevisionScene } from './state/archive-store.js';
|
|
9
|
+
import { type BatchSelectionScene } from './state/batch-selection-store.js';
|
|
10
|
+
import { type DeleteActionScene } from './state/delete-action.js';
|
|
11
|
+
import { type HostRowsScene } from './state/host-rows.js';
|
|
12
|
+
import { type MainViewScene } from './state/main-view.js';
|
|
13
|
+
import { type TrashRevisionScene } from './state/trash-store.js';
|
|
14
|
+
import { type TrashSnapshotScene } from './state/trash-snapshot.js';
|
|
15
|
+
import { type UndoNoticeScene } from './state/undo-notices.js';
|
|
16
16
|
export interface ClientScene {
|
|
17
17
|
readonly trashRevisions: TrashRevisionScene;
|
|
18
18
|
readonly archiveRevisions: ArchiveRevisionScene;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 检索模块的入口:一条状态机(输入即切结果视图、取消走 latest-wins、写后重跑)加四件视图,
|
|
3
|
+
* 回收站与归档两档共用同一份(ADR-0075)。
|
|
4
|
+
*
|
|
5
|
+
* 外部只 import 本文件;游标续页、预览三态、命中高亮切片这些是这一层的实现细节。边界由
|
|
6
|
+
* `tests/dependency-direction.test.ts` 钉住。
|
|
7
|
+
*/
|
|
8
|
+
export { SearchBox, type SearchInputRef } from './search-box.js';
|
|
9
|
+
export { SearchPreview } from './search-preview.js';
|
|
10
|
+
export { SearchResults, resultRowsOf, type BodyResultRow, type ResultRow } from './search-results.js';
|
|
11
|
+
export { useSearch } from './use-search.js';
|
|
12
|
+
export { useSearchViewState } from './use-search-view.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 两档共用的**检索框**:放大镜 + 输入 + 清除钮。查询串归面板壳(切档保留检索词、结果按新档重算),
|
|
3
|
+
* 这里只画壳与转发输入——两档各写一份会走出两套键盘行为。
|
|
4
|
+
*
|
|
5
|
+
* `type="search"` 要留着:`role=searchbox` 是这档语义(用例按角色取框;面板拿 ref 聚焦)。WebKit / Blink 还会给
|
|
6
|
+
* **有词**的框挂一颗原生清除钮,和我们自己那颗并排长成两个 ✕。判据:语义留、第二颗 ✕ 不要——原生那颗
|
|
7
|
+
* 由 `layout.css` 的 `.sd-search-input` 规则收掉(那条只认这里交出的类名),清除只留这一个入口。
|
|
8
|
+
*
|
|
9
|
+
* `Escape` 只做一件事:有词就清空(回到清单),没词就还焦点给面板。浮层开着时由顶层浮层名单先收,
|
|
10
|
+
* 不归这里(`src/client/ui/top-layer.ts` 的判据)。
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactElement } from 'react';
|
|
13
|
+
import type { Translate } from '../core/copy.js';
|
|
14
|
+
/** 输入框 ref 的可写形态:面板要能读它来聚焦,也要让 React 在挂载/卸载时写它。 */
|
|
15
|
+
export interface SearchInputRef {
|
|
16
|
+
current: HTMLInputElement | null;
|
|
17
|
+
}
|
|
18
|
+
export interface SearchBoxProps {
|
|
19
|
+
readonly query: string;
|
|
20
|
+
readonly onQuery: (next: string) => void;
|
|
21
|
+
readonly inputRef: SearchInputRef;
|
|
22
|
+
readonly t: Translate;
|
|
23
|
+
}
|
|
24
|
+
export declare function SearchBox({ query, onQuery, inputRef, t }: SearchBoxProps): ReactElement;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 命中预览(右栏):以命中为中心的三格窗口 + 命中导航 + 动作。
|
|
3
|
+
*
|
|
4
|
+
* 三条口径:
|
|
5
|
+
* ① **只画窗口,不画整本**:命中消息是开窗文本(Node 半以命中为中心切好),邻句是截断文本。这里不做二次裁剪——
|
|
6
|
+
* 裁剪口径住在 `src/trash/search-text.ts` 一处,界面照画。
|
|
7
|
+
* ② **动作按组根**:恢复 / 彻底删除作用于**整组**(与清单行一致,见 `src/trash/groups.ts` 的 `groupOf`),
|
|
8
|
+
* 所以页头说明这条命中属于哪个会话;命中在子会话时另起一行说明「正文取自子会话日志」。
|
|
9
|
+
* ③ **危险档不用实心红**:整页唯一那块实心红留给页脚的不可恢复动作(`docs/ui-spec.md` §3),
|
|
10
|
+
* 这里的「彻底删除…」是安静的红(`QUIET_DANGER`),与行内动作同一档。
|
|
11
|
+
*/
|
|
12
|
+
import type { ReactElement, ReactNode } from 'react';
|
|
13
|
+
import type { SearchPreviewWire } from '../../shared/wire.js';
|
|
14
|
+
import type { Translate } from '../core/copy.js';
|
|
15
|
+
export interface SearchPreviewProps {
|
|
16
|
+
readonly preview: SearchPreviewWire;
|
|
17
|
+
/** 组根显示名(面板清单给的)。 */
|
|
18
|
+
readonly groupTitle: string;
|
|
19
|
+
/** 命中来自子会话(同组):头部已经画了组根名,这里只说明"正文取自子会话日志"。 */
|
|
20
|
+
readonly fromChild: boolean;
|
|
21
|
+
/** **整条会话**内的命中序号(0 起)与总数(不是搜索结果页已加载的那几条)。 */
|
|
22
|
+
readonly hitIndex: number;
|
|
23
|
+
readonly hitCount: number;
|
|
24
|
+
/** 由服务端给的相邻命中是否存在:导航是会话域事实,不拿「本页加载了几条」冒充到底。 */
|
|
25
|
+
readonly canPrev: boolean;
|
|
26
|
+
readonly canNext: boolean;
|
|
27
|
+
readonly onPrev: () => void;
|
|
28
|
+
readonly onNext: () => void;
|
|
29
|
+
readonly onOpenDetail: () => void;
|
|
30
|
+
readonly onRestore: () => void;
|
|
31
|
+
readonly onPurge: () => void;
|
|
32
|
+
/** 两颗动作的文案由调用方给:回收站档是恢复 / 彻底删除,归档档是解除归档 / 移入回收站。 */
|
|
33
|
+
readonly restoreLabel: string;
|
|
34
|
+
/** 主动作图标:缺省是回收站的「恢复」箭头;归档档换官方 `unarchive-outline`(与行内解除归档同一枚)。 */
|
|
35
|
+
readonly restoreIcon?: ReactNode;
|
|
36
|
+
readonly purgeLabel: string;
|
|
37
|
+
/** 危险档:只有**不可恢复**的动作才染红(回收站的彻底删除);归档的移入回收站可恢复,不染。 */
|
|
38
|
+
readonly purgeDanger: boolean;
|
|
39
|
+
readonly busy: boolean;
|
|
40
|
+
/** 这颗动作的失败原文(检索态替换了清单行这一落点:预览自己得像行一样把原文摆出来)。 */
|
|
41
|
+
readonly failure?: string | null;
|
|
42
|
+
/** 窄档下面板只剩这一页:给一颗「返回清单」(宽档没有这个入口)。 */
|
|
43
|
+
readonly onBack?: (() => void) | undefined;
|
|
44
|
+
readonly t: Translate;
|
|
45
|
+
}
|
|
46
|
+
export declare function SearchPreview({ preview, groupTitle, fromChild, hitIndex, hitCount, canPrev, canNext, onPrev, onNext, onOpenDetail, onRestore, onPurge, restoreLabel, restoreIcon, purgeLabel, purgeDanger, busy, failure, onBack, t, }: SearchPreviewProps): ReactElement;
|