Skip to content

Update toolbox icon/text padding#659

Open
lawsie wants to merge 3 commits into
flipcomputing:mainfrom
lawsie:toolbox-icons
Open

Update toolbox icon/text padding#659
lawsie wants to merge 3 commits into
flipcomputing:mainfrom
lawsie:toolbox-icons

Conversation

@lawsie
Copy link
Copy Markdown
Collaborator

@lawsie lawsie commented May 28, 2026

Summary

Attempt to fix the look and feel of the toolbox icons on mobile. I think this has been broken by Blockly 13.

Screenshot 2026-05-28 at 17 07 32
  • Icons should now be centered properly and easy to see/click
  • On light theme, sub-categories get a slightly lighter background so that you can see the relationship
  • The focus highlight is now a vertical bar at the left on mobile
  • Hopefully no more duplicate highlights

AI usage

Claude Sonnet 4.6 used throughout, everything run past a human and approved individually. Design by a human.

Summary by CodeRabbit

  • Style
    • Enhanced visual theming and accessibility across all color modes (dark, contrast, low-vision).
    • Improved search highlighting and input styling for desktop and mobile layouts.
    • Increased toolbox category icon size for better visibility.
    • Better keyboard navigation focus indicators and styling.
    • Redesigned mobile search overlay with improved appearance and animations.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 28, 2026

📝 Walkthrough

Walkthrough

Updated Blockly CSS theming infrastructure across multiple color modes (dark, light, contrast, low-vision) with token standardization, expanded mobile toolbox layout and search overlay styling, and introduced mobile/light-aware category background tinting in JavaScript using conditional CSS color-mix blending.

Changes

Blockly Theming & Mobile Toolbox Improvements

Layer / File(s) Summary
CSS Token & Theme Infrastructure
style/blockly.css
Reorganized dropdown/menu border CSS token definitions in :root and theme-specific blocks, switching from multiline variable definitions to single-line self-referencing patterns with normalized selector quoting conventions.
Theme-Specific Text & UI Colors
style/blockly.css
Updated text, input, dropdown, and search element colors across dark, dark-contrast, contrast, and low-vision themes; reorganized search highlight styling, text input backgrounds, and insertion marker fills per theme with consistent selector forms.
Flyout & Toolbox Base Styling
style/blockly.css
Applied explicit theme-scoped overrides for flyout backgrounds, text/label fill rules, and toolbox backgrounds across low-vision, dark-contrast, and dark themes.
Desktop & Mobile Search Input Layout
style/blockly.css
Updated desktop toolbox search input selectors with :has() pseudo-class scoping; implemented mobile search overlay styling with dedicated input container rules and absolutely-positioned search input; reformatted mobile search expand/collapse keyframe animations.
Keyboard Navigation & Focus States
style/blockly.css
Updated active and passive keyboard focus styling for dropdown fields and image-button fields with cursor-pointer selectors, including outline and stroke adjustments per focus state.
Comment & Axis Visual Updates
style/blockly.css
Added/rewired theme-specific comment icon and bubble tail/draggable styling for dark, dark-contrast, and contrast themes; updated XYZ axis selection stroke rules with single-quote selector forms and grouped active/selected axis conditions.
Mobile-Aware Category Tinting
toolbox.js
Introduced mobile/light-theme detection helpers and subcategoryBg() function that conditionally tints subcategory background colors using CSS color-mix; updated both custom category implementations to apply computed tints on initial render and during selection updates; increased icon sizes from 24px to 30px in both custom categories.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • flipcomputing/flock#624: Both PRs touch the toolbox focus/keyboard-navigation styling in style/blockly.css with shared focus-color token usage for toolbox category outlines.
  • flipcomputing/flock#654: Both PRs modify the mobile toolbox search UI in style/blockly.css, including overlay styling and search highlighting visuals.
  • flipcomputing/flock#658: Both PRs update mobile search overlay styling in style/blockly.css with overlapping search input rules and keyframe animation implementations.

Suggested labels

codex

Poem

🐰 The toolbox now shines in every light,
Mobile screens get their tinted sight,
CSS tokens flow clean and neat,
Categories blend colors so sweet,
Keyboard focus guides the way bright!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Update toolbox icon/text padding' is only partially related to the changeset. While the PR does address toolbox icon styling changes, the actual modifications involve comprehensive CSS theme updates, mobile-specific search overlays, category tinting helpers, and icon size increases (24×24 to 30×30). The padding aspect is a minor component of larger scope changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
style/blockly.css (1)

325-337: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Restore a positioned ancestor for the toolbox search row.

The input stays position: absolute, but these overrides remove the wrapper’s positioning context with position: static. Without a new position: relative on the search category, the field can anchor to the toolbox/viewport instead of its own row, which makes the search box jump to the wrong place on desktop and mobile.

