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

Revisit TerminalSelection to add tests, clean up, proper selection mechanics #1327

Closed
3 of 4 tasks
carlos-zamora opened this issue Jun 19, 2019 · 5 comments · Fixed by #2511
Closed
3 of 4 tasks

Revisit TerminalSelection to add tests, clean up, proper selection mechanics #1327

carlos-zamora opened this issue Jun 19, 2019 · 5 comments · Fixed by #2511
Assignees
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements 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

@carlos-zamora
Copy link
Member

carlos-zamora commented Jun 19, 2019

More of a mental note of all the misc. selection stuff I need to do. Hopefully I can get this in very soon so that we can verify that nothing was broken.

  • Add testing for the following scenarios:
    • endSelectionPosition being located out of bounds
  • _GetSelectionRects() clean up
    • the pre-processing part is just a bit nasty now. There should be a way to simplify it. Need to be careful with testing this though.
  • Proper selection mechanics
    • when your endSelectionPosition is out of bounds vertically, the x-position should still update, but the y-position should be at the boundary
    • when your endSelectionPosition is out of bounds horizontally, the y-position should still update, but the y-position should be at the buffer boundary
    • this is particularly important for Feature Request: Scroll from selection dragging out of window #1247. As the y-position must be detected to be out of the bounds, so that's still valid. But it should be displayed as updating the x-position.
@carlos-zamora carlos-zamora added Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels Jun 19, 2019
@carlos-zamora carlos-zamora self-assigned this Jun 19, 2019
@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 Jun 19, 2019
@carlos-zamora carlos-zamora removed the Needs-Triage It's a new issue that the core contributor team needs to triage at the next triage meeting label Jun 19, 2019
@DHowett-MSFT
Copy link
Contributor

DHowett-MSFT commented Aug 14, 2019

  • no need for us to track the start and end Y-offsets separately; they are generally the same (?)
  • concern about the logic being fragmented into a few different functions: chunk selections are expanded during GetSelectionRects instead of during selection (?)

@carlos-zamora
Copy link
Member Author

carlos-zamora commented Aug 16, 2019

  • IsAreaSelected and IsSelectionActive are the SAME THING

@carlos-zamora carlos-zamora added the Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. label Aug 16, 2019
@carlos-zamora
Copy link
Member Author

carlos-zamora commented Aug 16, 2019

  • IsAreaSelected and IsSelectionActive are the SAME THING

So, this one's on me. I created IsAreaSelected() in #1691 when I made some changes to IRenderData. This can actually get resolved in #2296 since I'm already touching that area of the code.

@carlos-zamora
Copy link
Member Author

  • concern about the logic being fragmented into a few different functions: chunk selections are expanded during GetSelectionRects instead of during selection (?)

I'm thinking now that this might be OK. Keyboard selection would just set the anchors to whatever these functions return. That'll allow us to reuse the same function for the weird box selections that cover wide glyphs and words (on double click selections).

@ghost ghost added the In-PR This issue has a related PR label Aug 22, 2019
DHowett-MSFT pushed a commit that referenced this issue Sep 17, 2019
* Test: out of bounds selection
* Clean up Selection code:
- selectionVerticalOffset
- proper return values (const)
- Break up GetSelectionRects()

* Fix Delimiter Text Runs (#2552)

* Added helper method and some log comments throughout tests

Closes #1327.
Closes #2261.
Closes #2206.
@ghost ghost added Needs-Tag-Fix Doesn't match tag requirements Resolution-Fix-Committed Fix is checked in, but it might be 3-4 weeks until a release. and removed In-PR This issue has a related PR labels Sep 17, 2019
@ghost
Copy link

ghost commented Sep 24, 2019

🎉This issue was addressed in #2511, which has now been successfully released as Windows Terminal Preview v0.5.2661.0.:tada:

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-CodeHealth Issues related to code cleanliness, linting, rules, warnings, errors, static analysis, etc. Area-Interaction Interacting with the vintage console window (as opposed to driving via API or hooks) Issue-Task It's a feature request, but it doesn't really need a major design. Needs-Tag-Fix Doesn't match tag requirements 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

Successfully merging a pull request may close this issue.

2 participants