Skip to content

SQLBI Whiteboard 1.2.1

Choose a tag to compare

@marcosqlbi marcosqlbi released this 31 Aug 12:53
e169783
Offer mouse drawing when the mouse reaches for the toolbar (#82)

1.2.0 left Mouse drawing discoverable only in Preferences, which is the
one place someone who does not know the feature exists will not look.
The signal that they might want it is already in the application:
**picking a tool from the toolbar with the mouse.** A pen user reaches
for the palette with the pen, so a mouse arriving there is someone whose
next stroke is going to disappoint them.

## The dialog

`MouseModeOfferWindow` — "Draw with a mouse?", an unchecked **Don't show
me this again**, and **Enable mouse mode** / **Cancel**.

The offer is a question, not a confirmation, and the two answers are not
interchangeable: one changes what the left button means. So:

- **Neither button is `IsDefault` or `IsCancel`, and Enter is
swallowed.** A focused non-default `Button` responding to Enter is
version- and style-dependent, so rather than rely on it not firing,
`Window_PreviewKeyDown` marks *every* Enter handled — it tunnels from
the Window before any button's `KeyDown` — and invokes a button only
when `Keyboard.FocusedElement` is one of ours. Enter with nothing
focused, or with the checkbox focused, does nothing and leaves the
dialog open.
- **Escape closes**, because dismissing is always safe.
- **Nothing is focused on open.** `Keyboard.Focus(this)` in `Loaded`, so
the first Tab reaches the checkbox rather than a primed button —
otherwise the checkbox takes focus and a stray Space answers the wrong
question.

## Three judgment calls

- **Once a session.** Prompting on every toolbar click would be
intolerable; prompting once ever would lose someone not ready to decide.
A Cancel answers this session, the checkbox answers every one after it.
- **The offer is queued at background priority, not shown from the click
handler**, so the click first does what it came to do. The tool is
selected, and the dialog then explains why it may not behave as
expected.
- **A `SuggestMouseMode` setting** (settings version 13 → 14) with a
Preferences entry under Input, because "don't show again" is otherwise a
one-way door. `WarnWhenNoDigitizer` sets the precedent.

**Enable mouse mode** sets `MouseMode.On` rather than `WhenNoDigitizer`,
because the offer can only have appeared where the automatic default
already decided not to.

Decision 24 records all of it. Version is 1.2.1.

## Verification

Build clean, Core smoke tests pass including the settings round-trip and
the 13 → 14 upgrade. Those tests are UI-free, so the dialog's behaviour
is not covered by them; the README gains a second validation list under
Mouse drawing validation, and every item on it is about a key doing
nothing — the part a later change is most likely to undo.

A slow-shutdown regression was investigated against this branch and did
not reproduce on the maintainer's machine. A clean launch-and-close
measures 85–358 ms. No change was made for it.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>