Skip to content

fix(inline-links): drop the trailing context-menu box from inline task links - #2303

Merged
callumalpass merged 2 commits into
callumalpass:mainfrom
nelsonlove:fix/inline-link-trailing-space
Sep 10, 2026
Merged

callumalpass merged 2 commits into
callumalpass:mainfrom
nelsonlove:fix/inline-link-trailing-space

Conversation

@nelsonlove

Copy link
Copy Markdown
Contributor

The problem

Inline task links carry an odd gap after them in running prose.

The cause is .task-card__context-menu, which is opacity: 0 until its card is hovered. That hides it but keeps its box in layout:

https://github.com/callumalpass/tasknotes/blob/main/styles/task-card-bem.css#L827-L839

.tasknotes-plugin .task-card__context-menu {
    width: 14px;
    height: 14px;
    opacity: 0;
    margin-left: auto;
}

In the card layouts this costs nothing - the element sits at the end of a row of its own, and margin-left: auto parks it against the edge. In --layout-inline it is 14px of dead space after every link, plus the row's 4px gap, and margin-left: auto does nothing inline.

Measured on a live vault, walking the rendered inline widgets and taking the distance from the right edge of .task-card__content to the right edge of .task-card__main-row:

trailing space
before 14px (0px on links without the element)
after 0px

The change

One rule, scoped to the inline layout. Card, kanban and list layouts are untouched.

Removed rather than hidden-until-hover: an invisible target inside a sentence cannot be aimed for, and the link still has its right-click menu. If you would rather keep it reachable, position: absolute or a zero-width box that expands on hover would also remove the space - happy to switch.

Nelson Love and others added 2 commits September 8, 2026 19:18
…k links

The context-menu affordance is `opacity: 0` until its card is hovered, which hides it
but keeps its 14px box in layout. In the card layouts that costs nothing: it sits at
the end of a row of its own, and `margin-left: auto` parks it against the edge.

In `--layout-inline` it is 14px of dead space after every task link, plus the row's
4px gap, sitting in the middle of running prose. Measured on a live vault, the gap
between the end of the link text and the end of the widget was 14px on links carrying
the element and 0px on those without.

It is removed for the inline layout rather than hidden until hover, because an
invisible target inside a sentence cannot be aimed for, and the link still has its
right-click menu.
@callumalpass
callumalpass merged commit d686847 into callumalpass:main Sep 10, 2026
2 checks passed
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.

2 participants