Giter Club home page Giter Club logo

Comments (14)

handlerug avatar handlerug commented on July 24, 2024 1

First suggestion implemented in 76d77f0. Tell me if it doesn't work.

from mycorrhiza.

handlerug avatar handlerug commented on July 24, 2024 1

saving it in the middle and jumping back and forth between the editon and the hypha is tedious sometimes.

@chekoopa Why would you need that jumping? if you want to check how hypha will be rendered, you can use Preview button

@DanInSpace104 One may want to see how the hypha used to look like.

I think you all missed the point, the idea is to save periodically to prevent losing changes. You would need to click Save, then click Edit... then click Save, Edit... and so on.

from mycorrhiza.

handlerug avatar handlerug commented on July 24, 2024

Seems pretty easy, I'll tackle that. Thanks for the suggestions!

from mycorrhiza.

DanInSpace104 avatar DanInSpace104 commented on July 24, 2024

saving it in the middle and jumping back and forth between the editon and the hypha is tedious sometimes.

@chekoopa Why would you need that jumping? if you want to check how hypha will be rendered, you can use Preview button

from mycorrhiza.

bouncepaw avatar bouncepaw commented on July 24, 2024

@DanInSpace104 One may want to see how the hypha used to look like.

from mycorrhiza.

chekoopa avatar chekoopa commented on July 24, 2024

First suggestion implemented in [76d77f0]

I'm trying to build it on Nix, but have little problems with embed and io/fs libs. Seems that I need to upgrade my Go compiler. brb

from mycorrhiza.

handlerug avatar handlerug commented on July 24, 2024

First suggestion implemented in [76d77f0]

I'm trying to build it on Nix, but have little problems with embed and io/fs libs. Seems that I need to upgrade my Go compiler. brb

Yep, they require Go 1.16 IIRC.

from mycorrhiza.

bouncepaw avatar bouncepaw commented on July 24, 2024

Add 'unsaved changes' warning (purely frontend, first priority)

Yeah, we need that. Thanks @handlerug for implementing.


Add draft feature for the editor

@chekoopa's git-branch-driven way is not how it should be done, let's not abuse Git, it is already used much more than it should be. We can store drafts in cache/drafts/ directory or something like that instead. It will be easier to do and more reliable.

As of the front-end way, it seems ok. Sure, it is limited to just one device, but who cares[?] But wait, this behaviour is built in browsers already, right?


Allow saving without jumping back on the hypha page (unnecessary, but adds comfort), which unlocks...

Why? What comfort will it bring?


Add toggleable autosave

Why? It makes sense to auto-save drafts, but why auto-save edits?

from mycorrhiza.

bouncepaw avatar bouncepaw commented on July 24, 2024

#25 also seems quite close to the issue

from mycorrhiza.

handlerug avatar handlerug commented on July 24, 2024

#25 is merely a blocker here for the actual drafts feature, not a duplicate issue or something.

from mycorrhiza.

chekoopa avatar chekoopa commented on July 24, 2024

UPD: already done in 9ad9db9, I've missed that commit

First suggestion implemented in [76d77f0]

Looks neat, but it also pops up when you press 'Save'. The fix is simple:

  let saveButton = document.querySelector('.edit-form__save');
  
  saveButton.addEventListener('click', function () {
    changed = false;
  });

  let warnBeforeClosing = function (ev) {
    if (changed) {
      ev.preventDefault();
      return ev.returnValue = 'Are you sure you want to exit? You have unsaved changes.';
    }
  };

from mycorrhiza.

chekoopa avatar chekoopa commented on July 24, 2024

@chekoopa's git-branch-driven way is not how it should be done, let's not abuse Git, it is already used much more than it should be. We can store drafts in cache/drafts/ directory or something like that instead. It will be easier to do and more reliable.

Tee-hee. Yes, that's actually better, that was just the first idea came into my mind.

As of the front-end way, it seems ok. Sure, it is limited to just one device, but who cares[?] But wait, this behaviour is built in browsers already, right?

Checked that, really it is, but it's very implicit IMO. It also ignores external text changes (as you get your 'draft' based on the older version), and also bypasses the new unsaved changes check (but who cares[?]).

Allow saving without jumping back on the hypha page (unnecessary, but adds comfort), which unlocks...

Why? What comfort will it bring?

Comfort of staying on a single page, keeping pace and flow.

It seems to go against minimalistic form-based organization and add a dependency to perform AJAX requests. However, it can be kept as a script-supported feature by adding the button only in scripted browsers.

Add toggleable autosave

Why? It makes sense to auto-save drafts, but why auto-save edits?

My task list was a first-approach, so your point is fair. I've mentioned this feature to make Myco as comfortable for note-taking as Notion, for example. It would add dynamics and make the editing easier. But with server-based drafts it's better to autosave them, for sure.

from mycorrhiza.

handlerug avatar handlerug commented on July 24, 2024

I personally don't trust browsers to retain my edits when I navigate away. Browsers also have full control over local storage of the website, and they're free to clear it whenever they feel like so. A server-side auto-saving of drafts would be much more reliable.

As for the two last suggestions, feel free to discuss them. We have a lot to do before we catch up to Notion, though, so it's not like it's going to help us. (also, you could auto-save edits (not drafts) using custom javascripts...)

from mycorrhiza.

bouncepaw avatar bouncepaw commented on July 24, 2024

Half a year after, this modal window warning about unsaved changes has been causing nothing but irritation. I wonder how is for others

from mycorrhiza.

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.