Fix app title text scaling on Windows - #929
Open
anuagragith wants to merge 3 commits into
Open
anuagragith wants to merge 3 commits into
anuagragith wants to merge 3 commits into
Conversation
added 2 commits
September 11, 2026 23:14
Render the visible Windows app title in React Native so it follows the system text-size setting while preserving the native window title, caption buttons, and drag behavior. Adapt the native caption height when text scaling changes and add regression coverage for the scalable title. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 18f319cb-b4f4-4b6b-ae4d-b8f429333447
Use the rendered title height to keep the React content boundary synchronized with the native caption when Windows text size changes. RNW 0.84 updates text layout live without publishing a new Dimensions fontScale value. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 18f319cb-b4f4-4b6b-ae4d-b8f429333447
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Prevent title wrapping before using its rendered height as the accessibility scaling signal.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Fixes Windows Gallery title-bar text scaling for accessibility settings while preserving native window behavior.
Changes:
- Adds a scalable React Native title bar.
- Synchronizes native caption height with text-size changes.
- Adds regression tests for title rendering and height transitions.
File summaries
| File | Summary |
|---|---|
windows/rngallery/rngallery.cpp |
Configures native title-bar rendering, colors, and dynamic height. |
src/components/AppTitleBar.tsx |
Implements the scalable title. Moderate issue: the title can wrap without numberOfLines, causing incorrect height-based scaling detection. |
src/App.tsx |
Integrates the title bar on Windows. |
__tests__/AppTitleBar.test.tsx |
Tests title content, scaling, and height transitions. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
anuagragith
requested review from
acoates-ms and
Vladimir Morozov (vmoroz)
and
a lite review from Copilot
September 13, 2026 23:09
Contributor
There was a problem hiding this comment.
🔵 Needs a closer look
Wrapped titles can be misidentified as scaled, and 225% scaling can cause overflow and React/native caption desynchronization.
Review details
Suppressed comments (2)
src/components/AppTitleBar.tsx:50
onTitleLayouttreats any height above 16 as evidence of text scaling, but this<Text>is allowed to wrap when the window is resized below the title width (there is no minimum window size configured). At normal text scale that wrap will incorrectly switch the React bar to 48 px while the native caption remains Standard, and at larger scales it can overflow the 48 px bar. Keep the window title single-line (or otherwise distinguish wrapping from font scaling) before using its height as the scale signal.
<Text
accessibilityRole="header"
allowFontScaling={true}
onLayout={onTitleLayout}
style={styles.title}>
src/components/AppTitleBar.tsx:28
- At the 225% transition described in the PR, the rendered title reaches 54 px, but every scaled case here still collapses to a 48 px container. Since this view is the React content boundary, the title can extend into the navigation area and the React/native caption heights are no longer synchronized. Keep the measured height (with the standard minimum) or otherwise derive the container height from the same caption metrics instead of reducing all scaled sizes to a boolean.
export const getAppTitleBarHeight = (isTextScaled: boolean) =>
isTextScaled ? 48 : 32;
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Keep the scalable Windows title on one ellipsized line so layout height remains a reliable text-scaling signal at narrow window widths. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 0f63ea4f-a16b-4fa3-b141-785aec89b5e4
Contributor
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix the React Native Gallery window title so it responds to the Windows Accessibility > Text size setting.
AppWindow.Titlefor accessibility, task switching, and window identity.Root cause
The Windows App SDK native caption text does not respond to the system accessibility text-size setting and does not expose an API for changing its font size.
Additionally, RNW 0.84 updates Fabric text layout when text size changes but does not publish the updated
fontScalethroughDimensions. The implementation therefore uses the title’s actual rendered height to keep the React content boundary synchronized with the native caption.Validation
Scope
This fixes ADO 63971606 for the main Gallery window.
Note: This is a pre-existing Gallery accessibility issue and was not introduced by React Native Windows 0.85.