Coder Social home page Coder Social logo

Add content tabs about my-notes HOT 11 CLOSED

penge avatar penge commented on August 21, 2024
Add content tabs

from my-notes.

Comments (11)

penge avatar penge commented on August 21, 2024

Hi @antonlukin

Thank you for the suggestion.

What do you think about this preview?

Preview

my notes preview

Let's say you can click (or tap) the page number, and it will go to the next page.
Pages will be 3 and after then, you would get back to the beginning, that is page 1.

For fast navigation, commands like Ctrl+Shift+1, Ctrl+Shift+2, and Ctrl+Shift+3 can be added (on Mac, let's say Command+Shift+1, and so on).

The app would remember which page you had open last time, it would be the page it will open once you come back (re-open the tab).

Need to decide

This feature is something I am considering for quite some time now.
Not many require it (2 or 3 requests).

Simple separation of content can be achieved by placing a few #, or blank lines, or anything else, depends on everyone's style. This is the reason why I hesitate.
The second reason is searching (Ctrl+F), which is easier when there is only 1 page.
Then, need to remember what is on which page.

If this feature is valuable or not, it is up to consideration. If yes, I think about what would be the best way to add it, to be simple, not intrusive (check preview), while satisfying both groups: those who need it, and those who might never use it.

Thank you very much for the help you could provide. Once this gets some approval, I might release it quickly (2-3 days). But in future on bigger tasks, help might be welcome!

Let me know your use cases. How much difference it would make for you to have this.
How do you feel about the feature? Is it very important? What do you think about the preview?

from my-notes.

antonlukin avatar antonlukin commented on August 21, 2024

Thanks for reply!

Speaking in essence I believe that splitting into tabs would be useful. For example, if I want to keep passwords on one tab (it's not the smartest idea, but still) and keep my todo list on the other. Or if I need a tab as a temporary storage and it's easier for me to copy all the content using cmd+a than select part by part. I often paste text from the clipboard, edit something and quickly copy to another location. it is much more convenient to see the full inserted text without extraneous entries.

Anyway, I do not think it is superfluous if you make an unobtrusive interface.
I really like your idea with hotkeys and small numbers.

Thanks again for such a useful extension

from my-notes.

penge avatar penge commented on August 21, 2024

Hi @antonlukin

I am very glad you like the plugin.

I have decided I will implement the feature as in preview. I'll also add the keyboard shortcuts.

To satisfy also basic users, I will add to Options page a toggle if to use 1 page only, or 3 page setting.

I will also add Focus mode, that will be available as another keyboard shortcut. This will be for advanced users to simply hide all the controls.

I also plan to add recognition if My Notes are already open in a different tab. If so. There will be on next instances just a simple text saying so. This will help to avoid any cross editing.

Expect this to be here as a pre-release this Wednesday about 12:00 UTC.

I hope I might then invite you to do a local test before I make the final release. I suppose you have Mac, and Mac's shortcuts need to be tested. I have Chromebook btw.

Pavel

from my-notes.

penge avatar penge commented on August 21, 2024

@antonlukin

It is now here ready to try. The branch is "pages".

The PR is here #34

So far so good. It should work on Mac too.

from my-notes.

antonlukin avatar antonlukin commented on August 21, 2024

Thanks a lot, I will try it ASAP

from my-notes.

antonlukin avatar antonlukin commented on August 21, 2024

I found some bugs.

  1. For some reason content is not saved when switching tabs video

  2. Strage bug Uncaught TypeError: Cannot read property 'debounce' of undefined screenshot

  3. cmd+shift+3 reserved hotkey on macOS. Maybe change with option+1, option+2, option+3?

from my-notes.

penge avatar penge commented on August 21, 2024
  1. Nice catch! I will fix this.
  2. Haven't experienced this so far. What steps did you do?
  3. I see. On Mac it's screen capture. I will change it.

I'll be here in about an hour. After fixed I will rewrite then branch and let you know.

from my-notes.

penge avatar penge commented on August 21, 2024

@antonlukin

It should be fixed now. Try the new "pages" branch.

1 and 2

1 and 2 are related.

I guess your background script just unloaded itself (because it is not persistent, which is good).
In that case, Uncaught TypeError: Cannot read property 'debounce' of undefined would be caused because chrome.extension.getBackgroundPage would return undefined (background script is no longer running).

So here's what I did.
I used chrome.runtime.getBackgroundPage instead of chrome.extension.getBackgroundPage.
That should ensure background script is loaded when needed. In this case, debounce.js is needed. It is needed only once, to wrap the function that is saving notes.
This in the end, should solve both 1 and 2.

3

I tried to change OSX keyboard shortcuts to:

  • Option-1
  • Option-2
  • Option-3
  • Option-F

Please, try this out. I hope it works.

If not (some other shortcut conflict), we might need to test Option-Shift-? combinations.

Note: Keyboard shortcuts are defined in the manifest.json file. You may see Alt-? combinations there. They should be converted to Option-? on the Mac. You can also try to change the combinations (in case the above wouldn't work).

Here are the official docs:
https://developer.chrome.com/extensions/commands

Let me know.

from my-notes.

antonlukin avatar antonlukin commented on August 21, 2024

Excellent work! Thank you so much for your concern.

It seems that all bugs fixed and hotkeys work properly.
One small remark. In this extension version the font size option does not save on tab switching.
I checked on the stable version, and found out that the feature works there.

Just 2 new gifs for you:

from my-notes.

penge avatar penge commented on August 21, 2024

That's great! Cool!


Regarding the font size.

Great you brought this up! I now know how to fix it!
I will put a fix here in about 1 hour.


I'll explain why I have changed it. And then how to fix it.

Why

The reason why I have changed it and why it behaves how it behaves now is following.

Before:
Font size is saved on every change (same in new tab).

Now:
Font size is saved when the tab is closed (NOT same in new tab).

Reasons:

  • To minimize the number of write operations (keep it within limits, described in next point).
  • So far I was using Chrome Sync (chrome.storage.sync) for everything and there is a limit of write operations (120 per minute).
  • The most important thing to save are notes (those are saved every second), and font size as not that essential, would be good enough to save once the work is done, before closing the tab.
  • I am considering to disable editing in multiple tabs (and to put a link instead to jump straight into already open My Notes, can be great if there is 30-50 tabs, no need to search). Also, working on the same page in different tabs creates a mess. Conflicts. Overriding page with different content.

Chrome Sync

So the great news about Chrome Sync is, if you open My Notes from 2 different computers, with the same Gmail account, you should see the same content on both computers. And copy paste content between them. The funny is, I haven't tried this yet. But received words it works.

How to fix

Now I just realized it is not necessary to save everything to Chrome Sync (just notes). Everything else (font type, font size, current page, mode - light/dark) I will now save to Chrome Local. Those "everything else category" are computer specific anyway.

I put notes to Sync, and everything else to Local (there are no such limits).
That would be the fix.

from my-notes.

penge avatar penge commented on August 21, 2024

This one is solved. Closing.

Next one is font size.

from my-notes.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.