Skip to content

feat(donut): the centre shows cancel while a file is over it (#1446) - #1977

Open
cre8ive-marketing wants to merge 3 commits into
KnifeLemon:mainfrom
cre8ive-marketing:feature/1446-cancel-centre
Open

cre8ive-marketing wants to merge 3 commits into
KnifeLemon:mainfrom
cre8ive-marketing:feature/1446-cancel-centre

Conversation

@cre8ive-marketing

Copy link
Copy Markdown
Collaborator

Closes #1446

What changes

This strengthens the existing hot state in DonutMenu.DrawCenter instead of adding a second one. The ⊘ cursor stays.

  • Fade: a new _cancel spring goes to 1 while _externalCenterHot is set, and back to 0 after. It snaps when Motion.Enabled is false, as the rest of DonutMenu does.
  • Tint and ring: the tint is DangerBrush at 22% (was 18%), with a 2 px DangerBrush ring, both faded by the spring.
  • ✕: a 12 px cross in DangerBrush is drawn above the title, with the text. The layout makes room for it, and CenterPlanKey has a new Cancel flag, so cached layouts with and without it stay apart.
  • Bold text: donut.cancel (the subtitle while hot) is drawn in the bold typeface.
  • Screen readers: left out, as you said.

Tests

  • DonutHighlightTests.The_centre_fades_into_its_cancel_look_and_back:
    • after one frame the cancel look is partway, not jumped;
    • it settles at 1, then at 0 after the drag leaves;
    • with reduced motion it is 1 at once.
  • DonutHighlightTests.The_cancel_centre_is_drawn_in_the_danger_colour: a headless render. A pixel in the centre, below the text, is neutral before and red after.
  • AccentContrastTests.The_donuts_cancel_centre_stays_readable:
    • in every built-in look (EveryLook()), DangerBrush on the centre (SurfaceBrush tinted with DangerBrush at 22%) has contrast of at least 3:1;
    • 3:1 is WCAG's bar for bold text and graphics.

Not checked

  • I ran the Donut and contrast tests, not the full App suite.
  • Not looked at in the real app on screen.

While a dragged file is over the donut's centre, the centre now fades
to a DangerBrush tint with a DangerBrush ring, a cross is drawn above
its text and "Drop here to cancel" is bold. It snaps when animations
are off. The cursor stays as before.

Closes KnifeLemon#1446
@github-actions github-actions Bot added the feature New features label Dec 2, 2026
@cre8ive-marketing
cre8ive-marketing marked this pull request as ready for review December 2, 2026 04:31

@KnifeLemon KnifeLemon left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @cre8ive-marketing, this builds on the existing hot state as planned, and the headless pixel test is a good touch.

Small things:

  1. FinishAnimations() (the stalled-loop fallback) snaps _hover, _centerPulse and _expand, but not the new _cancel. If frames stop mid-fade (say the window hides right after a drop on the centre), the red tint can stay partway and show on the next open. Could you add _cancel = new Spring { Value = _externalCenterHot ? 1 : 0 }; there?
  2. Contrast bar: the test uses 3:1 for "bold text". WCAG's bold large-text exception starts at 14 pt (about 18.7 px), and the subtitle is 11.5 px bold, so for the text the bar is 4.5:1. 3:1 is right for the ✕. Could you check the text at 4.5:1, or tell us which looks fall short?
  3. Minor: only the tint and the ring fade. The ✕, the bold red text and the 8 px shift of the title switch at once, so "It fades in and out" in the CHANGELOG is a bit generous.

We'll also look at it on the smallest donut with a long translation (German), to make sure the ✕ and a two-line bold subtitle stay inside the hole.

# Conflicts:
#	CHANGELOG.md
… when frames stop

- Red bold text on the red tint missed 4.5:1 in the Soft looks (3.71 light, 4.46 dark) and MaterialYou light
  (3.71-4.41). The text now keeps the text colour (8.6:1 or more); the ✕, ring and tint stay red (✕ 3.71:1 or more).
  The contrast test checks the text at 4.5:1 and the ✕ at 3:1.
- FinishAnimations snaps the cancel fade, so no tint is left partway for the next open.
- CHANGELOG says what fades and what switches at once.
@cre8ive-marketing

Copy link
Copy Markdown
Collaborator Author

Thanks, done in 68fef60:

  1. FinishAnimations() now snaps _cancel too, to 1 if the centre is still hot, else 0. Test added in DonutHighlightTests.
  2. Contrast: the red bold "Cancel" text failed 4.5:1 in all Soft looks (3.71 light, 4.46 dark) and in Material You light (3.71–4.41). So the text now uses the normal Foreground (8.6:1 or more). The ✕, ring and tint stay red; the ✕ is 3.71:1 or more, which passes the 3:1 for graphics. AccentContrastTests checks both. This changes the look a little, so say if you'd rather keep red text some other way.
  3. The CHANGELOG now says the tint and ring fade, while the ✕ and bold text switch at once.

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

Labels

feature New features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Change ⊘ mouse symbol when file hovers over the central cancellation node

2 participants