@aiquants/daily-report 0.9.1 → 0.11.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/dist/client.d.mts +32 -8
- package/dist/client.d.ts +32 -8
- package/dist/client.js +5 -5
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +5 -5
- package/dist/client.mjs.map +1 -1
- package/dist/server.d.mts +43 -1
- package/dist/server.d.ts +43 -1
- package/dist/server.js +9 -9
- package/dist/server.js.map +1 -1
- package/dist/server.mjs +9 -9
- package/dist/server.mjs.map +1 -1
- package/package.json +4 -4
- package/src/client/components/daily-report-detail-list.tsx +100 -31
- package/src/client/components/daily-report-list.tsx +36 -30
- package/src/client/components/daily-report-resolved-content.tsx +10 -27
- package/src/client/components/daily-report-scroll-restoration.spec.tsx +383 -0
- package/src/server/cache.spec.ts +365 -1
- package/src/server/cache.ts +79 -3
- package/src/server/service.spec.ts +103 -1
- package/src/server/service.ts +48 -22
- package/src/server/sse-reader.spec.ts +248 -1
- package/src/server/sse-reader.ts +52 -8
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, Context
|
|
2
|
+
import { RefObject, ReactNode, Context } from 'react';
|
|
3
3
|
import { ScrollBarThumbOverlayRenderProps, ScrollPaneInertiaOptions, ScrollBarTapCircleOptions } from '@aiquants/virtualscroll';
|
|
4
4
|
import { D as DailyReportAttachmentSummary, a as DailyReportItem, b as DailyReportDetail, c as DailyReportUser } from './types-Ct1ggzy-.mjs';
|
|
5
5
|
import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-BiUnufrI.mjs';
|
|
@@ -86,19 +86,37 @@ type DailyReportCommentFormProps = {
|
|
|
86
86
|
*/
|
|
87
87
|
declare const DailyReportCommentForm: ({ reportHubId, businessDate, onAddComment }: DailyReportCommentFormProps) => react.JSX.Element;
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Scroll restore slot for DailyReportDetailList that survives tab unmounting.
|
|
91
|
+
* タブアンマウントをまたいで DailyReportDetailList のスクロール位置を持ち回る共有スロット。
|
|
92
|
+
*
|
|
93
|
+
* offset は VirtualScroll の論理座標。anchorReportHubId は「その offset を記録した時点の
|
|
94
|
+
* 選択日報」。復元はアンカーが現在の選択と一致するときだけ行う: 選択が他ビューで変わって
|
|
95
|
+
* いたら、復元よりも「選択日報へのスクロール」(既存 UX) を優先する。
|
|
96
|
+
* measuredHeights は実測カード高さ (reportHubId → px)。ピクセル復元は「保存時と同じ高さ
|
|
97
|
+
* 空間」でだけ正しいため、実測をアンマウント越しに持ち回って座標空間を保存する。
|
|
98
|
+
*/
|
|
99
|
+
type DailyReportDetailListScrollRestore = {
|
|
100
|
+
offset: number;
|
|
101
|
+
anchorReportHubId: number | null;
|
|
102
|
+
measuredHeights: Map<number, number>;
|
|
103
|
+
};
|
|
89
104
|
type DailyReportDetailListProps = {
|
|
90
105
|
dailyReportItems: DailyReportItem[];
|
|
91
106
|
userId?: string | null;
|
|
92
107
|
selectedItemId?: number | null;
|
|
93
108
|
onSelectItem?: (id: number | null) => void;
|
|
94
|
-
|
|
95
|
-
|
|
109
|
+
/**
|
|
110
|
+
* スクロール位置の共有スロット。マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
111
|
+
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止 (daily-report-list.tsx 参照)
|
|
112
|
+
*/
|
|
113
|
+
scrollRestoreRef?: RefObject<DailyReportDetailListScrollRestore>;
|
|
96
114
|
};
|
|
97
115
|
/**
|
|
98
116
|
* Daily report detail cards rendered with dynamic height virtual scroll.
|
|
99
117
|
* 動的高さの仮想スクロールで日報詳細カードを描画するコンポーネント。
|
|
100
118
|
*/
|
|
101
|
-
declare const DailyReportDetailList: ({ dailyReportItems, userId, selectedItemId, onSelectItem,
|
|
119
|
+
declare const DailyReportDetailList: ({ dailyReportItems, userId, selectedItemId, onSelectItem, scrollRestoreRef }: DailyReportDetailListProps) => react.JSX.Element;
|
|
102
120
|
|
|
103
121
|
type DailyReportEditFormProps = {
|
|
104
122
|
report: DailyReportDetail;
|
|
@@ -119,14 +137,20 @@ type DailyReportListProps = {
|
|
|
119
137
|
selectedReportHubId: number | null;
|
|
120
138
|
onSelectItem: (reportHubId: number | null) => void;
|
|
121
139
|
userId?: string | null;
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
/**
|
|
141
|
+
* タブ切替 (アンマウント) をまたいでスクロール位置を持ち回る共有スロット。
|
|
142
|
+
* 値は VirtualScroll の**論理座標** (inset 非依存。onScroll が配信する座標系)。
|
|
143
|
+
* マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
144
|
+
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止: 非制御タブでは親が
|
|
145
|
+
* 再レンダーされず、復帰マウントに古い値が渡る (実測で再現した実害バグ)
|
|
146
|
+
*/
|
|
147
|
+
scrollOffsetRef?: RefObject<number>;
|
|
124
148
|
};
|
|
125
149
|
/**
|
|
126
150
|
* Daily report list cards with key metadata and preview content via virtual scrolling.
|
|
127
151
|
* 主なメタデータと内容プレビューを仮想スクロール表示する日報リスト。
|
|
128
152
|
*/
|
|
129
|
-
declare const DailyReportList: ({ dailyReportItems, autoMarkRead, selectedReportHubId, onSelectItem, userId,
|
|
153
|
+
declare const DailyReportList: ({ dailyReportItems, autoMarkRead, selectedReportHubId, onSelectItem, userId, scrollOffsetRef }: DailyReportListProps) => react.JSX.Element;
|
|
130
154
|
|
|
131
155
|
/** ヘッダー描画スロットに渡される引数。 */
|
|
132
156
|
type DailyReportHeaderProps = {
|
|
@@ -1043,4 +1067,4 @@ declare const TAP_SCROLL_CIRCLE_OPTIONS: ScrollBarTapCircleOptions;
|
|
|
1043
1067
|
*/
|
|
1044
1068
|
declare const CONTENT_DRAG_POINTER_INPUTS: readonly ["pen", "touch"];
|
|
1045
1069
|
|
|
1046
|
-
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, type DailyReportActionContextType, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportErrorInfo, DailyReportErrorProvider, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportIdsStreamClient, type DailyReportIdsStreamClientOptions, type DailyReportIdsStreamPhase, type DailyReportIdsStreamState, DailyReportIdsStreamStatus, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, SSE_INITIAL_CONNECT_DEFER_MS, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyBroadcastReportUpdate, applyDailyReportServerUpdates, bootstrapDailyReportIdsStreamSession, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, ensureDailyReportIdsStreamSession, getCachedReport, getDailyReportIdsStreamSessionUserKey, primeDailyReportIdsStreamSession, refreshDailyReportIdsStream, registerRecentDeletion, releaseMutationLock, reloadDocument, removeDailyReportIdsStreamItem, resetDailyReportIdsStreamSessionForTesting, resolveSourceTypeConfig, retryDailyReportIdsStream, subscribeCacheReady, updateDailyReportCache, upsertDailyReportIdsStreamItem, useAnimatedNumber, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportErrorSurface, useDailyReportIdsStream, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
|
|
1070
|
+
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, type DailyReportActionContextType, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailListScrollRestore, type DailyReportDetailResource, DailyReportEditForm, type DailyReportErrorInfo, DailyReportErrorProvider, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportIdsStreamClient, type DailyReportIdsStreamClientOptions, type DailyReportIdsStreamPhase, type DailyReportIdsStreamState, DailyReportIdsStreamStatus, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, SSE_INITIAL_CONNECT_DEFER_MS, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyBroadcastReportUpdate, applyDailyReportServerUpdates, bootstrapDailyReportIdsStreamSession, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, ensureDailyReportIdsStreamSession, getCachedReport, getDailyReportIdsStreamSessionUserKey, primeDailyReportIdsStreamSession, refreshDailyReportIdsStream, registerRecentDeletion, releaseMutationLock, reloadDocument, removeDailyReportIdsStreamItem, resetDailyReportIdsStreamSessionForTesting, resolveSourceTypeConfig, retryDailyReportIdsStream, subscribeCacheReady, updateDailyReportCache, upsertDailyReportIdsStreamItem, useAnimatedNumber, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportErrorSurface, useDailyReportIdsStream, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, Context
|
|
2
|
+
import { RefObject, ReactNode, Context } from 'react';
|
|
3
3
|
import { ScrollBarThumbOverlayRenderProps, ScrollPaneInertiaOptions, ScrollBarTapCircleOptions } from '@aiquants/virtualscroll';
|
|
4
4
|
import { D as DailyReportAttachmentSummary, a as DailyReportItem, b as DailyReportDetail, c as DailyReportUser } from './types-Ct1ggzy-.js';
|
|
5
5
|
import { U as UIComment, D as DailyReportSseMessage } from './sse-schema-YZh7Pz7i.js';
|
|
@@ -86,19 +86,37 @@ type DailyReportCommentFormProps = {
|
|
|
86
86
|
*/
|
|
87
87
|
declare const DailyReportCommentForm: ({ reportHubId, businessDate, onAddComment }: DailyReportCommentFormProps) => react.JSX.Element;
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* Scroll restore slot for DailyReportDetailList that survives tab unmounting.
|
|
91
|
+
* タブアンマウントをまたいで DailyReportDetailList のスクロール位置を持ち回る共有スロット。
|
|
92
|
+
*
|
|
93
|
+
* offset は VirtualScroll の論理座標。anchorReportHubId は「その offset を記録した時点の
|
|
94
|
+
* 選択日報」。復元はアンカーが現在の選択と一致するときだけ行う: 選択が他ビューで変わって
|
|
95
|
+
* いたら、復元よりも「選択日報へのスクロール」(既存 UX) を優先する。
|
|
96
|
+
* measuredHeights は実測カード高さ (reportHubId → px)。ピクセル復元は「保存時と同じ高さ
|
|
97
|
+
* 空間」でだけ正しいため、実測をアンマウント越しに持ち回って座標空間を保存する。
|
|
98
|
+
*/
|
|
99
|
+
type DailyReportDetailListScrollRestore = {
|
|
100
|
+
offset: number;
|
|
101
|
+
anchorReportHubId: number | null;
|
|
102
|
+
measuredHeights: Map<number, number>;
|
|
103
|
+
};
|
|
89
104
|
type DailyReportDetailListProps = {
|
|
90
105
|
dailyReportItems: DailyReportItem[];
|
|
91
106
|
userId?: string | null;
|
|
92
107
|
selectedItemId?: number | null;
|
|
93
108
|
onSelectItem?: (id: number | null) => void;
|
|
94
|
-
|
|
95
|
-
|
|
109
|
+
/**
|
|
110
|
+
* スクロール位置の共有スロット。マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
111
|
+
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止 (daily-report-list.tsx 参照)
|
|
112
|
+
*/
|
|
113
|
+
scrollRestoreRef?: RefObject<DailyReportDetailListScrollRestore>;
|
|
96
114
|
};
|
|
97
115
|
/**
|
|
98
116
|
* Daily report detail cards rendered with dynamic height virtual scroll.
|
|
99
117
|
* 動的高さの仮想スクロールで日報詳細カードを描画するコンポーネント。
|
|
100
118
|
*/
|
|
101
|
-
declare const DailyReportDetailList: ({ dailyReportItems, userId, selectedItemId, onSelectItem,
|
|
119
|
+
declare const DailyReportDetailList: ({ dailyReportItems, userId, selectedItemId, onSelectItem, scrollRestoreRef }: DailyReportDetailListProps) => react.JSX.Element;
|
|
102
120
|
|
|
103
121
|
type DailyReportEditFormProps = {
|
|
104
122
|
report: DailyReportDetail;
|
|
@@ -119,14 +137,20 @@ type DailyReportListProps = {
|
|
|
119
137
|
selectedReportHubId: number | null;
|
|
120
138
|
onSelectItem: (reportHubId: number | null) => void;
|
|
121
139
|
userId?: string | null;
|
|
122
|
-
|
|
123
|
-
|
|
140
|
+
/**
|
|
141
|
+
* タブ切替 (アンマウント) をまたいでスクロール位置を持ち回る共有スロット。
|
|
142
|
+
* 値は VirtualScroll の**論理座標** (inset 非依存。onScroll が配信する座標系)。
|
|
143
|
+
* マウント時に一度だけ読み、スクロールのたびに書き戻す。
|
|
144
|
+
* ❗ 値をレンダー時に読んで props へ焼き込む方式は禁止: 非制御タブでは親が
|
|
145
|
+
* 再レンダーされず、復帰マウントに古い値が渡る (実測で再現した実害バグ)
|
|
146
|
+
*/
|
|
147
|
+
scrollOffsetRef?: RefObject<number>;
|
|
124
148
|
};
|
|
125
149
|
/**
|
|
126
150
|
* Daily report list cards with key metadata and preview content via virtual scrolling.
|
|
127
151
|
* 主なメタデータと内容プレビューを仮想スクロール表示する日報リスト。
|
|
128
152
|
*/
|
|
129
|
-
declare const DailyReportList: ({ dailyReportItems, autoMarkRead, selectedReportHubId, onSelectItem, userId,
|
|
153
|
+
declare const DailyReportList: ({ dailyReportItems, autoMarkRead, selectedReportHubId, onSelectItem, userId, scrollOffsetRef }: DailyReportListProps) => react.JSX.Element;
|
|
130
154
|
|
|
131
155
|
/** ヘッダー描画スロットに渡される引数。 */
|
|
132
156
|
type DailyReportHeaderProps = {
|
|
@@ -1043,4 +1067,4 @@ declare const TAP_SCROLL_CIRCLE_OPTIONS: ScrollBarTapCircleOptions;
|
|
|
1043
1067
|
*/
|
|
1044
1068
|
declare const CONTENT_DRAG_POINTER_INPUTS: readonly ["pen", "touch"];
|
|
1045
1069
|
|
|
1046
|
-
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, type DailyReportActionContextType, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailResource, DailyReportEditForm, type DailyReportErrorInfo, DailyReportErrorProvider, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportIdsStreamClient, type DailyReportIdsStreamClientOptions, type DailyReportIdsStreamPhase, type DailyReportIdsStreamState, DailyReportIdsStreamStatus, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, SSE_INITIAL_CONNECT_DEFER_MS, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyBroadcastReportUpdate, applyDailyReportServerUpdates, bootstrapDailyReportIdsStreamSession, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, ensureDailyReportIdsStreamSession, getCachedReport, getDailyReportIdsStreamSessionUserKey, primeDailyReportIdsStreamSession, refreshDailyReportIdsStream, registerRecentDeletion, releaseMutationLock, reloadDocument, removeDailyReportIdsStreamItem, resetDailyReportIdsStreamSessionForTesting, resolveSourceTypeConfig, retryDailyReportIdsStream, subscribeCacheReady, updateDailyReportCache, upsertDailyReportIdsStreamItem, useAnimatedNumber, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportErrorSurface, useDailyReportIdsStream, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
|
|
1070
|
+
export { BusinessDayThumbOverlay, CONTENT_DRAG_POINTER_INPUTS, DAILY_REPORT_FETCH_DEBOUNCE_MS, DEFAULT_ITEM_HEIGHT, type DailyReportActionContextType, DailyReportActionProvider, DailyReportAttachmentIndicator, DailyReportAttachmentList, DailyReportCache, type DailyReportClientConfig, type DailyReportClientConfigInput, DailyReportCommentForm, DailyReportCommentItem, DailyReportCommentList, DailyReportConfigProvider, DailyReportDetailList, type DailyReportDetailListScrollRestore, type DailyReportDetailResource, DailyReportEditForm, type DailyReportErrorInfo, DailyReportErrorProvider, type DailyReportFieldLabels, type DailyReportHeaderProps, DailyReportIdsStreamClient, type DailyReportIdsStreamClientOptions, type DailyReportIdsStreamPhase, type DailyReportIdsStreamState, DailyReportIdsStreamStatus, DailyReportList, DailyReportLoadError, DailyReportLoading, DailyReportPage, type DailyReportPageProps, DailyReportResolvedContent, EMPTY_DETAIL, EMPTY_ITEM, FAST_SCROLL_INERTIA_OPTIONS, FAST_SCROLL_WHEEL_MULTIPLIER, ITEM_CONTAINER_HEIGHT, ITEM_VERTICAL_PADDING, MAX_PREVIEW_LINES, PREFETCH_LOOKAHEAD, PREFETCH_MAX_DATES, SCROLL_BAR_WIDTH, SSE_INITIAL_CONNECT_DEFER_MS, type SourceTypeConfig, TAP_SCROLL_CIRCLE_OPTIONS, UnreadIndicator, VIRTUAL_SCROLL_OVERSCAN_COUNT, WHEEL_RESET_TIMEOUT_MS, acquireMutationLock, applyBroadcastReportUpdate, applyDailyReportServerUpdates, bootstrapDailyReportIdsStreamSession, clearDailyReportCache, createDailyReportClientLoader, dailyReportShouldRevalidate, defaultDailyReportClientConfig, defaultDailyReportFieldLabels, deleteDailyReportCache, ensureDailyReportIdsStreamSession, getCachedReport, getDailyReportIdsStreamSessionUserKey, primeDailyReportIdsStreamSession, refreshDailyReportIdsStream, registerRecentDeletion, releaseMutationLock, reloadDocument, removeDailyReportIdsStreamItem, resetDailyReportIdsStreamSessionForTesting, resolveSourceTypeConfig, retryDailyReportIdsStream, subscribeCacheReady, updateDailyReportCache, upsertDailyReportIdsStreamItem, useAnimatedNumber, useDailyReportActionContext, useDailyReportComments, useDailyReportConfig, useDailyReportDetail, useDailyReportErrorSurface, useDailyReportIdsStream, useDailyReportPrefetch, useDailyReportSseConnection, useDynamicViewportHeight, writeCache };
|