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

Very long ToolTips get clipped #9869

Closed
vadimkantorov opened this issue Apr 17, 2021 · 15 comments
Closed

Very long ToolTips get clipped #9869

vadimkantorov opened this issue Apr 17, 2021 · 15 comments
Assignees
Labels
Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Milestone

Comments

@vadimkantorov
Copy link

vadimkantorov commented Apr 17, 2021

The current directory of WSLv1 tab is /mnt/c/Users/user/Downloads, and the tooltip just reads /mnt. This is not useful since it's very generic, even /mnt/c would be more useful. Maybe even absence of this strange path would be less confusing.

image

Terminal version: Version: 1.7.1033.0

@vadimkantorov vadimkantorov added the Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. label Apr 17, 2021
@ghost ghost added Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Needs-Tag-Fix Doesn't match tag requirements labels Apr 17, 2021
@vadimkantorov vadimkantorov changed the title Not useful tab tooltip Not useful / confusing path in tab tooltip Apr 17, 2021
@DHowett
Copy link
Member

DHowett commented Apr 17, 2021

It just looks like it’s cut off (look at the part of the character to the right of mnt). We should probably fix that.

@vadimkantorov
Copy link
Author

vadimkantorov commented Apr 17, 2021

If the tooltip is already multiline, maybe best to always put this path / PS1 it on new line (as well as the PS1 prompt), And then it could be ellipse'd... Maybe some heuristics could be used, such as putting the first occurred slash on the new line

Or maybe the tooltip could have increased width (even maybe matching the window width).

@DHowett
Copy link
Member

DHowett commented Apr 17, 2021

So, we don’t actually know that it’s a path. That’s the verbatim string that bash reported to us, with the username/hostname/path pre-formatted. Alas.

@vadimkantorov
Copy link
Author

Summing up three other variants: 1) show PS1 on different line than OS name, 2) make tooltip radically larger, 3) have some heuristics for word-wrapping unknown PS1 (e.g. by slash or non-word characters)

@zadjii-msft
Copy link
Member

Hmm, it looks like how we're building the tooltips doesn't account for the width of the text:

image

But then compare to:

  <Button Content="Button with a simple ToolTip."
        ToolTipService.ToolTip="https://this.com/is/a/incredibly-long-hyperlink/that/might/have/too-long-a-tooltip"/>

image

So TabBase::_UpdateToolTip and

    <Border x:Name="HyperlinkTooltipBorder"
            BorderBrush="Transparent">
        <ToolTipService.ToolTip>
            <ToolTip x:Name="LinkTip"
                     Placement="Mouse">
                <TextBlock IsTextSelectionEnabled="True">
                    <Run x:Name="HoveredUri" /> <LineBreak />
                    <Run x:Uid="HowToOpenRun"
                         FontStyle="Italic" />
                </TextBlock>
            </ToolTip>
        </ToolTipService.ToolTip>
    </Border>

in termcontrol.xaml will probably need to get updated.

@zadjii-msft zadjii-msft added Area-User Interface Issues pertaining to the user interface of the Console or Terminal Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Priority-3 A description (P3) Product-Terminal The new Windows Terminal. and removed Issue-Feature Complex enough to require an in depth planning process and actual budgeted, scheduled work. labels Apr 19, 2021
@ghost ghost removed the Needs-Tag-Fix Doesn't match tag requirements label Apr 19, 2021
@zadjii-msft zadjii-msft added this to the Terminal v2.0 milestone Apr 19, 2021
@zadjii-msft zadjii-msft changed the title Not useful / confusing path in tab tooltip Very long ToolTips get clipped Apr 19, 2021
@vadimkantorov
Copy link
Author

vadimkantorov commented Apr 19, 2021

Also, not sure why ctrl+alt+2 shows up at a seemingly arbitrary margin (not left, not right, unclear the intent). With combination with a clipped tooltip, this looks also strange

Also note that ctrl is captialized differently in ctrl+alt+2 and in Ctrl+Click - seems inconsistent

@zadjii-msft
Copy link
Member

The ctrl+alt+2 is probably trying to center itself underneath the previous line of text. It just doesn't realize that it's container is not as big as the text is 😉

@vadimkantorov
Copy link
Author

My proposed tooltip (consistent captialization + PS1 on new line always + FS path wrapping heuristic for the first slash (so that for default Windows/Ubuntu PS1 scheme it looks okay in for short enough paths) + wrapping is prefixed by "... ":

[Ctrl+Alt+2]: Ubuntu 18.04
vadimkantorov@DESKTOP-4UF8FID:
... /mnt/c/Users/user
.... more wrapping if needed

@Don-Vito
Copy link
Contributor

As the one responsible for the mess, I can take a look later on.

@Don-Vito
Copy link
Contributor

I will start with fixing the wrapping (one-liner).
@zadjii-msft - please let me know if you want to switch to another structure, like @vadimkantorov suggested.

@zadjii-msft
Copy link
Member

Nah, let's just fix the wrapping for now. That's easiest - everything else is just heuristics, which is a programmer word for "guessing" 😄 Plus, that doesn't involve any real design changes, which would require a much lengthier discussion

@ghost ghost added In-PR This issue has a related PR and removed In-PR This issue has a related PR labels Apr 21, 2021
@ghost ghost closed this as completed in 6b4f70e Apr 21, 2021
@ghost ghost added the Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. label Apr 21, 2021
@vadimkantorov
Copy link
Author

Will this also fix Ctrl capitalization + shortcut placement?

@Don-Vito
Copy link
Contributor

@vadimkantorov - no, I didn't fix any of those, sorry.

  • Regarding the shortcut placement, @zadjii-msft - advised to leave it as is meanwhile
  • Regarding the capitalization we need to do it.. but I guess it has larger scope that just a tool-tip, e.g., it might affect the command palette as well.

DHowett pushed a commit that referenced this issue May 14, 2021
* [x] Closes #9869
* [x] CLA signed.
* [ ] Tests added/passed
* [ ] Documentation updated.
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already.

(cherry picked from commit 6b4f70e)
DHowett pushed a commit that referenced this issue May 14, 2021
## PR Checklist
* [x] Closes #9869
* [x] CLA signed.
* [ ] Tests added/passed
* [ ] Documentation updated.
* [ ] Schema updated.
* [ ] I've discussed this with core contributors already.

(cherry picked from commit 6b4f70e)
@ghost
Copy link

ghost commented May 25, 2021

🎉This issue was addressed in #9913, which has now been successfully released as Windows Terminal Preview v1.9.1445.0.:tada:

Handy links:

@Korb
Copy link

Korb commented Dec 8, 2021

The tooltip for the new tab button is too short (or the text is too long) to understand what it says:
2021-12-08_13-43-27
Windows Terminal Preview 1.12.2931.0, Microsoft Windows 10.0.19043.1387.

Related #5355 and #5484.

This issue was closed.
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 Help Wanted We encourage anyone to jump in on these. Issue-Bug It either shouldn't be doing this or needs an investigation. Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting Priority-3 A description (P3) Product-Terminal The new Windows Terminal. Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release.
Projects
None yet
Development

No branches or pull requests

5 participants