Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the extension writes too much on the disk #43

Closed
9 tasks done
maoschanz opened this issue May 26, 2020 · 0 comments
Closed
9 tasks done

the extension writes too much on the disk #43

maoschanz opened this issue May 26, 2020 · 0 comments
Assignees

Comments

@maoschanz
Copy link
Owner

maoschanz commented May 26, 2020

the NotesButton class should be a NotesManager with object-oriented meaningful ways to track the files that exist, and read and write them individually when needed, instead of erasing and re-creating every files at each change

  • object-oriented NotesManager singleton
    • no "global" functions, the world has evolved past the need for "global" functions
    • signals as an attribute
    • distinction between public and private methods
    • "all_notes" array as an attribute
  • when deleting a note, (instead of restacking the whole array,) provide the removed id as an argument of NotesManager.postDelete and rename only the files of 1 note
  • rewrite the spaghetti mess in noteBox.js
    • yeet the most useless methods
    • distinction between public and private methods
    • [ ] yeet the alternative headerbars and use modal dialogs maybe not a great UX
  • no need to save the metadata each time, no one care if they're lost
  • add a delay before saving the notes, so it freezes the computer after the notes are hidden
  • ...more?
maoschanz referenced this issue Jun 5, 2020
methods from NotesManager are also sorted by "sections" that make sense

next step to be fully OOP: don't keep Z_POSITION, ALL_NOTES and GLOBAL_ARE_VISIBLE as global variables
maoschanz added a commit that referenced this issue Jun 6, 2020
to better differentiate public and private methods

issue #43
maoschanz added a commit that referenced this issue Jun 6, 2020
@maoschanz maoschanz self-assigned this Jun 6, 2020
maoschanz added a commit that referenced this issue Jun 6, 2020
instead of a global variable (#43)
well NotesManager is a singleton whose instance is a global variable so it's not *that* big, but it's cleaner

the GLOBAL_IS_VISIBLE global variable also becomes an attribute, which fixes a bug (when the layout setting was changed, the visibility of the notes became inconsistent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant