Skip to content

Sync: Fix right padding on Windows for select files dropdown - #1966

Merged
epeicher merged 8 commits into
trunkfrom
stu-843-studio-sync-select-files-and-folders-menu-needs-right-margin
Nov 5, 2025
Merged

Sync: Fix right padding on Windows for select files dropdown#1966
epeicher merged 8 commits into
trunkfrom
stu-843-studio-sync-select-files-and-folders-menu-needs-right-margin

Conversation

@epeicher

@epeicher epeicher commented Oct 29, 2025

Copy link
Copy Markdown
Contributor

Related issues

Proposed Changes

  • Applies a patch that removes only for Windows the field-sizing: content CSS from the SelectControl component as it does not work well on Windows
Windows Before After
Collapsed CleanShot 2025-10-30 at 12 51 27@2x CleanShot 2025-10-30 at 13 00 37@2x
Expanded CleanShot 2025-10-30 at 12 51 32@2x CleanShot 2025-10-30 at 13 00 42@2x

Testing Instructions

  • On Windows
  • Apply this branch and run npm install and npm start
  • On Studio, go to Sync tab and connect a site
  • Click on Push or Pull and on the modal, expand the All files and folders dropdown
  • Check that there is some padding on the right of both options
  • Repeat the steps on Mac
  • Check theres is no changes with production

Note

I have tried to also provide some extra padding to the bottom of the Specific files and folders option, but I have not found a simple way to do that (I have discarded using CSS selectors), and the impact is not as big as the right padding that this issue fixes

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?
@epeicher
epeicher requested a review from a team October 29, 2025 16:16
@epeicher epeicher changed the title Stu 843 studio sync select files and folders menu needs right margin Oct 29, 2025

@bcotrim bcotrim left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM 👍

@katinthehatsite katinthehatsite left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The changes look good 👍

One question that I have is that when I was reviewing the issue, I noticed WordPress/gutenberg#72424 - do you think we should create a patch to the component instead and apply it in Studio so that we can fix all instances of the component usage? As a sidenote, I have not researched how much we are using this component, just asking this as a general question.

@epeicher

Copy link
Copy Markdown
Contributor Author

One question that I have is that when I was reviewing the issue, I noticed WordPress/gutenberg#72424 - do you think we should create a patch to the component instead and apply it in Studio so that we can fix all instances of the component usage? As a sidenote, I have not researched how much we are using this component, just asking this as a general question.

That's a good point @katinthehatsite, and I think is what @wojtekn suggests in the linked task STU-843, that way, if there is a fix in the Gutenberg library, we just need to remove the patch and it will be automatically applied.

@wojtekn, do you think I should try to patch the component instead of the current fix that uses the isWindows() flag? I didn't consider the patch option when working on this yesterday.

…dio-sync-select-files-and-folders-menu-needs-right-margin
@wojtekn

wojtekn commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

@epeicher, if it's getting fixed in Gutenberg, an NPM patch may be a good way. With that approach, we won't miss the change in mainstream as our patch will stop applying and will need to be removed.

@github-actions

github-actions Bot commented Oct 30, 2025

Copy link
Copy Markdown
Contributor

📊 Performance Test Results

Comparing 76ca49f vs trunk

site-editor

Metric trunk 76ca49f Diff Change
load 10042.00 ms 12157.00 ms +2115.00 ms 🔴 21.1%

site-startup

Metric trunk 76ca49f Diff Change
siteCreation 19146.00 ms 19146.00 ms 0.00 ms ⚪ 0.0%
siteStartup 5966.00 ms 6004.00 ms +38.00 ms 🔴 0.6%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change

@epeicher

Copy link
Copy Markdown
Contributor Author

Hi @katinthehatsite, @wojtekn, I have applied the patch to the @wordpress/components npm package as part of d92d1a5 but that adds some extra padding to the arrow on the collapsed component on both Mac and Windows, please see the screenshots on the Description of the PR.

Could you please review them and let me know your view? I would be happy to revert to the previous version if we don't think the extra padding should be there on Mac.

CleanShot 2025-10-30 at 12 32 22@2x
@katinthehatsite

Copy link
Copy Markdown
Contributor

Could you please review them and let me know your view? I would be happy to revert to the previous version if we don't think the extra padding should be there on Mac.

Hmm, if I were to be honest, I think it looked better before. Although I prefer the patch approach, I think user experience should be a priority and that gap is a bit 🫠

@epeicher

epeicher commented Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

Hmm, if I were to be honest, I think it looked better before. Although I prefer the patch approach, I think user experience should be a priority and that gap is a bit 🫠

