Conversation
There was a problem hiding this comment.
🟡 Changes recommended
Layout containment changes the containing block for existing fixed-position overlays, breaking viewport-based positioning.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Replaces JavaScript narrow-mode detection with responsive CSS container queries.
Changes:
- Removes the synchronous
offsetWidthcheck. - Adds container-query styling for toolbar, toolbox, and RTL layouts.
- Adds Cypress regression coverage for initialization and holder resizing.
File summaries
| File | Description |
|---|---|
src/components/modules/ui.ts |
Removes narrow-mode detection and class. |
src/styles/ui.css |
Defines the container and responsive layout. |
src/styles/toolbar.css |
Repositions the plus button. |
src/styles/toolbox.css |
Aligns the narrow toolbox. |
src/styles/rtl.css |
Adds responsive RTL positioning. |
src/styles/variables.css |
Renames the toolbar spacing variable. |
test/cypress/tests/modules/Ui.cy.ts |
Adds responsive-layout regressions. |
Review details
- Files reviewed: 7/7 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Replace layout containment with a ResizeObserver-driven responsive class so fixed overlays keep viewport coordinates without restoring the synchronous width read.
| } | ||
|
|
||
| this.nodes.wrapper.classList.toggle( | ||
| this.CSS.editorWrapperCompact, |
There was a problem hiding this comment.
You're simply renamed "narrow" to "compact". Consider removing this mode at all and make the responsive layout instead. The Plus should always stay left, even on thin containers.
Note 1. Screen may be wide, but the container holding the editor is thin. Note 2. Make sure, the mobile version works as before.
There was a problem hiding this comment.
Got it, that makes a lot of sense.
I’ve removed the hardcoded compact mode and transitioned to a fully responsive layout. The plus button is now pinned to the left even in narrow containers, and I verified that the mobile view still behaves as expected.
Ready for another look whenever you have time!
There was a problem hiding this comment.
Addressed in bc2dcb1. I removed the mode entirely: there is no narrow/compact class, holder-width read, or ResizeObserver now.
The toolbar and block content use a continuous CSS layout. On a 1000 px screen, resizing the editor holder to 500 px keeps the Plus button at the holder's leading edge and leaves the content after the action rail. I also added the mirrored RTL case explicitly because this repo's PostCSS build resolves logical properties to physical LTR properties.
Mobile keeps the existing toolbar and bottom-sheet toolbox behavior, and the fixed viewport overlay regression remains covered. Local verification is green: focused 9/9 and full Cypress 356/356 across 40 specs, plus lint and production build.
Could you please take another look?
|
@neSpecc The requested responsive-layout follow-up is available in It removes the Narrow/Compact runtime mode, holder-width decision, and Fresh local verification on this exact SHA with Node 18.20.1: focused The prior review threads are now outdated, while the Cypress and ESLint workflow runs remain |
codeCraft-Ritik
left a comment
There was a problem hiding this comment.
Avoiding contain: layout makes complete sense for keeping viewport-fixed overlays attached to the correct containing block.
Could we also verify whether the new continuous CSS layout introduces other unintended containing blocks for position: fixed elements? Specifically, ensure no parent container in the continuous rail layout uses transform, filter, perspective, or backdrop-filter, as those will also hijack the fixed positioning context.
|
@codeCraft-Ritik Following up on your containing-block question: the source/diff audit of
The previously pending CI checks have now all passed on this head: Cypress in Chrome, Edge and Firefox, plus ESLint. Scope: this follow-up uses a static source audit and those existing CI results, not a new local browser run. It does not claim coverage for host applications adding their own containing-block properties to external ancestors, or mobile scroll-lock behavior. No additional code changes were made. @neSpecc Could you re-review |
|
Any progress on this one? The requested changes seem to have been addressed (at least somewhat). Anything else that needs more work? 🙂 @neSpecc |
There was a problem hiding this comment.
🟡 Changes recommended
Holder-only resizing can leave the inline toolbar positioned using a stale cached content rectangle.
Get a fresh assessment by requesting another Copilot review.
Review details
- Files reviewed: 10/10 changed files
- Comments generated: 2
- Review effort level: Balanced
| width: min( | ||
| var(--content-width), | ||
| max(0px, calc(100% - var(--toolbar-actions-space))) | ||
| ); |
There was a problem hiding this comment.
Removed the persistent UI.contentRect cache. The getter now measures the current content bounds on demand, and InlineToolbar.move() reads the result once per positioning operation. No ResizeObserver, holder-width mode, or additional resize listener is introduced.
Added four regressions: LTR and RTL, each shrinking the holder from 700px to 350px and expanding it from 350px to 700px. Each case opens the toolbar first, closes it, changes only the holder width, then reopens it and checks the actual right edge against the current content column. The viewport stays fixed throughout. All four fail against 48ee794 without the fix and pass with it.
Local verification with Node 18.20.1 / Cypress 13.13.3 / headless Electron 118:
- Focused InlineToolbar + Ui specs: 19/19 passed, retries disabled.
- Full Cypress suite: 367/367 passed across 40 specs; the existing Flipper test used one configured retry.
- Source and test lint: no errors; changed test file: no warnings.
- Test/production builds and
git diff --check: passed.
The maintainer's version/changelog changes are preserved. This fixes positioning on reopening; it does not add live repositioning while a toolbar remains open. The new upstream CI run is separate from these local results.
Current upstream CI status: both Cypress and ESLint are action_required with zero jobs started. Could a maintainer approve these workflow runs? They have not run or passed on this new head yet.
Removed 'Narrow' ('Thin') mode and updated controls for non-mobile viewports.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Fixes #3022
What changed
ResizeObserver, ornarrow/compactmodifier classThe layout reacts directly to holder-size changes through CSS; it does not depend on a window resize event or a JavaScript breakpoint mode.
Reproduction
Before
bc2dcb1, a 500 px holder in a 1000 px viewport put the Plus button at x=483 (the holder's right side) instead of its leading content edge at x=9. The new regression checks first failed on that geometry and now pass with the Plus button at the holder's leading edge and the block content after the action rail.An RTL regression check also caught that this repository's PostCSS target resolves logical properties to physical LTR properties at build time. The final CSS therefore contains an explicit RTL mirror, and the compiled behavior is covered rather than inferred from source syntax.
Local verification
Ui.cy.ts: 9/9 passedyarn test:e2e: 356/356 passed across 40 specsyarn lint: exit 0 (existing repository warnings only; no errors)yarn lint:errors: exit 0yarn build: exit 0git diff --check: exit 0The full Cypress run completed without a process crash. Cypress retried one pre-existing
utils/flipper.cy.tscase once; it passed on retry and is outside this sizing path.