Skip to content

Conversation

@jtvargas
Copy link

@jtvargas jtvargas commented Apr 13, 2025

hi :)

this pr refactors the code base to improve maintainability by reorganizing the file structure. while the core functionality remains unchanged, the new structure makes it easier to extend the tool and quickly locate code.

changes

  1. file organization

    • refactoring:
      extracted code from one monolithic file into several smaller, dedicated files.
    • updated files:
      • modified:
        • freewrite/ContentView.swift
      • new files:
        • models:
          • freewrite/models/HeartEmoji.swift – simple model for emoji animation
          • freewrite/models/HumanEntry.swift – main journal entry model
        • utilities:
          • freewrite/utils/ColorsHelper.swift – placeholder for shared color values
          • freewrite/utils/FileManagerHelper.swift – handles saving, loading, and deleting entries
          • freewrite/utils/FontExtensions.swift – font line height extension
          • freewrite/utils/NSViewExtensions.swift – helper to locate nsview subviews
        • views:
          • freewrite/views/SidebarView.swift – sidebar ui extracted into its own view
  2. additional features

    • theme structure:
      implemented support for light and dark themes, with a flexible structure that allows for additional themes in the future.
    • timer selection:
      added timer options for 25, 15, 10, and 5 minutes.
    • keyboard shortcuts (commands):
      • cmd + shift + f: toggle fullscreen
      • cmd + shift + t: toggle between themes (dark/light)
      • cmd + shift + h: toggle history
      • cmd + shift + n: create a new entry

notes

i started with simple file organization improvements, and while doing so, i also added a few features that i find useful. i hope these changes help build a cleaner and more maintainable foundation for future enhancements.

here is a video:

Freewrite-feats.mp4

@jtvargas jtvargas changed the title just add some file organization :) just add some file organization + theme dark/light + time options :) Apr 13, 2025
@jtvargas jtvargas changed the title just add some file organization + theme dark/light + time options :) Feat: file organization + theme dark/light + time options :) Apr 13, 2025
@farzaa
Copy link
Owner

farzaa commented Apr 14, 2025

JT i love this i really do

but im in a tricky place where idk how to approve this because claude wrote all the code for me initially.

also - dark mode on a different PR rn
and timer should stay the same w the scroller.

Love the shortcuts.

@farzaa farzaa added the enhancement New feature or request label Apr 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants