Skip to content

Adds keyboard shortcuts for the core tonal and color adjustments#1308

Open
SandeepSubba wants to merge 11 commits into
CyberTimon:mainfrom
SandeepSubba:custom-shortcuts
Open

Adds keyboard shortcuts for the core tonal and color adjustments#1308
SandeepSubba wants to merge 11 commits into
CyberTimon:mainfrom
SandeepSubba:custom-shortcuts

Conversation

@SandeepSubba

@SandeepSubba SandeepSubba commented Jun 26, 2026

Copy link
Copy Markdown

Description

Adds keyboard shortcuts for the core tonal and color adjustments — exposure,
contrast, saturation, vibrance, white balance (temperature) and tint. They
appear in a new "Adjustments" group under Settings → Controls and are fully
user-remappable.

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

  • keyboardUtils.ts: new adjustments keybind section plus a config-driven
    ADJUSTMENT_NUDGES table (combo, target adjustment key, step, clamp range),
    spread into KEYBIND_DEFINITIONS so the binds render in the UI and stay
    remappable.
  • useKeyboardShortcuts.ts: one generated handler per nudge, reusing the
    existing debounced-history setAdjustments path (same as the sliders), gated
    on an image being open in the editor.
  • i18n/locales/en.json: section label + action labels.
  • Default mappings — the +/- keys set the direction and the modifier selects
    the adjustment:
    • Exposure: Alt +/- (Ctrl +/- is already Zoom)
    • Contrast: Ctrl+Shift +/- · Saturation: Ctrl+Alt +/-
    • Vibrance: Shift+Alt +/-
    • White balance / Temperature: Shift +/- · Tint: Ctrl+Shift+Alt +/-

Update (2026-07-03)

Fixed a mistargeted mapping: the exposure nudges pointed at the exposure
adjustment key, which is what the EV Shift slider (Tone Mapper box) writes —
a linear pre-tonemap gain. The slider actually labelled Exposure writes
brightness (the filmic midtone lift), so Alt +/- moved the wrong slider.
The nudges now target brightness, with a comment at the definition site
documenting the exposure/brightness naming split.

Screenshots/Videos

Testing

  • I have tested these changes locally and confirmed that they work as expected without issues

Built and ran via tauri dev. Verified that the shortcuts adjust exposure /
contrast / saturation / temperature live on a loaded image, that undo/redo
(Ctrl+Z / Ctrl+Y) captures the changes, and that all entries show up in
Settings → Controls → Adjustments and can be rebound. cargo check and the
Vite build are clean.

Test Configuration:

  • OS: Windows 11 Home
  • Hardware: Intel Core i5-12400, NVIDIA GeForce GTX 1660 SUPER

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

  • The whole feature is driven from the single ADJUSTMENT_NUDGES array, so
    adding or changing a shortcut is a one-line edit and the keybind UI and the
    dispatch logic stay in sync automatically.
  • i18n: labels were added to en.json; other locales fall back to English until
    translated.
  • All defaults are remappable in Settings → Controls, so users can change any of
    them to their preference.

AI Disclaimer:

  • This PR is entirely AI-generated
  • This PR is AI-generated but guided 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)

SandeepSubba and others added 6 commits June 26, 2026 10:39
- cache_utils: hash full AI-patch base64 content instead of string length
  in calculate_transform_hash, so two distinct patch results of identical
  dimensions can no longer collide and leave a stale patch composited.
- ai_processing: validate AI model output tensor shapes before indexing
  (SAM decoder, sky-seg, U-2-Netp, Depth-Anything, LaMa). A model whose
  output resolution differs from the hardcoded assumption now returns a
  clean error instead of panicking on out-of-bounds access.
- export_processing: bounds-check the frontend-supplied mask_index and
  guard calculate_resize_target against zero-dimension images (was Inf/NaN).
- lib: cap lut_cache at 32 entries; it is keyed by path and never cleared
  by the session/image cache resets, so it previously grew unbounded.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Move the seven self-contained widget components (KeybindRow, SettingItem,
DataActionItem, AiProviderSwitch, CloudDashboard, CanvasInputModeSwitch,
PreviewModeSwitch) into src/components/panel/settings/widgets.tsx and prune
the now-dead imports. These widgets touch no parent state, so the cut is
mechanical. SettingsPanel.tsx drops from ~2415 to ~2032 lines.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Peel cohesive clusters out of two oversized Rust files into sibling
submodules, each using `use super::*` to inherit the parent's imports and
re-exported via `pub use` so the existing command paths in lib.rs are
unchanged:

