fix(tile-manager): Safari text selection and maximized tile height#2257
Open
rkaraivanov wants to merge 1 commit into
Open
fix(tile-manager): Safari text selection and maximized tile height#2257rkaraivanov wants to merge 1 commit into
rkaraivanov wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses two Tile Manager bugs: unwanted text selection while dragging tiles in Safari, and grid container height collapsing when maximizing the only tile contributing to the tallest row-span (issues #2244 and #2029).
Changes:
- Updates the shared
DragControllerto better prevent text selection during active drags (including Safari-specific-webkit-user-selecthandling). - Adds a Tile Manager context hook so tiles can notify the manager when
maximizedchanges, allowing the manager to lock/unlock the grid container height. - Adds unit tests covering the “maximize preserves height / releases lock” behavior (issue #2029).
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/components/tile-manager/tile.ts | Switches maximized setter to notify the tile manager via context hook. |
| src/components/tile-manager/tile-manager.ts | Adds _setMaximizedState() to lock grid min-height while any tile is maximized. |
| src/components/tile-manager/tile-manager.spec.ts | Adds regression tests for issue #2029 (height lock/release behavior). |
| src/components/common/controllers/drag.ts | Extends drag styling to include webkitUserSelect and disables selection more broadly during drag. |
| src/components/common/context.ts | Extends TileManagerContext with setMaximizedState() callback. |
Comment on lines
+260
to
+274
| private _setMaximizedState(): void { | ||
| const grid = this._grid.value; | ||
|
|
||
| if (grid) { | ||
| if (this.tiles.some((tile) => tile.maximized)) { | ||
| if (!grid.style.minHeight) { | ||
| grid.style.minHeight = `${grid.offsetHeight}px`; | ||
| } | ||
| } else { | ||
| grid.style.minHeight = ''; | ||
| } | ||
| } | ||
|
|
||
| this.requestUpdate(); | ||
| } |
Comment on lines
+378
to
+388
| private _toggleTextSelection(disabled: boolean): void { | ||
| const value = disabled ? 'none' : ''; | ||
| const { style } = this._host.ownerDocument.body; | ||
|
|
||
| style.userSelect = value; | ||
| style.webkitUserSelect = value; | ||
|
|
||
| if (disabled) { | ||
| this._host.ownerDocument.getSelection()?.removeAllRanges(); | ||
| } | ||
| } |
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.
Description
giving it the intrinsic grid size.
Type of Change
Related Issues
Closes #2244 #2029
Checklist