Most active commenters
  • egeozcan(6)
  • xandrius(4)
  • rollcat(3)

←back to thread

578 points smusamashah | 35 comments | | HN request time: 0.817s | source | bottom
1. egeozcan ◴[] No.42463511[source]
This is very cool. BTW, when developing single HTML file apps, instead of localStorage, one can use the HTML as the source of truth, so the user can just save/save-as to persist. I had mentioned my quick and dirty attempt at an image gallery that is a self-contained html file and some really liked the concept, if not the "app" itself: https://news.ycombinator.com/item?id=41877482
replies(6): >>42463631 #>>42464347 #>>42467577 #>>42471918 #>>42476577 #>>42477123 #
2. xandrius ◴[] No.42463631[source]
Wait, so every time I make a change I need to remember to save or it's all lost? Or am I missing something?
replies(7): >>42463754 #>>42463869 #>>42464221 #>>42464493 #>>42464749 #>>42465571 #>>42469902 #
3. egeozcan ◴[] No.42463754[source]
Yes, is that a no-go? Maybe I’m just being too old-school :)

It does make forks a lot easier, though!

Another advantage is that it makes it clear what you’re saving, reducing the likelihood of errors being persisted.

replies(1): >>42463882 #
4. FrancoisBosun ◴[] No.42463869[source]
Not so different from Word/Excel/Lotus 1-2-3 from the 90s! I like that most software saves-as-I-type now, but that was the workflow back then. Ctrl+S was the most used key combo on my keyboard back then. Now, it's `:w<Enter>`.
5. ffsm8 ◴[] No.42463882{3}[source]
There is a pretty newish filesystem API around. You could probably make auto saving possible via that - at least after a prompt for the filesystem permission.

Or keeping it as it. That's fine too. It just came to mind

6. breakfastduck ◴[] No.42464221[source]
My god this comment made me feel old.

God forbid you have to remember to save your work!

replies(4): >>42464339 #>>42464506 #>>42466436 #>>42474915 #
7. billiam ◴[] No.42464339{3}[source]
The mental model my kids have for work is that typing or even thinking is itself a finished product. For my generation that idea of a conscious action of saving your work on a computer made me think more about what I was doing and how I was doing it. But I am an old.
replies(2): >>42464773 #>>42481399 #
8. AlphaWeaver ◴[] No.42464347[source]
Came here to comment this as well! TiddlyWiki uses this as it's default storage format.
9. darrenf ◴[] No.42464493[source]
I mean, that’s what I have to do in vim, so why not?
10. mock-possum ◴[] No.42464506{3}[source]
I mean - yeah, honestly, god forbid. Requiring manual saves with limited change history (or none at all) was the bad old days. That was bad UI/UX, literally everybody had a “oops I forgot to save” and a “oops I saved and I didn’t mean to” horror story. Things are better now.
replies(1): >>42464784 #
11. kaimac ◴[] No.42464749[source]
You can get the browser to confirm you want to close the tab. That's what I did with my little single-file scrapbook thing: http://kaimac.org/posts/scrapbook/index.html
12. endofreach ◴[] No.42464773{4}[source]
I understand the overall contrast you're sketching here. But can you elaborate on

> typing or even thinking is itself a finished product

Any specific examples where you notice the difference?

13. jjeaff ◴[] No.42464784{4}[source]
I wouldn't say it was totally awful. At least, prior to having an Undo option or perhaps an undo but that can only go back 3 steps, saving as before making any large changes was a pretty common workflow. I might end up with 50 versions of a document numbered incrementally by the time I was finished. that is still a necessary workflow for certain types of documents. I don't necessarily want everything saved automatically all the time.
replies(1): >>42466448 #
14. rpdillon ◴[] No.42465571[source]
If you construct the file to be able to save a copy of itself with updated data, then it can do so automatically without any user interaction, either on a timer or in response to some event.
15. xandrius ◴[] No.42466436{3}[source]
Do you really long for that?

It's been over 20 year with auto-save being pretty common, one has to adapt to the modern times, especially when it makes things better.

I don't have to "remember to save my work" when I write on my notepad, why should it be different on a computer?

replies(1): >>42469994 #
16. xandrius ◴[] No.42466448{5}[source]
I love my paper notebook to save everything automatically, I don't long for it to all disappear if I forget to press a button and give it a name.
17. smusamashah ◴[] No.42467577[source]
Does using save as retain changes you make in the HTML (like aedits on a contenteditable element)? In my experience it does not. When you save, the originally loaded html will be saved, any changes in html stay in your browser.
replies(1): >>42468656 #
18. egeozcan ◴[] No.42468656[source]
My bad, I should have mentioned that you should choose the option to save the complete web page. It becomes default on Firefox once you select it. Not sure about Chrome and others.