- file_management/albums.rs    (AlbumItem + album commands, ~260 lines)
- file_management/folder_tree.rs (FolderNode + lazy dir scanning, ~270 lines)
- image_processing/analysis.rs  (histogram/waveform/auto-adjust, ~710 lines)

file_management.rs 3661 -> 3135, image_processing.rs 3262 -> 2555.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Add an "Adjustments" section to Settings → Controls with increase/decrease
shortcuts for exposure, contrast, saturation, vibrance, temperature (white
balance) and tint. Direction is the +/- keys (like Capture One); modifier
families select the adjustment and match Capture One where it defines them
(Contrast = Ctrl+Shift, Saturation = Ctrl+Alt). Exposure uses Alt+/- because
Ctrl+/- is already bound to Zoom here.

Implementation is intentionally self-contained and additive to keep it easy
to rebase onto upstream releases:
- keyboardUtils.ts: new `adjustments` section + a config-driven
  ADJUSTMENT_NUDGES table (combo, target key, step, clamp range) spread into
  KEYBIND_DEFINITIONS so the binds render and stay user-remappable.
- useKeyboardShortcuts.ts: one generated handler per nudge, riding the same
  debounced-history setAdjustments path the sliders use.
- en.json: section label + action labels.

All defaults are remappable in Settings → Controls.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… workflow

Documents the fork's custom changes (Capture One–style adjustment shortcuts +
backend hardening) and a step-by-step process to rebase them onto new upstream
releases, so updating stays low-effort.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
custom-shortcuts = full fork (fixes + refactors + shortcuts), the branch to run
and rebase; code-analysis-fixes = clean fix/refactor subset for the upstream PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@SandeepSubba
SandeepSubba requested a review from CyberTimon as a code owner June 26, 2026 04:47
SandeepSubba and others added 5 commits June 26, 2026 15:00
- Export filename templates now support metadata tokens matching the Metadata
  panel's editable fields: {title} (ImageDescription), {author} (Artist),
  {copyright} (Copyright) and {comments} (UserComment). Values are read lazily
  from the image's cached EXIF and sanitized so they are safe in a filename.
- The File Naming section now shows for single-image export too (previously
  multi-select only); {sequence} stays hidden for single images. Single-image
  export resolves the template via a new generate_export_filename command so it
  supports the same tokens (dates, metadata, original filename) as batch.
- Guard against a persisted/imported template referencing an unknown token
  (e.g. a stray {dcp_title} saved into the last-used preset): unknown tokens now
  fall back to the original default {original_filename}_edited.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- Opening an image that's part of a multi-selection now preserves the whole
  selection instead of collapsing to the opened image, so batch actions keep
  targeting every selected image.
- Creator Details edits (Title/Author/Copyright/Comments) now apply to all
  selected images, with a "Edits apply to all N selected images" hint. The
  backend already wrote every path it received; it just never got the others.
- Add a "Sync to N selected" action that copies the focused image's creator
  details to every selected image at once.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
When the focused image's rating drops it below the active star filter, it
disappears from the filtered view but the cursor was left on the now-hidden
image, breaking arrow-key navigation.

Add an effect in App.tsx that, when the focused image leaves the sorted/
filtered list, advances the cursor to the nearest still-visible image
(next in sort order, else previous). Covers both the editor (selectedImage)
and the library grid (libraryActivePath); in the grid, still-visible members
of a multi-selection are preserved. A "was it visible before" guard avoids
hijacking selection on folder/album switches.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The Alt +/- exposure shortcuts nudged the `exposure` adjustment key,
which is what the EV Shift slider (inside the Tone Mapper box) writes -
a linear pre-tonemap gain. The slider actually labelled "Exposure" in
the Basic panel writes `brightness` (the filmic, midtone-weighted
lift). Point the nudges at `brightness` so the shortcut moves the
slider the user sees as Exposure.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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