Skip to content

Commit eb98d62

Browse files
committed
Update history checkpoint descriptions to use relative time
- on checkpoint's description, after time and symbol '·', place relative time - dont's show [Pasted text] ├── apps │ └── editor │ └── src │ └── commands │ └── history-command │ ├── actions │ │ ├── clear-all-checkpoints.ts │ │ ├── create-temporary-checkpoint.ts │ │ ├── delete-checkpoint-with-undo.ts │ │ ├── restore-checkpoint.ts │ │ ├── sync-workspace-from-dir.ts │ │ ├── toggle-checkpoint-pin.ts │ │ └── update-checkpoint-description.ts │ ├── history-command.ts │ ├── index.ts │ └── utils │ └── sync-directory.ts └── packages └── ui └── src └── components └── editor └── prompt ├── Responses │ └── Responses.tsx └── Tasks └── Tasks.tsx
1 parent e8e4493 commit eb98d62

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎apps/editor/src/commands/history-command/history-command.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {
55
} from '../../constants/state-keys'
66
import { WorkspaceProvider } from '../../context/providers/workspace/workspace-provider'
77
import dayjs from 'dayjs'
8-
import localizedFormat from 'dayjs/plugin/localizedFormat'
8+
import relativeTime from 'dayjs/plugin/relativeTime'
99
import { t } from '@/i18n'
1010
import type { Checkpoint } from '@/features/checkpoints/types'
1111
import {
@@ -24,7 +24,7 @@ import { PromptViewProvider } from '@/views/prompt/backend/prompt-view-provider'
2424
import { get_checkpoint_path } from '@/features/checkpoints/utils'
2525
import { get_response_preview_promise_resolve } from '@/commands/apply-response-command/utils/preview'
2626

27-
dayjs.extend(localizedFormat)
27+
dayjs.extend(relativeTime)
2828

2929
export type { Checkpoint } from '@/features/checkpoints/types'
3030

@@ -141,7 +141,7 @@ export const history_command = (params: {
141141
return {
142142
id: c.timestamp.toString(),
143143
label: label_text,
144-
description: dayjs(c.timestamp).format('LT'),
144+
description: `${dayjs(c.timestamp).fromNow()}`,
145145
detail: c.description,
146146
checkpoint: c,
147147
buttons: [

0 commit comments

Comments
 (0)