Skip to content

feat(adjustments): visibility toggles for every adjustment tool - #1833

Open
lalibertemarc wants to merge 3 commits into
CyberTimon:mainfrom
lalibertemarc:feat/color-tool-visibility
Open

lalibertemarc wants to merge 3 commits into
CyberTimon:mainfrom
lalibertemarc:feat/color-tool-visibility

Conversation

@lalibertemarc

@lalibertemarc lalibertemarc commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Each adjustment panel has an eye toggle that bypasses all of its tools at once. In the Color, Details and Effects panels, that makes it hard to judge what a single tool is doing. For example, the Color panel eye also turns off white balance. This PR gives every sub-tool its own eye toggle:

  • Color: White Balance, Presence, Hue, Color Grading, Color Mixer, Calibration
  • Details: Sharpening, Presence, Noise Reduction, Chromatic Aberration
  • Effects: Creative, Spatial, LUT, Vignette, Grain. Inside Spatial, Lens Blur, Relight and Fog each also get an eye next to their switch, shown while that effect is enabled.

Hiding a tool bypasses only its effect on the render. Its settings and controls stay as they are, so you can flip it on and off to compare. A panel's eye (and Spatial's) now switches all of its tools at once, and shows as off when every tool in it is off. This works in the main adjustments panel and inside masks. (As suggested in the thread, this started with Color Grading and Color Mixer only.)

Following the review feedback, the engine no longer knows how panels and menus are arranged. The frontend reads every eye itself and stores one flat yes/no list of which tools run. The engine just checks that list.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Performance improvement
  • Code refactoring
  • Documentation update
  • UI/UX improvement
  • Build/CI or Dependency update

Changes Made

  • Flat tool list. The edit (and each mask) stores activeTools: { colorMixer: false, fog: false, … }, keyed by tool id, where a missing key means the tool runs. It replaces sectionVisibility. The frontend helpers isToolActive, setToolActive and toggleToolActive expand a panel or Spatial into its tools using ADJUSTMENT_SECTION_TOOLS, which stays the only place that hierarchy is defined. Lens Blur, Relight and Fog are listed as subTools of spatial.
  • Engine. is_tool_active(adjustments, tool) is the only check. The global and mask builders gate each value by its tool (get_val("colorPresence", "saturation", …)), as do white balance, color calibration and LUT. lens_blur.rs, relight.rs, fog.rs and the two effect hashes in cache_utils.rs share is_effect_enabled, which replaces five copies of an inline effects visibility lookup.
  • Older edits render exactly as before.
    • When an older edit is opened, normalizeLoadedAdjustments converts its sectionVisibility flags into activeTools (getActiveTools).
    • Thumbnails and batch exports of edits that haven't been reopened are rendered from the sidecar directly. For those, the engine falls back to the old section flags while activeTools is missing. That legacy-only LEGACY_SECTION_TOOLS table is the one place the engine still knows the old sections, and it's only used for data saved before this change.
    • Old presets applied to a mask are converted the same way (mergeActiveTools).
  • UI without per-tool props. ControlsPanel and MasksPanel expose activeTools, their existing toggle handler and the panel id through ToolVisibilityContext. AdjustmentSubSection reads them by its id, so the Color, Details and Effects panels need no visibility code. A hidden tool is only dimmed while its panel is still on, so hiding a whole panel doesn't double-dim it. Masks keep their active-mask guard.
  • Shared button. The eye button is extracted from CollapsibleSection into ui/VisibilityToggle.tsx. Panels, tools and Spatial effects all use it, including the hover-reveal behaviour and the dimmed state (HIDDEN_CONTENT_CLASS). Tooltips reuse the existing ui.collapsibleSection.disableSection / enableSection keys, so there are no new i18n strings.
  • Spatial effects. Lens Blur, Relight and Fog repeated the same switch + collapsible wrapper. It's now one SpatialEffect component that also carries the eye. Relight keeps its data-relight-lights marker for ImageCanvas. Most of the Effects.tsx diff is re-indentation, so "Hide whitespace" makes it much shorter.
  • Typing in the touched files. The Effects slider handlers use the existing SliderChangeEvent instead of any, the Relight light sliders share handleLightSliderChange instead of repeating the parse, and CollapsibleSection types its props and hover timeout. ALL_ADJUSTMENT_TOOLS / ADJUSTMENT_TOOLS_BY_ID move from the panel customization menu into adjustments.ts so both can use them.
  • Re-enabling.
    • Right-click → Reset / Paste on a panel turns that panel's tools back on.
    • Picking a LUT turns the LUT tool on.
    • Auto adjust, single image or batch, turns on the tools it writes: Basic, Color Presence, Details Presence and Vignette. Before, it turned on whole panels. Batch auto first builds activeTools from an older sidecar's flags, so the panels that edit had hidden stay hidden.
    • The history list labels eye changes "Tool Visibility".

Screenshots/Videos

image image

Testing

  • These changes were tested locally by a human and confirmed to work.
  • I haven't added any automated tests to the code because the codebase currently lacks a test suite.

