Skip to content

fix #1968: prevent inline task widget collapse on mobile#1967

Open
renatomen wants to merge 1 commit into
callumalpass:mainfrom
renatomen:fix/task-overlay-spacing-mobile
Open

fix #1968: prevent inline task widget collapse on mobile#1967
renatomen wants to merge 1 commit into
callumalpass:mainfrom
renatomen:fix/task-overlay-spacing-mobile

Conversation

@renatomen
Copy link
Copy Markdown
Contributor

@renatomen renatomen commented May 29, 2026

Problem

Fix: #1968
On mobile, the inline TaskNotes widget (a [[task]] link rendered in the editor) collapses: the task title is invisible and a large empty vertical gap appears between the widget and the following line. Only the status dot and ⋮ menu show.

Root cause

Commit 26ba653 ("Improve mobile task card layout") added a container context to every card:

.tasknotes-plugin .task-card { container: tn-task-card / inline-size; }
  • On desktop, the inline widget is display: inline, where inline-size containment is inert → renders fine.
  • On mobile/touch, the same commit makes the inline widget display: inline-flex. That activates the containment: the card now computes its width while ignoring its contents, collapsing the card (and its title) to 0px wide.
  • The title then wraps one character per line. overflow: hidden clips it horizontally (title invisible), while its height inflates the flex parents and the CodeMirror line → the large empty gap.

Fix

Scope the container to the full card layout only. The single @container tn-task-card query already targets :not(.task-card--layout-inline):not(.task-card--layout-compact), so this changes no responsive behaviour:

.tasknotes-plugin .task-card:not(.task-card--layout-inline):not(.task-card--layout-compact) {
    container: tn-task-card / inline-size;
}

Verification

Measured in real Chromium with the exact widget DOM + plugin CSS under body.is-mobile:

Metric Before After
Inline widget line height 854.8px 46px
Title text size 13.3 × 845.5px (clipped, invisible) 313.6 × 17px (visible)
Desktop inline widget unchanged

stylelint styles/task-card-bem.css passes; existing issue-190 mobile CSS test passes.

The container context added in 26ba653 ("Improve mobile task card
layout") was applied unconditionally to every .task-card. On desktop the
inline widget is `display: inline`, where inline-size containment is
inert, so it rendered fine. On mobile/touch the widget becomes
`display: inline-flex`, which activates the containment: the card then
computes its width ignoring its contents, collapsing the card and title
to 0px wide. The title wraps one char per line - clipped invisible by
`overflow: hidden`, while its height inflates the flex parents and the
editor line, producing a large empty gap with no visible title.

Scope the container to the full card layout only. The sole
`@container tn-task-card` query already targets
:not(--layout-inline):not(--layout-compact), so responsive behaviour
is unchanged.

Verified in Chromium: mobile inline widget line height 854px -> 46px,
title restored to a single visible line.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@renatomen renatomen changed the title fix: prevent inline task widget collapse on mobile fix #1968: prevent inline task widget collapse on mobile May 29, 2026
@renatomen renatomen marked this pull request as ready for review May 29, 2026 21:27
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.

[Bug]: inline task overlay widget collapse on mobile

1 participant