Skip to content

Move terminal icon picker position to relevant terminal tab#212174

Open
albarv340 wants to merge 5 commits intomicrosoft:mainfrom
albarv340:211083-terminal-icon-picker-placement
Open

Move terminal icon picker position to relevant terminal tab#212174
albarv340 wants to merge 5 commits intomicrosoft:mainfrom
albarv340:211083-terminal-icon-picker-placement

Conversation

@albarv340
Copy link

Fixes #211083
This moves the icon picker to always point to the terminal being affected by the icon change. If triggered via the command palette, the active tab is pointed to, since it is the one changing. If triggered via the terminal tab, it points to the terminal tab that is being changed.

Examples:
Change Icon was clicked on bash 1:
image

Triggered via action bar with bash 3 active:
image

@albarv340
Copy link
Author

@microsoft-github-policy-service agree

@abhijit-chikane
Copy link
Contributor

abhijit-chikane commented May 7, 2024

Well the question is if i try to update the color it opens up at the top and if I try to update the icon it is opening near the terminal tab, why two different choices?

@Narendherraj
Copy link

Like @abhijit-chikane has expressed his concern we should probably change the position of the terminal icon colour change tab as well if not it might look weird where one shows the position on bottom and the other on top .

@bricefriha
Copy link

@Narendherraj, it's been a few months. I'm gonna take over @albarv340 's changes, rebase and change the location of the colour picker.

I don't think it's fair to just copy the commits line by line, but I don't see any other way. I'll make sure to credit albarv

What do you think?

@bricefriha
Copy link

Also, I tested these changes, and this only works when there are multiple terminal tabs, when there is just one the picker goes back to the top of the window

@Tyriar Tyriar force-pushed the 211083-terminal-icon-picker-placement branch from c232359 to bc185d2 Compare September 21, 2024 16:22
@bricefriha
Copy link

Also, I tested these changes, and this only works when there are multiple terminal tabs, when there is just one the picker goes back to the top of the window

@Tyriar I think you should take my comment into consideration

Comment on lines 85 to 88
// Force a rerender to make the position correct
setTimeout(() => {
window.dispatchEvent(new Event('resize'));
}, 10);
Copy link
Member

Choose a reason for hiding this comment

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

Not sure what's happening here but in the PR right now with this resize event it will have 2 scroll bars:

image

Removing the synthetic resize event we see the right size and scroll bar, but it's not attached to the target anymore:

image

🤔

Copy link
Author

@albarv340 albarv340 Oct 2, 2024

Choose a reason for hiding this comment

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

I can't seem to get the double scroll bars, but I do agree that the resize event is an ugly solution. I found what caused the problem and "fixed" it. There was a check for whether the hover was going beyond the window, but it seems to not account for something and falsely deemed the hover to be outside the window and thus moving it away from the target. When I subtracted the height of the hover in that comparison (or removed the check entirely) the issue of the placement disappeared.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Terminal Icon picker weird placement

6 participants