This repository was archived by the owner on Mar 7, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 528
feat(files): add persisted date visibility toggle (calendar icon) in Files sidebar; IPC handlers and preload wiring #526
Open
danhilse
wants to merge
7
commits into
reorproject:main
Choose a base branch
from
danhilse:feature/note-timestamps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
f558feb
feat(editor): add subtle note timestamps header (Created/Updated togg…
danhilse 1f5ce90
chore(editor): adjust timestamp alignment (pl-4) for better left gutt…
danhilse 5d11519
chore(editor): adjust timestamp alignment (pl-4) for better left gutt…
danhilse 9c182d6
chore(editor): adjust timestamp alignment (pl-4) for better left gutt…
danhilse 5ecfb32
feat(files): add fixed-width, no-wrap date stamp in file list (MM-dd-…
danhilse afa9d4b
chore(files): remove 'Dates' label; show compact calendar icon toggle…
danhilse aaf4b37
feat(files): add persisted date visibility toggle (calendar icon) in …
danhilse File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import React, { useMemo, useState } from 'react' | ||
| import { format } from 'date-fns' | ||
| import { useFileContext } from '@/contexts/FileContext' | ||
|
|
||
| const NoteTimestamps: React.FC = () => { | ||
| const { currentlyOpenFilePath, vaultFilesFlattened } = useFileContext() | ||
| const [showUpdated, setShowUpdated] = useState(false) | ||
|
|
||
| const fileInfo = useMemo(() => { | ||
| if (!currentlyOpenFilePath) return null | ||
| return vaultFilesFlattened.find((f) => f.path === currentlyOpenFilePath) || null | ||
| }, [currentlyOpenFilePath, vaultFilesFlattened]) | ||
|
|
||
| if (!fileInfo) return null | ||
|
|
||
| const createdAt = fileInfo.dateCreated | ||
| const updatedAt = fileInfo.dateModified | ||
|
|
||
| const label = showUpdated ? 'Updated' : 'Created' | ||
| const date = showUpdated ? updatedAt : createdAt | ||
| const display = date instanceof Date ? format(date, 'yyyy-MM-dd HH:mm') : String(date) | ||
|
|
||
| return ( | ||
| <div | ||
| className="mb-1 mt-2 cursor-pointer select-none pl-4 text-[11px] leading-4 text-neutral-400 opacity-30 transition-opacity hover:text-neutral-300 hover:opacity-80" | ||
| onClick={() => setShowUpdated((prev) => !prev)} | ||
| role="button" | ||
| tabIndex={0} | ||
| onKeyDown={(e) => { | ||
| if (e.key === 'Enter' || e.key === ' ') setShowUpdated((prev) => !prev) | ||
| }} | ||
| > | ||
| {label}: {display} | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| export default NoteTimestamps |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Missing cleanup for IPC event listener in useEffect - should return a cleanup function to prevent memory leaks