Skip to content

fix(tile-manager): Safari text selection and maximized tile height#2257

Open
rkaraivanov wants to merge 1 commit into
masterfrom
rkaraivanov/tile-manager-fixes
Open

fix(tile-manager): Safari text selection and maximized tile height#2257
rkaraivanov wants to merge 1 commit into
masterfrom
rkaraivanov/tile-manager-fixes

Conversation

@rkaraivanov

Copy link
Copy Markdown
Member

Description

  • Skip text selection in drag mode when using Safari.
  • Cache the size of the tile manager before maximizing a tile in the case it is the one
    giving it the intrinsic grid size.

Type of Change

  • Bug fix (non-breaking change that fixes an issue)

Related Issues

Closes #2244 #2029

Checklist

  • My code follows the project's coding standards
  • I have tested my changes locally

Copilot AI review requested due to automatic review settings June 17, 2026 11:52

Copilot AI 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.

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 DragController to better prevent text selection during active drags (including Safari-specific -webkit-user-select handling).
  • Adds a Tile Manager context hook so tiles can notify the manager when maximized changes, 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();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tile Manager dragging causes text selection highlight in other tiles in Safari

2 participants