It looks like this on Firefox, Windows: https://imgur.com/zNlEGgK

replies(1): >>42470583 #
19. WickyNilliams ◴[] No.42469902[source]
You could combine localStorage and manual save. Anything unsaved goes to localStorage, on save write to html and clear local storage. Best of both worlds?
20. account42 ◴[] No.42469994{4}[source]
> Do you really long for that?

Yes, absoultely. Saving data you don't want saved and overwriting data you want to retain are just as bad as not saving data you want to keep.

Keeping a scratch file to restore from unexpected applications exits (crash, power loss, etc.) is fine but beyond that I expect to be in control of when and where things are saved.

> one has to adapt to the modern times

I expect my computers to adapt to my requirements, not the other way around.

> especially when it makes things better.

Modern rarely equals better.

replies(2): >>42470961 #>>42481327 #
21. rollcat ◴[] No.42470583{3}[source]
Great idea, as usual killed in its infancy by lacking UA UX. We even already have an API to ask the user not to close the web page, because there's unsaved work; but it wouldn't work with "Save as...", because you can't detect that, and the browser won't do it for you, even if it knows you're editing a local file.

Same for all of the pointless cookie banners - they could've been UA prompts instead, putting the user in charge of setting a policy ("always trust example.com", "never trust example.net", "accept example.org for this session", etc). But building such prompts into a browser would've been a nuisance in 1997... So we ended up with that nuisance anyway, just enshrined by shortsighted laws, that target each and every website - rather than the three remaining browser engine vendors.

replies(2): >>42471994 #>>42479089 #
22. xandrius ◴[] No.42470961{5}[source]
Wait until you discover pen and paper.
23. 65 ◴[] No.42471918[source]
How would this work without manually editing the HTML file?
replies(1): >>42471980 #
24. egeozcan ◴[] No.42471980[source]
You write Javascript to read and write to HTML, like, develop a single page app that treats HTML as the view and the database, and restores state on DOMContentLoad from the HTML. Super easy and maintainable for micro apps.

You can also use the contenteditable attribute and use no JS, so you basically have a notepad.

25. egeozcan ◴[] No.42471994{4}[source]
It's not killed IMHO, I actively use a fleet of such single HTML file apps that I save locally and even share with people. My initial comment has an example of a gallery, works wonderfully.
replies(1): >>42479232 #
26. HeyLaughingBoy ◴[] No.42474915{3}[source]
At my first job, one of my responsibilities was to write the product manuals. My boss would set a timer next to me and instruct me to ctrl-S every time it went off.

Corrective action from having lost work too many times :-)

27. gcr ◴[] No.42476577[source]
TiddlyWiki famously does this! It's a great system for what it needs to be. https://tiddlywiki.com/
28. pyinstallwoes ◴[] No.42477123[source]
I like urls as source of truth. It’s beautifully deterministic
29. tomcam ◴[] No.42479089{4}[source]
What is UA UX?
replies(1): >>42479210 #
30. rollcat ◴[] No.42479210{5}[source]
UA = User Agent (in this case, web browser). UX = user experience (catch-all term for "design", "how it works", integration, etc).
replies(1): >>42482141 #
31. rollcat ◴[] No.42479232{5}[source]
Well my issue is you forget to hit Ctrl-S/Cmd-S and your changes are gone. I've been using computers since early 90s and haven't found one program that does that; heck many apps don't even have an explicit "save" button, saving (and syncing) is transparent.

The web "browser" wasn't "intended" for this use case, hence the issue. This could be easily fixed though -- just like cookies.

replies(1): >>42479275 #
32. egeozcan ◴[] No.42479275{6}[source]
You can also use localstorage/indexeddb and keep syncing it with a script element of type text/json. On-load, see if localstorage is gone (different browser, domain, etc.) and restore from the script element if that's the case.

I explicitly do not want such a thing in many of my HTML-apps, but one could add it with relative ease.

33. nuancebydefault ◴[] No.42481327{5}[source]
Neither save strategy is 'the better one'. Next step would be that git auto-commits...
34. nuancebydefault ◴[] No.42481399{4}[source]
If you go back in time, there were editors that by default would save the previous version of a file to .bak, each time you saved the current status. The fear of accidental saving or editing and hence overwriting old good stuff was higher than accidentally loosing new good stuff. There was less protection of system files, config files etc, so chances were you would brick apps or even the OS. Things got more forgiving since.
35. tomcam ◴[] No.42482141{6}[source]
Was not hip to the UA part so couldn’t directly connect with the UX part, thanks