Skip to content

Add "toggle all with alt-click" to batch-mark-files-as-viewed - #4016

Merged
yakov116 merged 33 commits into
mainfrom
markEmAll
Mar 16, 2021
Merged

yakov116 merged 33 commits into
mainfrom
markEmAll

Conversation

@yakov116

@yakov116 yakov116 commented Feb 24, 2021 •

Copy link
Copy Markdown
Member

@fregante fregante changed the title Add "toggle all with alt-click" to `batch-mark-files-as-viewed Add "toggle all with alt-click" to batch-mark-files-as-viewed Feb 24, 2021
@yakov116

Copy link
Copy Markdown
Member Author

@fregante did understand the issue correctly? You want that when clicking the progress bar it should mark them all as viewed?

@fregante

fregante commented Feb 24, 2021 •

Copy link
Copy Markdown
Member

It should toggle them.

If you alt-click a checked item, it should uncheck it and uncheck all of them.

If you alt-click an unchecked item, all of them should be checked.

@yakov116

Copy link
Copy Markdown
Member Author

If you alt-click a checked item, it should uncheck it and uncheck all of them.

If you alt check ANY item it should uncheck/check the ALL? So nothing to do with the progress bar?

@fregante

Copy link
Copy Markdown
Member

The progress bar is unrelated to the logic. It’s only there because it might take a few seconds. Just refer to how toggle-all-with-alt-click works. It’s the same identical logic.

@yakov116

Copy link
Copy Markdown
Member Author

...attempts to use new feature but its not correct :) the name is toggle-everything-with-alt

@yakov116
yakov116 marked this pull request as ready for review March 2, 2021 10:39
@fregante

fregante commented Mar 5, 2021 •

Copy link
Copy Markdown
Member

3. SCREENSHOT:
Not yet

The PR is "ready for review" but no screenshot 🥺

2. TEST URLS:
This PR

This PR has 5 files, not a good test PR for a toast. I suggest #4044

Fixed:

gif

Comment thread source/features/table-input.tsx Resolved
Comment thread source/github-helpers/toast.tsx Resolved
Comment thread source/github-helpers/toast.tsx Resolved
Comment thread source/helpers/icons.tsx Resolved
Comment thread source/helpers/icons.tsx Resolved
@yakov116

yakov116 commented Mar 7, 2021

Copy link
Copy Markdown
Member Author

The PR is "ready for review" but no screenshot 🥺

I did not even think you were going to keep the PR open. Will work on this tomorrow.

@yakov116
yakov116 marked this pull request as draft March 8, 2021 04:34
@yakov116
yakov116 marked this pull request as ready for review March 12, 2021 15:42
@yakov116
yakov116 requested a review from fregante March 12, 2021 15:42
toast.show();
await delay(30); // Without this, the Toast doesn't appear in time
markAsViewed(event);
await lastCheckboxCompleted; // Without this, done will be called too early

@fregante fregante Mar 14, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How early? I just checked #4044 on Chrome and I don't see a difference

@yakov116 yakov116 Mar 15, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without it the 'completed' toast is never shown. (I just tried, can provide gif if needed)

@fregante fregante Mar 15, 2021 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At first sight it works and I do see the toast, but also I noticed that the 3s timer starts before the completed toast appears.

  1. markAsViewed() synchronously takes 2.5s
  2. The timer starts
  3. 1.5s later the view is actually updated, likely due to long layout operations
  4. Only 1.5s left in the timer

If the layout takes 3s or more, the timer expires before the page even paints the message.

This should be taken care by the toast component itself, so I moved this logic into its file.

Comment thread source/github-helpers/toast.tsx Resolved

@fregante fregante left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It appears to be ok

@yakov116

yakov116 commented Mar 16, 2021 •

Copy link
Copy Markdown
Member Author

Works well (great job @fregante 😄 )

What do you say to my working wording change?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

Add "toggle all with alt-click" to batch-mark-files-as-viewed

2 participants