@katinthehatsite, I totally agree. I managed to cover both requirements using a patch applied only on the affected platform, so it doesn’t impact the user experience elsewhere. The change is here 2d69ae5. I have updated the testing instructions and description to reflect this.

name: "1n00qi9-variantStyles",
- styles: "field-sizing:content;label:variantStyles;",
+ styles: isWindows ? "field-sizing:fixed;label:variantStyles;" : "field-sizing:content;label:variantStyles;",
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNlbGVjdC1jb250cm9sLXN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE4SVMiLCJmaWxlIjoic2VsZWN0LWNvbnRyb2wtc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBFeHRlcm5hbCBkZXBlbmRlbmNpZXNcbiAqL1xuaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IHN0eWxlZCBmcm9tICdAZW1vdGlvbi9zdHlsZWQnO1xuXG4vKipcbiAqIEludGVybmFsIGRlcGVuZGVuY2llc1xuICovXG5pbXBvcnQgeyBDT0xPUlMsIHJ0bCwgQ09ORklHIH0gZnJvbSAnLi4vLi4vdXRpbHMnO1xuaW1wb3J0IHsgc3BhY2UgfSBmcm9tICcuLi8uLi91dGlscy9zcGFjZSc7XG5pbXBvcnQgdHlwZSB7IFNlbGVjdENvbnRyb2xQcm9wcyB9IGZyb20gJy4uL3R5cGVzJztcbmltcG9ydCBJbnB1dENvbnRyb2xTdWZmaXhXcmFwcGVyIGZyb20gJy4uLy4uL2lucHV0LWNvbnRyb2wvaW5wdXQtc3VmZml4LXdyYXBwZXInO1xuaW1wb3J0IHsgZm9udFNpemVTdHlsZXMgfSBmcm9tICcuLi8uLi9pbnB1dC1jb250cm9sL3N0eWxlcy9pbnB1dC1jb250cm9sLXN0eWxlcyc7XG5pbXBvcnQgSW5wdXR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50Q29sb3I7IC8vIE92ZXJyaWRlcyBob3Zlci9mb2N1cyBzdHlsZXMgaW4gZm9ybXMuY3NzXG5cdFx0Y3Vyc29yOiBpbmhlcml0O1xuXHRcdGRpc3BsYXk6IGJsb2NrO1xuXHRcdGZvbnQtZmFtaWx5OiBpbmhlcml0O1xuXHRcdG1hcmdpbjogMDtcblx0XHR3aWR0aDogMTAwJTtcblx0XHRtYXgtd2lkdGg6IG5vbmU7XG5cdFx0d2hpdGUtc3BhY2U6IG5vd3JhcDtcblx0XHR0ZXh0LW92ZXJmbG93OiBlbGxpcHNpcztcblxuXHRcdCR7IGZvbnRTaXplU3R5bGVzIH07XG5cdFx0JHsgc2l6ZVN0eWxlcyB9O1xuXHRcdCR7IHNpemVQYWRkaW5ncyB9O1xuXHRcdCR7IG92ZXJmbG93U3R5bGVzIH1cblx0XHQkeyB2YXJpYW50U3R5bGVzIH1cblx0fVxuYDtcblxuZXhwb3J0IGNvbnN0IERvd25BcnJvd1dyYXBwZXIgPSBzdHlsZWQuZGl2YFxuXHRtYXJnaW4taW5saW5lLWVuZDogJHsgc3BhY2UoIC0xICkgfTsgLy8gb3B0aWNhbGx5IGFkanVzdCB0aGUgaWNvblxuXHRsaW5lLWhlaWdodDogMDtcblxuXHRwYXRoIHtcblx0XHRmaWxsOiBjdXJyZW50Q29sb3I7XG5cdH1cbmA7XG5cbmV4cG9ydCBjb25zdCBJbnB1dENvbnRyb2xTdWZmaXhXcmFwcGVyV2l0aENsaWNrVGhyb3VnaCA9IHN0eWxlZChcblx0SW5wdXRDb250cm9sU3VmZml4V3JhcHBlclxuKWBcblx0cG9zaXRpb246IGFic29sdXRlO1xuXHRwb2ludGVyLWV2ZW50czogbm9uZTtcblxuXHQkeyBydGwoIHsgcmlnaHQ6IDAgfSApIH1cbmA7XG4iXX0= */",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Any reason to add a source map with this patch?

@epeicher epeicher Oct 31, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

That's done automatically by patch-package utility when generating the patch, I have tried to remove it manually but the patch fails to be applied in that case

@epeicher
epeicher merged commit 0ee36df into trunk Nov 5, 2025
15 checks passed
@epeicher
epeicher deleted the stu-843-studio-sync-select-files-and-folders-menu-needs-right-margin branch November 5, 2025 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants