💄 Draw the reading options box only in its dropdown

The reading options of the whole text, in the Furigana group, sit among
the other rows of the language view and need no box. The box now marks
them only when the ⋮ button of a selection opens them below its reading
input.

AI-assisted-by: claude-opus-5-5
This commit is contained in:
alonso.torres 2026-11-25 00:59:43 +01:00
parent 11e1647b7f
commit 90f857c697
2 changed files with 13 additions and 6 deletions

View File

@ -545,16 +545,18 @@
(mf/defc ruby-presentation-grid*
"Size and side, then alignment and overhang of the readings, two to a
row in a light box. Side names both writing modes, so it reads the same
in horizontal and vertical text."
[{:keys [values on-change on-blur class]}]
row. `boxed` draws them in a light box, to set them apart from the rows
around them when a button opens them. Side names both writing modes, so
it reads the same in horizontal and vertical text."
[{:keys [values on-change on-blur class boxed]}]
(let [props (mf/props {:values values :on-change on-change :on-blur on-blur})
options (mf/with-memo []
{:ruby-size (ruby-size-options tr)
:ruby-side (ruby-side-options tr)
:ruby-align (ruby-align-options tr)
:ruby-overhang (ruby-overhang-options tr)})]
[:div {:class [class (stl/css :ruby-presentation-grid)]
[:div {:class [class (stl/css-case :ruby-presentation-grid true
:ruby-presentation-grid-boxed boxed)]
:data-testid "ruby-presentation-options"}
[:> ruby-presentation-cell* (mf/spread-props props {:attr :ruby-size
:label (tr "workspace.options.text-options.ruby-size")
@ -591,4 +593,5 @@
(when ^boolean open?
[:> ruby-presentation-grid* {:values values
:on-change on-change
:on-blur on-blur}])]))
:on-blur on-blur
:boxed true}])]))

View File

@ -123,11 +123,15 @@
color: var(--color-foreground-error);
}
// The reading options, two to a row in a light box.
// The reading options, two to a row.
.ruby-presentation-grid {
display: grid;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: var(--sp-s) var(--sp-xs);
}
// In a light box when a button opens them below the reading input.
.ruby-presentation-grid-boxed {
padding: var(--sp-s);
border: $b-1 solid var(--color-background-quaternary);
border-radius: $br-8;