Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Toast" notifications #8592

Open
2 of 8 tasks
zadjii-msft opened this issue Dec 15, 2020 · 3 comments
Open
2 of 8 tasks

"Toast" notifications #8592

zadjii-msft opened this issue Dec 15, 2020 · 3 comments
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Milestone

Comments

@zadjii-msft
Copy link
Member

zadjii-msft commented Dec 15, 2020

An idea I've been toying around with for a while, but haven't formalized.

"Toasts" are an Android UI paradigm - a transient notification that can be displayed to the user. These toasts can't be interacted with, and dismiss themselves after a brief timeout.
image

WinUI doesn't have Toasts, but it does have the TeachingTip. in the future, WinUI is planning on building this auto-dismiss behavior into the TeachingTip itself, but we're impatient.
image

Use cases that would be good for this:

From the above, there are two kinds of scenarios where we want Toasts: control-level and window-level.

  • A, B, D are all window-level. There's one Toast visible, at the window level. Changing tabs wouldn't hide this toast (this is important for D, where the toast would be fired as the new tab is opening, and we probably want the toast to persist in both the original tab and the tab that's created).
  • C is a control-level toast. Each pane would display a toast. Changing tabs would hide these toasts.

I'm not prescribing any interactable UI in these toasts, but TeachingTips do allow buttons and other rich content.

I'm sure there are other things we could do too. This issue is so I don't lose track of the possible scenarios.

Other things:

  • Something like "Unable to rename window. Another window with that name already exists."
@zadjii-msft zadjii-msft added Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Area-User Interface Issues pertaining to the user interface of the Console or Terminal Product-Terminal The new Windows Terminal. labels Dec 15, 2020
@zadjii-msft zadjii-msft added this to the Terminal Backlog milestone Dec 15, 2020
@ghost ghost added the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 15, 2020
@DHowett
Copy link
Member

DHowett commented Dec 16, 2020

Control level toasts also include the resize size indicator!

@DHowett
Copy link
Member

DHowett commented Dec 17, 2020

Backlog approved.

@DHowett DHowett removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Dec 17, 2020
@zadjii-msft
Copy link
Member Author

zadjii-msft commented Jan 20, 2021

Alright, so I tried to do this today. Here's what I learned:

  • It works fairly well for the app-level toasts, where the notification is centered in the bottom of the window.
  • The TeachingTip is definitely focusable, or in the tab order, or something. So it's certainly possible for it to steal the focus from the TermControl.
    • This is particularly noticeable with multiple toasts (like a per-control toast).
    • I found the focus commonly getting tossed back to the TabViewItem, not the TermControl. That's aggressively annoying.
  • If you create a TeachingTip, and don't give it a Target, it's always going to be placed relative to the XAML ROOT, not _whatever thing is the parent element of the TeachingTip. This is particularly painful because none of the placement options allow you to place it within the bounds of the target. They all want to be outside the target, on the side somewhere.
    • The closest I could get was to add a PlacementMargin of -80, -80, -80, -80, which seemed to work alright in a XAML studio scratch page, but doesn't work well in the Terminal itself.
      image
      • -80, -80, -80, -80 is obviously contrived. I should only need to set one of those to -80, right? But it's not clear if it's Top or Bottom that needs to be set.
  • If the TeachingTip isn't entirely visible, it just destroys itself. Maybe this is related to ShouldConstrainToRootBounds?
    • This is particularly problematic for smaller panes.
  • Maybe I'm daft, but I can't seem to make the TeachingTips smaller? Like, "Pane 1" is not a whole lot of text.
    • This exacerbates the previous point about the TeachingTips just dying immediately.
  • There's an upstream bug tracking the fact that TeachingTips will reserve space for the Title and Subtitle, even if one is null/empty. We probably only want one at a time.
  • Someone needs to hold a reference to the TeachingTip/Toast, so we can dismiss it properly at the end of the timer. The way I did that was with two classes:
    • Toast was the container for the Timer and the TeachingTip, and after the timeout, would hide the TeachingTip. It shouldn't be constructed on it's own though.
    • Toaster was the container for "Thing to create and own Toasts". It would be able to MakeToast on a given (optional) UI element, and would hold all the Toasts it creates, then remove them when their timer expires.
    • This felt like madness, but it worked? So the TerminalPage had a Toaster it could use to send toasts. It did not feel like a natural extension of TeachingTip.

My work is over in dev/migrie/f/com.fabrikam.toaster. Feel free to check it out if interested.

ghost pushed a commit that referenced this issue Mar 30, 2021
## Summary of the Pull Request

This is a follow up to #9300. Now that we have names on our windows, it would be nice to see who is named what. So this adds two actions:

* `identifyWindow`: This action will pop up a little toast (#8592) displaying the name and ID of the window, and is bound by default.
![identify-window-toast-000](https://user-images.githubusercontent.com/18356694/111529085-bf710580-872f-11eb-8880-b0b617596cfc.gif)

* `identifyWindows`: This action will request that ALL windows pop up that toast. This is meant to feel like the "Identify" button on the Windows display settings. However, sometimes, it's wonky. 
  ![teaching-tip-dismiss-001](https://user-images.githubusercontent.com/18356694/111529292-fe06c000-872f-11eb-8d4a-5688e4ce1175.gif)
  That's being tracked upstream on microsoft/microsoft-ui-xaml#4382
  Because it's so wonky, we won't bind that by default. Maybe if we get that fixed, then we'll change the default binding from `identifyWindow` to `identifyWindows`


## References

## PR Checklist
* [x] Closes https://github.com/microsoft/terminal/projects/5#card-51431492
* [x] I work here
* [x] Tests added/passed
* [ ] Requires documentation to be updated

## Detailed Description of the Pull Request / Additional comments

You may note that there are some macros to make interacting with lots and lots of actions easier. There's a lot of boilerplate whenever you need to make a new action, so I thought: "Can we make that easier?" 

Turns out you can make it a _LOT_ easier, but that work is still behind another PR after this one. Get excited
ghost pushed a commit that referenced this issue Oct 1, 2021
Just like in #9760, we can't actually use the UWP file picker API, because it will absolutely not work at all when the Terminal is running elevated. That would prevent the picker from appearing at all. So instead, we'll just use the shell32 one manually. 

This also gets rid of the confirmation dialog, since the team felt we didn't really need that. We could maybe replace it with a Toast (#8592), but _meh_

* [x] closes #11356
* [x] closes #11358
* This is a lot like #9760
* introduced in #11062
* megathread: #9700
@zadjii-msft zadjii-msft modified the milestones: Terminal Backlog, Backlog Jan 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. Product-Terminal The new Windows Terminal.
Projects
None yet
Development

No branches or pull requests

2 participants