Skip to content

Conversation

cnaples79
Copy link

@cnaples79 cnaples79 commented Oct 1, 2025

Summary

  • reuse the tab visibility predicate across TerminalPage and TerminalWindow
  • tighten window sizing math so we only add chrome height when a tab row actually renders
  • add a local test covering TabRow visibility changes with the hidden-title-bar configuration

Rationale

Changes

  • expose TerminalPage::IsTabRowVisible() and update _UpdateTabView and _WindowSizeChanged to consult it
  • adjust the sizing fallback when tabs live in the title bar to avoid duplicating the system chrome
  • add TabRowVisibilityReflectsTabCount in the local TabTests suite as a regression guard

Fixes #19308

@DHowett
Copy link
Member

DHowett commented Oct 7, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@DHowett DHowett left a comment

Choose a reason for hiding this comment

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

Thanks so much for doing this! Sorry for the delay in reviewing, as well.

It looks like the code formatter has flagged a couple things (also, I think your editor changed line endings in some unexpected places? I'm seeing changed lines that haven't actually changed, and usually that means git is playing line ending tricks on me. :))

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something label Oct 7, 2025
@cnaples79
Copy link
Author

@DHowett thanks for the comment, I'll go back and look through to see what needs fixed and update the PR.

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs-Attention The core contributors need to come back around and look at this ASAP. and removed Needs-Author-Feedback The original author of the issue/PR needs to come back and respond to something labels Oct 7, 2025
@cnaples79 cnaples79 marked this pull request as draft October 8, 2025 03:12
@cnaples79 cnaples79 marked this pull request as ready for review October 8, 2025 03:45
@cnaples79 cnaples79 requested a review from DHowett October 8, 2025 03:46
@cnaples79
Copy link
Author

@DHowett I used clang-format so hopefully this 2nd commit fixed the formatting issues from the CI test. Let me know if I need to make further adjustments!

@DHowett
Copy link
Member

DHowett commented Oct 8, 2025

Thanks!

@DHowett
Copy link
Member

DHowett commented Oct 8, 2025

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Comment on lines 1327 to 1345
// Hide the title bar = off, tab row visible. Account for
// both the system title bar and the tab strip height.
static constexpr auto titlebarAndTabBarHeight = 40;
pixelSize.Height += (titlebarAndTabBarHeight)*scale;
}
else
{
// Hide the title bar = off, tab row hidden. Only account
// for the native title bar height.
static constexpr auto titlebarHeight = 10;
pixelSize.Height += (titlebarHeight)*scale;
}
}
else if (!_settings.GlobalSettings().ShowTabsInTitlebar())
else if (tabRowVisible)
{
// Hide the title bar = off, Always show tabs = on.
static constexpr auto titlebarAndTabBarHeight = 40;
pixelSize.Height += (titlebarAndTabBarHeight)*scale;
// Hide the title bar = on, tabs drawn in the title bar. Add
// the custom tab row height so the client area fits.
static constexpr auto titlebarHeight = 40;
pixelSize.Height += (titlebarHeight)*scale;
Copy link
Member

Choose a reason for hiding this comment

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

(Sorry to push to your branch before making this comment - the line endings were complicating the review!)

It looks like the code here on R1327 is the same as R1342.

It looks like it might be possible to consolidate them by flipping around the order in which we check:

if (tabRowVisible) {
    // it's 40
} else {
    if (!tabsInTitlebar) {
        // it's 10 apparently
    }
}

but I can't currently determine that that is identical. thoughts?

Copy link
Author

Choose a reason for hiding this comment

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

No worries on the branch push! I'll try and consolidate this part of the code.

Copy link
Author

Choose a reason for hiding this comment

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

@DHowett just pushed the commit to merge this logic, let me know what you think.

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

Labels

Needs-Attention The core contributors need to come back around and look at this ASAP.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extra padding on bottom when showTabsInTitlebar is false

2 participants