Skip to content

fix(editor): keep task links on one row on tablets and in narrow desktop panes (#2696) - #2697

Open
callumalpass wants to merge 1 commit into
mainfrom
fix/2696-narrow-inline-widget
Open

callumalpass wants to merge 1 commit into
mainfrom
fix/2696-narrow-inline-widget

Conversation

@callumalpass

Copy link
Copy Markdown
Owner

Fixes #2696.

Cause

The stacked layout for inline task cards (title, then a row of 40px touch targets for priority, menu and properties) is meant for phones, but two selectors turned it on elsewhere:

  • The phone layout rules were scoped to body.is-mobile, which Obsidian also sets on tablets. On an iPad every standalone task link used the full-width two-row phone card at any width (84–86px per line). Readable line length has no effect on this.
  • The @container (max-width: 480px) stacked layout had no device check, so a desktop pane narrower than about 550px switched to it (68–71px per line, against 28–30px in a wide pane). Readable line length only caps the width at 700px, so it never crosses that threshold.

Fix

styles/task-inline-widget.css:

Measurements (Live Preview, default properties)

Case main this PR
Desktop, 480px pane 68–71px 28–30px
iPad emulation 820×1180 / 1180×820 84–86px 44–46px
Phone emulation 390×844 68–71px 68–71px (unchanged)

Tests

  • New e2e/issues/issue-2696-tablet-narrow-inline-widget.spec.ts: a narrow desktop pane and tablet emulation (is-tablet). It fails on main (68px).
  • These pass: the 2579 desktop and mobile specs, 2595, 2598, 2613, 2643 and task-list-redesign.
  • Lint, typecheck and unit tests pass (6619 passed).

…top panes (#2696)

The stacked inline-card layout (title, then a row of touch targets) was keyed
on body.is-mobile, which tablets also have, and on a 480px container query on
every device. Scope both to body.is-phone so tablets and narrow desktop panes
keep the one-row layout, and apply the properties-under-title layout for
standalone task links on every non-phone width.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FR]: FR #2579 fixed for computer and phone but not yet for iPad

1 participant