Refined-github: Add automated comment draft save

Created on 24 Oct 2018  路  12Comments  路  Source: sindresorhus/refined-github

would you consider adding the auto save for comments?

For example:

  1. start writing a comment
  2. close the tab or the browser.
  3. Open the same issue and the comment draft is there.
enhancement help wanted

All 12 comments

At least in Chrome, if you reopen the tab, the form contents is still there.

The only way to restore the content is by using the history (CTRL+H) to open a previously closed tab.
In any other case the text area content is lost when you open a new tab and navigate to same issue/pr

@krasi-georgiev Ctrl + Shift + T reopens the tab and restores the value as well.

What's the use case where you start typing a comment, leave the page on purpose and want to resume the comment later?

multitasking :smile:

Start writing an answer than get stuck to something I want to explain and leave it to come back to it later.
If I forget about it and close the browser or the tab I loose it.

Ctrl + Shift + T is nice but doesn't solve my problem as most of the time it will not be the last closed tab in the history list.

Related, possibly better solution than filling up the storage with forgotten half-comments: https://github.com/sindresorhus/refined-github/issues/1037

yeah not bad solution , but what about Chrome crashes or force restarts?

any other ideas?

This is not a terrible idea, but the comments cache needs to be limited (to 10 comments or so)

Edit: now we have proper cache with expiration, so no need to limit it by count.

yeah 10 is plenty.

How about Add automated issue's title and content draft save?

Sometimes, I wrote a long-term issue, just ready to submit

If you accidentally click the close tab, the content will be lost.

Even if I reply to the tag with CTRL+T, the content will not be restored.

This is frustrating.

Idea:

  1. Every 10 seconds, save all the visible comment areas' contents into an array, eg. cache.set(`comment-backup:${location.pathname}`, ['comment 1', 'comment 2'], 1 / 2)
  2. When any page loads, check the cache, display a closable fixed element in a corner, that opens a dropdown that lets you copy each item

This lets us easily save multiple comment fields (e.g. reviews) without having to mess with their UI (e.g. reopening a new review comment for the same exact line; possibly overwriting GitHub's more recent version, etc)

drop

UI could be better, better yet if "forget all" is replaced by an X outside

Screen Shot 2020-03-16 at 00 11 54

Code mostly copied from https://primer.style/css/components/dropdown#alignment

This can be a global extension as it's not limited to GitHub. If you write such an extension or know one, please leave a comment

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sompylasar picture sompylasar  路  3Comments

hkdobrev picture hkdobrev  路  3Comments

MilesBHuff picture MilesBHuff  路  3Comments

vanniktech picture vanniktech  路  3Comments

shivapoudel picture shivapoudel  路  3Comments