tsc, ESLint, Prettier, i18n:check, cargo fmt and cargo clippy --all-targets -- -D warnings show no new errors or warnings compared with main. ESLint goes from 38 to 0 warnings in Effects.tsx and from 6 to 0 in CollapsibleSection.tsx.

Test Configuration:

  • OS: Windows 10 Home (19045)
  • Hardware: AMD Ryzen 5 3600X, NVIDIA GeForce RTX 2070

Checklist

  • My code follows the project's code style
  • I haven't added unnecessary AI-generated code comments
  • My changes generate no new warnings or errors

Additional Notes

  • Because a panel's eye now drives all of its tools, it no longer remembers tools that were hidden on their own. For example: hide the Color Mixer, then hide and re-show the Color panel, and the Mixer comes back on.
  • Older presets that hid a whole panel aren't converted when applied to the whole image, only when applied to a mask. They're probably rare, and the conversion can be added there too if wanted.
  • Mask panels already leave out Calibration, Spatial, LUT, Vignette and Grain, so masks get eyes on the tools they show: Color minus Calibration, Details, and Creative.

AI Disclaimer:

Please state the involvement of AI in this PR:

  • This PR is created by an AI agent
  • This PR is mostly AI-generated but edited/merged together by a human
  • This PR was handwritten with AI assistance (spell check, logic suggestions, error resolving)
  • This PR contains only blood, sweat, and coffee (AI-free)

🤖 Generated with Claude Code

@mmadesignerunknown

mmadesignerunknown commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

I would suggest adding this to each and every tool, what do you think about this, @lalibertemarc ?

Regards,

@lalibertemarc

lalibertemarc commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor Author

I would suggest adding this to each and every tool, what do you think about this, @lalibertemarc ?

Regards,

i have no strong opinion on this. the motivation was so the white balance wasnt picked up by the visibility toggler of the Color panel. I dont mind adding it to every tool if CyberTimon wants it too. Though i feel like the Color Mixer and Color Grading tool benefit the most from this.

@lalibertemarc
lalibertemarc force-pushed the feat/color-tool-visibility branch from 6224122 to 9c61e6c Compare October 5, 2026 09:45
@mmadesignerunknown

Copy link
Copy Markdown
Contributor

Yeah agree, but you know, the thing is that if there's something you can have for every tool, which is also beneficial and not troublesome, then why only have it for two and not all...

Additionally, I have this kind of OCD and like it when a tool which could be universally available, is either universally available, or universally unavailable.

But yeah CyberTimon's opinion matters significantly... so yeah... Let's wait for his opinion on this.

Regards,

@lalibertemarc
lalibertemarc force-pushed the feat/color-tool-visibility branch from 9c61e6c to 310d8d6 Compare October 9, 2026 03:28
@lalibertemarc lalibertemarc changed the title feat(adjustments): visibility toggles for Color Grading and Color Mixer feat(adjustments): visibility toggles for every adjustment tool Oct 9, 2026
@lalibertemarc

Copy link
Copy Markdown
Contributor Author

I would suggest adding this to each and every tool, what do you think about this, @lalibertemarc ?

Regards,

done!

@mmadesignerunknown

Copy link
Copy Markdown
Contributor

Thanks :)

lalibertemarc and others added 3 commits October 9, 2026 08:29
The eye button that hides a panel's adjustments moves from
CollapsibleSection into a reusable VisibilityToggle, together with the
dimmed-content class, so adjustment tools can use the same control.
CollapsibleSection also types its props and hover timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every tool in the Color, Details and Effects panels gets its own eye
toggle, as do Lens Blur, Relight and Fog inside Spatial. Hiding a tool
bypasses its effect while keeping its settings and controls.

The frontend resolves all the eyes into a flat activeTools map (tool id
-> yes/no, missing means active) stored on the edit and on each mask,
and the engine only checks is_tool_active for each tool, so it knows
nothing about how panels and menus are arranged. Panel and Spatial eyes
switch all of their tools at once.

Edits saved before activeTools existed still render exactly as before:
the frontend converts their sectionVisibility flags when they are
opened, and the engine falls back to those flags while activeTools is
missing, so unopened edits keep their hidden panels in thumbnails and
batch exports. Batch auto adjust builds the map from those flags before
turning on the tools it writes.

Auto adjust and picking a LUT turn on the tools they change, and a
panel's reset or paste turns its tools back on. The Spatial effects
share one SpatialEffect wrapper, and the Effects slider handlers use
SliderChangeEvent instead of any.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ALL_ADJUSTMENT_TOOLS and ADJUSTMENT_TOOLS_BY_ID move from the panel
customization menu into adjustments.ts so the active tool helpers reuse
them, the visibility handlers take a tool id rather than a section name,
and the legacy engine fallback only reads the section flags older edits
actually contain.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lalibertemarc
lalibertemarc force-pushed the feat/color-tool-visibility branch from 4714c4c to eba61ed Compare October 9, 2026 14:05
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.

2 participants