Skip to content

Commit d1ba216

Browse files
committed
Refactor checkpoints logic into a feature-based structure and update related UI components and translations
- `apps/editor/src/commands/checkpoints-command` should not duplicate logic present in `apps/editor/src/features/checkpoints`
1 parent a17684a commit d1ba216

24 files changed

Lines changed: 308 additions & 1975 deletions

‎apps/editor/package.json‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -674,10 +674,15 @@
674674
"group": "navigation@5"
675675
},
676676
{
677-
"command": "codeWebChat.settings",
677+
"command": "codeWebChat.checkpoints",
678678
"when": "view == codeWebChatView",
679679
"group": "navigation@1"
680680
},
681+
{
682+
"command": "codeWebChat.settings",
683+
"when": "view == codeWebChatView",
684+
"group": "navigation@2"
685+
},
681686
{
682687
"command": "codeWebChat.visitWebsite",
683688
"when": "view == codeWebChatView",

‎apps/editor/src/commands/apply-chat-response-command/apply-chat-response-command.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import * as fs from 'fs'
33
import {
44
create_checkpoint,
55
delete_checkpoint
6-
} from '../checkpoints-command/actions'
6+
} from '@/features/checkpoints/actions'
77
import { FileInPreview } from '@shared/types/file-in-preview'
8-
import { get_checkpoint_path } from '../checkpoints-command/utils'
8+
import { get_checkpoint_path } from '@/features/checkpoints/utils'
99
import { PanelProvider } from '@/views/panel/backend/panel-provider'
1010
import { dictionary } from '@shared/constants/dictionary'
1111
import { WorkspaceProvider } from '@/context/providers/workspace/workspace-provider'
@@ -20,7 +20,6 @@ import {
2020
process_chat_response,
2121
ApplyChatResponseCommandArgs
2222
} from './response-processor'
23-
import { Checkpoint } from '../checkpoints-command/types'
2423
import { CHECKPOINTS_STATE_KEY } from '@/constants/state-keys'
2524
import { ResponseHistoryItem } from '@shared/types/response-history-item'
2625
import { ApiManager } from '@/services/api-manager'
@@ -30,6 +29,7 @@ import {
3029
CwcPreviewProvider
3130
} from './utils/preview/virtual-document-provider'
3231
import { parse_response } from './utils/clipboard-parser'
32+
import { Checkpoint } from '@/features/checkpoints/types'
3333

3434
let in_progress = false
3535

apps/editor/src/commands/checkpoints-command/checkpoints-command.ts renamed to apps/editor/src/commands/checkpoints-command.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import * as vscode from 'vscode'
22
import {
33
CHECKPOINTS_STATE_KEY,
44
TEMPORARY_CHECKPOINT_STATE_KEY
5-
} from '../../constants/state-keys'
6-
import { WorkspaceProvider } from '../../context/providers/workspace/workspace-provider'
5+
} from '../constants/state-keys'
6+
import { WorkspaceProvider } from '../context/providers/workspace/workspace-provider'
77
import dayjs from 'dayjs'
88
import relativeTime from 'dayjs/plugin/relativeTime'
99
import { t } from '@/i18n'
10-
import type { Checkpoint } from './types'
10+
import type { Checkpoint } from '@/features/checkpoints/types'
1111
import {
1212
create_checkpoint,
1313
clear_all_checkpoints,
@@ -17,14 +17,14 @@ import {
1717
toggle_checkpoint_star,
1818
ActiveDeleteOperation,
1919
delete_checkpoint_with_undo
20-
} from './actions'
20+
} from '@/features/checkpoints/actions'
2121
import { PanelProvider } from '@/views/panel/backend/panel-provider'
22-
import { get_checkpoint_path } from './utils'
22+
import { get_checkpoint_path } from '@/features/checkpoints/utils'
2323
import { dictionary } from '@shared/constants/dictionary'
2424

2525
dayjs.extend(relativeTime)
2626

27-
export type { Checkpoint } from './types'
27+
export type { Checkpoint } from '@/features/checkpoints/types'
2828

2929
export const checkpoints_command = (params: {
3030
context: vscode.ExtensionContext

‎apps/editor/src/commands/checkpoints-command/actions/clear-all-checkpoints.ts‎

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)