fix: remove legacy activity history warning
This commit is contained in:
@@ -663,24 +663,6 @@ describe('ActivityPanel', () => {
|
|||||||
expect(screen.getByText('活动 500')).toBeInTheDocument()
|
expect(screen.getByText('活动 500')).toBeInTheDocument()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('warns when the migrated legacy history may already be incomplete', () => {
|
|
||||||
render(
|
|
||||||
<ActivityPanel
|
|
||||||
legacyHistoryMayBeIncomplete
|
|
||||||
onClear={vi.fn()}
|
|
||||||
onOpenConversation={vi.fn()}
|
|
||||||
records={[makeRecord(1)]}
|
|
||||||
tokenUsage={makeTokenUsage()}
|
|
||||||
/>
|
|
||||||
)
|
|
||||||
|
|
||||||
expect(
|
|
||||||
screen.getByText(
|
|
||||||
'旧版本曾限制本机运行记录的数量和详情长度,因此更早的记录或部分详情可能已经丢失。新记录会完整保存。'
|
|
||||||
)
|
|
||||||
).toHaveAttribute('role', 'status')
|
|
||||||
})
|
|
||||||
|
|
||||||
it('shows totals without double-counting cache tokens', () => {
|
it('shows totals without double-counting cache tokens', () => {
|
||||||
render(
|
render(
|
||||||
<ActivityPanel
|
<ActivityPanel
|
||||||
|
|||||||
@@ -35,7 +35,6 @@ type ActivityActorKind =
|
|||||||
const activityRenderBatchSize = 500
|
const activityRenderBatchSize = 500
|
||||||
|
|
||||||
export type ActivityPanelProps = {
|
export type ActivityPanelProps = {
|
||||||
legacyHistoryMayBeIncomplete?: boolean
|
|
||||||
projects?: readonly AssistantProject[]
|
projects?: readonly AssistantProject[]
|
||||||
records: readonly ActivityRecord[]
|
records: readonly ActivityRecord[]
|
||||||
tokenUsage: TokenUsageSummary
|
tokenUsage: TokenUsageSummary
|
||||||
@@ -240,7 +239,6 @@ function groupActivityRecordsByProject(
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function ActivityPanel({
|
export function ActivityPanel({
|
||||||
legacyHistoryMayBeIncomplete = false,
|
|
||||||
projects = [],
|
projects = [],
|
||||||
records,
|
records,
|
||||||
tokenUsage,
|
tokenUsage,
|
||||||
@@ -702,12 +700,6 @@ export function ActivityPanel({
|
|||||||
scope={{ kind: 'all-projects' }}
|
scope={{ kind: 'all-projects' }}
|
||||||
title={t('header.title')}
|
title={t('header.title')}
|
||||||
/>
|
/>
|
||||||
{legacyHistoryMayBeIncomplete && (
|
|
||||||
<p className="activity-panel__legacy-warning" role="status">
|
|
||||||
{t('records.legacyHistoryMayBeIncomplete')}
|
|
||||||
</p>
|
|
||||||
)}
|
|
||||||
|
|
||||||
<PageTabs
|
<PageTabs
|
||||||
ariaLabel={t('tabs.ariaLabel')}
|
ariaLabel={t('tabs.ariaLabel')}
|
||||||
idPrefix="activity-view"
|
idPrefix="activity-view"
|
||||||
|
|||||||
@@ -10639,7 +10639,7 @@ describe("App", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("migrates legacy activity and keeps its possible-loss warning visible", async () => {
|
it("migrates legacy activity", async () => {
|
||||||
localStorage.setItem(
|
localStorage.setItem(
|
||||||
ACTIVITY_STORAGE_KEY,
|
ACTIVITY_STORAGE_KEY,
|
||||||
JSON.stringify([
|
JSON.stringify([
|
||||||
@@ -10673,14 +10673,6 @@ describe("App", () => {
|
|||||||
expect(localStorage.getItem(ACTIVITY_STORAGE_KEY)).toBeNull();
|
expect(localStorage.getItem(ACTIVITY_STORAGE_KEY)).toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
fireEvent.click(screen.getByRole("button", { name: "运行记录" }));
|
|
||||||
expect(
|
|
||||||
await screen.findByText(
|
|
||||||
"旧版本曾限制本机运行记录的数量和详情长度,因此更早的记录或部分详情可能已经丢失。新记录会完整保存。",
|
|
||||||
{},
|
|
||||||
{ timeout: 3_000 },
|
|
||||||
),
|
|
||||||
).toBeInTheDocument();
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it("marks the current primary navigation page and hides decorative icons", async () => {
|
it("marks the current primary navigation page and hides decorative icons", async () => {
|
||||||
|
|||||||
@@ -10600,9 +10600,6 @@ function App(): React.JSX.Element {
|
|||||||
}
|
}
|
||||||
>
|
>
|
||||||
<ActivityPanel
|
<ActivityPanel
|
||||||
legacyHistoryMayBeIncomplete={
|
|
||||||
legacyActivityHistoryMayBeIncomplete
|
|
||||||
}
|
|
||||||
onClear={() => {
|
onClear={() => {
|
||||||
legacyActivityHistoryMayBeIncompleteRef.current = false;
|
legacyActivityHistoryMayBeIncompleteRef.current = false;
|
||||||
setLegacyActivityHistoryMayBeIncomplete(false);
|
setLegacyActivityHistoryMayBeIncomplete(false);
|
||||||
|
|||||||
@@ -115,8 +115,6 @@ export const activity = {
|
|||||||
unknownTime: 'Unknown time',
|
unknownTime: 'Unknown time',
|
||||||
interruptedOnRestart:
|
interruptedOnRestart:
|
||||||
'This activity had not finished when the app restarted.',
|
'This activity had not finished when the app restarted.',
|
||||||
legacyHistoryMayBeIncomplete:
|
|
||||||
'Older versions limited local run history and detail length, so earlier records or parts of their details may already be missing. New records are saved in full.',
|
|
||||||
unavailableScope:
|
unavailableScope:
|
||||||
'The scope could not be determined when this activity was recorded.',
|
'The scope could not be determined when this activity was recorded.',
|
||||||
conversation: 'Conversation: {{title}}',
|
conversation: 'Conversation: {{title}}',
|
||||||
|
|||||||
@@ -111,8 +111,6 @@ export const activity = {
|
|||||||
records: {
|
records: {
|
||||||
unknownTime: '时间未知',
|
unknownTime: '时间未知',
|
||||||
interruptedOnRestart: '应用重启时此活动尚未结束。',
|
interruptedOnRestart: '应用重启时此活动尚未结束。',
|
||||||
legacyHistoryMayBeIncomplete:
|
|
||||||
'旧版本曾限制本机运行记录的数量和详情长度,因此更早的记录或部分详情可能已经丢失。新记录会完整保存。',
|
|
||||||
unavailableScope:
|
unavailableScope:
|
||||||
'创建此活动记录时未能确定其归属范围。',
|
'创建此活动记录时未能确定其归属范围。',
|
||||||
conversation: '对话:{{title}}',
|
conversation: '对话:{{title}}',
|
||||||
|
|||||||
@@ -13960,15 +13960,6 @@ details.settings-section > :not(summary) + :not(summary) {
|
|||||||
padding: var(--space-4) 0;
|
padding: var(--space-4) 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.activity-panel__legacy-warning {
|
|
||||||
margin: var(--space-3) 0 0;
|
|
||||||
padding: var(--space-3);
|
|
||||||
border: 1px solid color-mix(in srgb, var(--warning) 45%, transparent);
|
|
||||||
border-radius: var(--radius-md);
|
|
||||||
background: color-mix(in srgb, var(--warning) 10%, transparent);
|
|
||||||
color: var(--text-secondary);
|
|
||||||
}
|
|
||||||
|
|
||||||
.activity-panel__load-more {
|
.activity-panel__load-more {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-top: var(--space-3);
|
margin-top: var(--space-3);
|
||||||
|
|||||||
Reference in New Issue
Block a user