Skip to content

Conversation

@danhilse
Copy link

@danhilse danhilse commented Sep 1, 2025

Automated PR from fork branch 'feature/note-timestamps'.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Greptile Summary

This PR implements a comprehensive date visibility toggle feature throughout the Reor application, allowing users to control when file timestamps are displayed. The implementation spans across multiple architectural layers:

Core Storage & IPC Layer: Added showFileDatesInSidebar boolean field to the electron store schema with corresponding enum key ShowFileDatesInSidebar. New IPC handlers (get-file-index-date-visibility and set-file-index-date-visibility) enable communication between the renderer and main processes, with automatic event emission to keep the UI synchronized when preferences change.

UI Components: The Files sidebar now includes a calendar icon toggle button that controls date visibility with visual feedback (opacity and color changes based on state). File rows conditionally display modification dates in MM-dd-yy format using date-fns for consistent formatting. The layout uses flexbox with space-between justification to accommodate both file names and timestamps without breaking existing drag-and-drop functionality.

Editor Integration: A new NoteTimestamps component was added to the editor interface, displaying creation and modification dates for the currently open file. Users can click to toggle between showing creation vs. modification timestamps, with proper keyboard accessibility support (Enter/Space keys).

State Management: The feature uses React hooks for local state management, electron store for persistence across sessions, and IPC event listeners for real-time synchronization. The default behavior shows dates initially (defaulting to true), giving users immediate access to temporal context while allowing them to hide this information if desired.

This change integrates seamlessly with Reor's existing architecture patterns for UI preferences, following the same approach used for document stats and editor layout settings.

Confidence score: 4/5

  • This PR is generally safe to merge with minor concerns about completeness
  • Score reflects solid implementation following existing patterns, but missing store schema migration could cause issues for existing users
  • Pay close attention to electron/main/electron-store/storeConfig.ts - the new field needs default value initialization in the schema migrator

7 files reviewed, 1 comment

Edit Code Review Bot Settings | Greptile

init()

const handler = (_e: any, val: boolean) => setShowDates(val)
window.ipcRenderer.on('file-index-date-visibility-changed', handler)
Copy link

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

Suggested change
window.ipcRenderer.on('file-index-date-visibility-changed', handler)
useEffect(() => {
const init = async () => {
const val = await window.electronStore.getFileIndexDateVisibility()
setShowDates(val)
}
init()
const handler = (_e: any, val: boolean) => setShowDates(val)
window.ipcRenderer.on('file-index-date-visibility-changed', handler)
return () => {
window.ipcRenderer.off('file-index-date-visibility-changed', handler)
}
}, [])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant