parascape.ai_button
The AI symbol, drawn and behaving as spaCR draws it.
Einar: "the ai symbol should work in the same way". In spaCR the symbol is not a picture and not a button with a word on it. It is a ring with a filled dot inside, sitting at the right-hand end of the search field, and it is a switch:
- Click turns the assistant on or off. The dot is only there while it is on, so the state is readable at a glance without a label.
- The colour of the dot is the provider: white for the free ParaScape AI, orange for Claude, green for Codex, blue for Gemini.
- Typing makes the dot pulse, larger for faster typing, and it settles back within a second. Nothing is sent by typing; the pulse only says that the field is listening.
- While an answer is being written the dot is circled by a marker (the free provider) or a glow (the others), so waiting does not look like nothing happening.
- Right-click chooses the provider. The first click, with no provider chosen yet, asks the same question instead of guessing.
- The motion stops when the symbol is hidden or Reduce motion is on, and it never runs while the assistant is off.
This module holds the drawing and the choice of provider. What the page does with an answer lives
in :mod:parascape.navigator, because that is where the answer is shown.
The ring-and-dot switch at the end of the Navigator field.
Checkable, keyboard-focusable, and painted by hand because the whole point is that it is not
a labelled button. It owns only its own drawing; the page connects clicked to the turning
on and off, and customContextMenuRequested to the choice of provider.
Pulse the dot for a key just typed, larger the faster the typing.
Connected to the field, so the symbol shows that the field is listening. It never sends anything.
:param _text: the text of the field, ignored.
Say whether an answer is being written, which makes the waiting motion run.
:param busy: True from the moment a question is sent until the answer is complete or cancelled.
Change the colour of the dot to that of a provider.
:param name: a provider name from :data:PROVIDER_COLORS; an unknown one draws white.
The colour the dot is filled with now: that of the chosen provider.
Choose which assistant answers, saying plainly what is shared before it is chosen.
spaCR asks this on the first click and on a right-click. The wording says what leaves the computer, because choosing a provider is the moment a person agrees to that.