Suggested fix
+.blocklyToolbox .blocklyToolboxCategory:has(input[type='search']) {
+  position: relative;
+}
+
 .blocklyTreeRowContentContainer input[type='search'] {
   position: absolute;
   top: 0;
   left: 0;

Also applies to: 723-728, 788-800

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@style/blockly.css` around lines 325 - 337, The search input is absolutely
positioned but its wrapper lost positioning context, causing it to anchor to the
toolbox/viewport; restore a positioned ancestor by adding position: relative to
the search row container (e.g. the .blocklyTreeRowContentContainer or the
specific search category wrapper used alongside the selector
.blocklyTreeRowContentContainer input[type='search']) so the input is positioned
relative to its row; apply the same fix to the other similar rule blocks noted
(lines around 723-728 and 788-800) to ensure consistent behavior on desktop and
mobile.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@style/blockly.css`:
- Around line 511-558: The stylelint errors come from illegal quoting of the
Asap font family and a compact block comment; update all font-family
declarations (e.g., in selectors body .blocklyText, body .blocklyTreeLabel,
body[data-theme='contrast'] .blocklyText, body[data-theme='dark']
.blocklyTreeLabel, etc.) to remove quotes around Asap and ensure proper
comma/space formatting (e.g., 'Atkinson Hyperlegible Next', Asap, Helvetica,
Arial, Lucida, sans-serif) and expand or reformat any compact block comment to
satisfy stylelint spacing rules (use standard /* ... */ formatting with
spaces/newlines) so the hunk no longer triggers stylelint.

---

Outside diff comments:
In `@style/blockly.css`:
- Around line 325-337: The search input is absolutely positioned but its wrapper
lost positioning context, causing it to anchor to the toolbox/viewport; restore
a positioned ancestor by adding position: relative to the search row container
(e.g. the .blocklyTreeRowContentContainer or the specific search category
wrapper used alongside the selector .blocklyTreeRowContentContainer
input[type='search']) so the input is positioned relative to its row; apply the
same fix to the other similar rule blocks noted (lines around 723-728 and
788-800) to ensure consistent behavior on desktop and mobile.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3e6378ac-4ee3-40a2-a195-38877ae1c677

📥 Commits

Reviewing files that changed from the base of the PR and between 754a577 and 39e85ce.

📒 Files selected for processing (2)
  • style/blockly.css
  • toolbox.js

Comment thread style/blockly.css
Comment on lines +511 to +558
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body .blocklyText {
font-weight: 500 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body .blocklyTreeLabel {
font-weight: 500 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="contrast"] .blocklyText {
body[data-theme='contrast'] .blocklyText {
font-weight: 600 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="dark-contrast"] .blocklyText {
body[data-theme='dark-contrast'] .blocklyText {
font-weight: 600 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="dark-contrast"] .blocklyTreeLabel {
body[data-theme='dark-contrast'] .blocklyTreeLabel {
font-weight: 500 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="contrast"] .blocklyTreeLabel {
body[data-theme='contrast'] .blocklyTreeLabel {
font-weight: 500 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="dark"] .blocklyText {
body[data-theme='dark'] .blocklyText {
font-weight: 500 !important;
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
}

body[data-theme="dark"] .blocklyTreeLabel {
body[data-theme='dark'] .blocklyTreeLabel {
font-family:
"Atkinson Hyperlegible Next", "Asap", Helvetica, Arial, Lucida, sans-serif !important;
'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Clear the stylelint errors in this hunk.

The quoted Asap family name and the compact block comment still trip the current stylelint rules, so this file will keep reporting static-analysis errors until those are cleaned up.

Suggested fix
-    'Atkinson Hyperlegible Next', 'Asap', Helvetica, Arial, Lucida, sans-serif !important;
+    'Atkinson Hyperlegible Next', Asap, Helvetica, Arial, Lucida, sans-serif !important;
-    /*pointer-events: auto;*/
+    /* pointer-events: auto; */

Also applies to: 799-799

🧰 Tools
🪛 Stylelint (17.12.0)

[error] 511-511: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 517-517: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 523-523: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 529-529: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 535-535: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 541-541: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 547-547: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 553-553: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)


[error] 558-558: Expected no quotes around "Asap" (font-family-name-quotes)

(font-family-name-quotes)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@style/blockly.css` around lines 511 - 558, The stylelint errors come from
illegal quoting of the Asap font family and a compact block comment; update all
font-family declarations (e.g., in selectors body .blocklyText, body
.blocklyTreeLabel, body[data-theme='contrast'] .blocklyText,
body[data-theme='dark'] .blocklyTreeLabel, etc.) to remove quotes around Asap
and ensure proper comma/space formatting (e.g., 'Atkinson Hyperlegible Next',
Asap, Helvetica, Arial, Lucida, sans-serif) and expand or reformat any compact
block comment to satisfy stylelint spacing rules (use standard /* ... */
formatting with spaces/newlines) so the hunk no longer triggers stylelint.

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.

1 participant