fix: remove legacy activity history warning

This commit is contained in:
mesalogo
2026-09-08 15:56:45 +08:00
parent f95acdc000
commit 024e6fb4b2
7 changed files with 1 additions and 51 deletions
-18
View File
@@ -663,24 +663,6 @@ describe('ActivityPanel', () => {
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', () => {
render(
<ActivityPanel
-8
View File
@@ -35,7 +35,6 @@ type ActivityActorKind =
const activityRenderBatchSize = 500
export type ActivityPanelProps = {
legacyHistoryMayBeIncomplete?: boolean
projects?: readonly AssistantProject[]
records: readonly ActivityRecord[]
tokenUsage: TokenUsageSummary
@@ -240,7 +239,6 @@ function groupActivityRecordsByProject(
}
export function ActivityPanel({
legacyHistoryMayBeIncomplete = false,
projects = [],
records,
tokenUsage,
@@ -702,12 +700,6 @@ export function ActivityPanel({
scope={{ kind: 'all-projects' }}
title={t('header.title')}
/>
{legacyHistoryMayBeIncomplete && (
<p className="activity-panel__legacy-warning" role="status">
{t('records.legacyHistoryMayBeIncomplete')}
</p>
)}
<PageTabs
ariaLabel={t('tabs.ariaLabel')}
idPrefix="activity-view"
+1 -9
View File
@@ -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(
ACTIVITY_STORAGE_KEY,
JSON.stringify([
@@ -10673,14 +10673,6 @@ describe("App", () => {
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 () => {
-3
View File
@@ -10600,9 +10600,6 @@ function App(): React.JSX.Element {
}
>
<ActivityPanel
legacyHistoryMayBeIncomplete={
legacyActivityHistoryMayBeIncomplete
}
onClear={() => {
legacyActivityHistoryMayBeIncompleteRef.current = false;
setLegacyActivityHistoryMayBeIncomplete(false);
@@ -115,8 +115,6 @@ export const activity = {
unknownTime: 'Unknown time',
interruptedOnRestart:
'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:
'The scope could not be determined when this activity was recorded.',
conversation: 'Conversation: {{title}}',
@@ -111,8 +111,6 @@ export const activity = {
records: {
unknownTime: '时间未知',
interruptedOnRestart: '应用重启时此活动尚未结束。',
legacyHistoryMayBeIncomplete:
'旧版本曾限制本机运行记录的数量和详情长度,因此更早的记录或部分详情可能已经丢失。新记录会完整保存。',
unavailableScope:
'创建此活动记录时未能确定其归属范围。',
conversation: '对话:{{title}}',
-9
View File
@@ -13960,15 +13960,6 @@ details.settings-section > :not(summary) + :not(summary) {
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 {
align-self: center;
margin-top: var(--space-3);