bruiken / Notepad--

Notepad--, a lightweight web based editor with numerous optional features.
MIT License
3 stars 0 forks source link

Feature tabs #28

Closed jwijenbergh closed 3 years ago

jwijenbergh commented 3 years ago
jwijenbergh commented 3 years ago

Hopefully we can discuss good solutions to my open issues. Added help wanted label

jwijenbergh commented 3 years ago

Requested review, let me know what you think of the current implementation.

Justin-Reniers commented 3 years ago

There's a bug where if you open a file as a tab, close that tab and try to open the same file again right after (so presumably for the same tab), the file is no longer opened in a new tab. This might be due to the way IDs are handled for tabs, and the ID already exists once you opened the file once (combined with the number of the tab), but I'm not sure about that.

Justin-Reniers commented 3 years ago

There's a bug where if you open a file as a tab, close that tab and try to open the same file again right after (so presumably for the same tab), the file is no longer opened in a new tab. This might be due to the way IDs are handled for tabs, and the ID already exists once you opened the file once (combined with the number of the tab), but I'm not sure about that.

Fixed this issue.

Justin-Reniers commented 3 years ago

Currently when you have multiple tabs open and save one (and close it) to then refresh the page with ctrl f5, the page loads the contents of the tab you saved and closed, since that's the last thing that has been saved in the local buffer.

jwijenbergh commented 3 years ago

Currently when you have multiple tabs open and save one (and close it) to then refresh the page with ctrl f5, the page loads the contents of the tab you saved and closed, since that's the last thing that has been saved in the local buffer.

Indeed, I'm working on saving and restoring the tabs so that you can either:

bruiken commented 3 years ago

Would be nice if the x to close is aligned with the text (Vertically).

Justin-Reniers commented 3 years ago

Tab name is now the filename of the loaded file. Adding a tab through the editor however now gives it the name undefined, still needs to be handled. * is not yet in the tab name, since the tabs don't have their own buffer yet, thus meaning * in a tab would be useless as for now (since saving a tab and closing it overwrites the local buffer, and reloading the page puts the last saved buffer in the first tab, possibly overwriting what was actually there).

jwijenbergh commented 3 years ago

Would be nice if the x to close is aligned with the text (Vertically).

I added it as a superscript with <sup> </sup>, I can easily remove that

jwijenbergh commented 3 years ago

Tab name is now the filename of the loaded file. Adding a tab through the editor however now gives it the name undefined, still needs to be handled. * is not yet in the tab name, since the tabs don't have their own buffer yet, thus meaning * in a tab would be useless as for now (since saving a tab and closing it overwrites the local buffer, and reloading the page puts the last saved buffer in the first tab, possibly overwriting what was actually there).

Still working on saving and restoring tabs, having a few issues with that. Will do this when I get saving/restoring working

bruiken commented 3 years ago

The addition of a button to save all in the dropdown is nice, but there already exists an extensible function for it in the master branch. Not sure if it is in this branch also, it was created in the compiler thingy

jwijenbergh commented 3 years ago

The addition of a button to save all in the dropdown is nice, but there already exists an extensible function for it in the master branch. Not sure if it is in this branch also, it was created in the compiler thingy

That extensible function is for adding new items to the menu, I needed to expand an existing item (the file item)

jwijenbergh commented 3 years ago

Rebased with master.

bruiken commented 3 years ago

A few small changes:

jwijenbergh commented 3 years ago

A few small changes:

* The most important change imo is that the tabs selection is now below the buttons of the other features. I think this is relevant since that info is not preserved per tab

* The tabs selection needed a bit of margin for this change, looked ugly without

* The first tab link was blue and got a cursor: pointer because href was set, better without

Good changes, it indeed looks much better now