Skip to content

Add _ keyboard shortcut to raise whites, add dialog to confirm quit when a batch is defined#86

Merged
AlanRockefeller merged 2 commits intomainfrom
pr/update-auto-levels
Apr 25, 2026
Merged

Add _ keyboard shortcut to raise whites, add dialog to confirm quit when a batch is defined#86
AlanRockefeller merged 2 commits intomainfrom
pr/update-auto-levels

Conversation

@AlanRockefeller
Copy link
Copy Markdown
Owner

@AlanRockefeller AlanRockefeller commented Apr 24, 2026

Summary by CodeRabbit

Release Notes

  • New Features

    • Added underscore (_) keybinding to raise auto-adjust whites by 14-point steps in live editing
    • Increased highlight adjustment sensitivity from 7 to 14-point steps per keystroke
    • New confirmation dialog when quitting with selected image batches
  • Documentation

    • Updated keyboard shortcut references for auto-adjust quick controls

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 24, 2026

Warning

Rate limit exceeded

@AlanRockefeller has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 48 minutes and 14 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 48 minutes and 14 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 4453cb7a-74fa-4ef3-a834-6c8b5eee0b2b

📥 Commits

Reviewing files that changed from the base of the PR and between 20a6684 and b9fac97.

📒 Files selected for processing (4)
  • README.md
  • faststack/app.py
  • faststack/qml/Main.qml
  • faststack/qml/QuitBatchesDialog.qml

Walkthrough

The 1.6.3 release updates auto-adjust keybindings and quit-with-batches safeguards. The highlight step scaling doubles (0.07 → 0.14), a new underscore key raises whites by 14 points, and window close now checks for defined batches, prompting confirmation before exit.

Changes

Cohort / File(s) Summary
Documentation Updates
ChangeLog.md, README.md
Updated keyboard shortcut documentation for highlight/white adjustments: - key step increases to 14 points, and new _ key raises whites by 14 points in live session.
Auto-adjust and Batch Management
faststack/app.py
Doubled _AUTO_ADJUST_HIGHLIGHT_STEP constant (0.07 → 0.14); updated auto-levels status formatting to derive magnitudes from step constants and distinguish "whites +…" from "highlights -…"; added get_defined_batch_count() slot returning total batch coverage; added raise_auto_adjust_whites() slot to increment white adjustments.
QML UI Components
faststack/qml/Main.qml, faststack/qml/QuitBatchesDialog.qml
Added quit-with-batches guard in onClosing that checks defined batch count and prompts user confirmation via new QuitBatchesDialog component; updated keybinding help text for underscore key; new dialog shows batch count with singular/plural wording and prevents accidental unsaved-batch closure.
Keystroke Mapping
faststack/ui/keystrokes.py
Added underscore key press handling (both event.text() and Qt.Key_Underscore) routed to raise_auto_adjust_whites action.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant KeystrokeHandler as Keystroke Handler<br/>(keystrokes.py)
    participant Controller as AppController<br/>(app.py)
    participant Preview as Live Preview

    User->>KeystrokeHandler: Press `_` key
    KeystrokeHandler->>Controller: raise_auto_adjust_whites()
    Controller->>Controller: Ensure active auto-adjust state
    Controller->>Controller: Decrement extra_highlight_steps by 1
    Controller->>Preview: Refresh live preview
    Preview->>User: Display updated whites adjustment
Loading
sequenceDiagram
    participant User
    participant Window as Main Window<br/>(Main.qml)
    participant Controller as AppController<br/>(app.py)
    participant Dialog as QuitBatchesDialog<br/>(QuitBatchesDialog.qml)
    participant Qt as Qt Runtime

    User->>Window: Initiate close (Alt+F4 or menu)
    alt allowCloseWithBatches is false
        Window->>Controller: get_defined_batch_count()
        Controller-->>Window: Returns batch count
        alt Batch count > 0
            Window->>Dialog: Set batchCount property
            Window->>Dialog: Open dialog
            Dialog->>User: Prompt confirmation
            alt User confirms (Quit Anyway)
                User->>Dialog: Click "Quit Anyway"
                Dialog->>Window: Emit quitConfirmed()
                Window->>Window: Set allowCloseWithBatches = true
                Window->>Qt: Qt.quit()
            else User cancels
                User->>Dialog: Click "Cancel"
                Dialog->>User: Close dialog
                Window->>Window: Close cancelled
            end
        end
    else allowCloseWithBatches is true
        Window->>Qt: Allow window close
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • PR #15: Introduces batch selection and management features; directly related to the new get_defined_batch_count() logic and quit-with-batches guard added in this change.
🚥 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 accurately summarizes the two main changes in the pull request: adding the underscore keyboard shortcut for raising whites and implementing a quit confirmation dialog for defined batches.
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%.
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
  • Commit unit tests in branch pr/update-auto-levels

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

@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)
README.md (1)

20-20: ⚠️ Potential issue | 🟡 Minor

Stale step size and missing _ mention in the Features blurb.

The Quick Auto Adjust bullet still describes - as using 7-point steps and omits the new _ shortcut, which contradicts the updated Keyboard Shortcuts section (lines 145‑146) and the 1.6.3 changelog entry where -/_ both move highlights/whites in 14-point steps.

📝 Proposed fix
-- **Quick Auto Adjust:** Press `l` for quick auto-levels, `L` for auto white balance + auto-levels together, `A` for auto white balance, `-` to keep darkening the highlight/white side in 7-point steps, and `=` to deepen the shadow side in 7-point steps. These update the live in-memory edit session immediately and save once when you navigate away, start a drag, or explicitly save.
+- **Quick Auto Adjust:** Press `l` for quick auto-levels, `L` for auto white balance + auto-levels together, `A` for auto white balance, `-` to keep darkening the highlight/white side in 14-point steps, `_` to raise whites in 14-point steps, and `=` to deepen the shadow side in 7-point steps. These update the live in-memory edit session immediately and save once when you navigate away, start a drag, or explicitly save.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@README.md` at line 20, Update the "Quick Auto Adjust" feature blurb so it
matches the Keyboard Shortcuts and changelog: change the description for the '-'
key from "7-point steps" to "14-point steps" and mention the new '_' shortcut
(e.g., "`-`/`_` to keep darkening the highlight/white side in 14-point steps"),
leaving the rest of the shortcuts (`l`, `L`, `A`, `=`) as-is so the bulleted
sentence aligns with the Keyboard Shortcuts section and 1.6.3 changelog.
🧹 Nitpick comments (2)
faststack/qml/QuitBatchesDialog.qml (2)

10-11: Fixed pixel width/height may clip under larger system fonts or translations.

width: 450; height: 250 is fixed regardless of content. If the batch-count message gets longer (localization, very large counts) or the system DPI/font scale is higher, the action row can get clipped. Consider using implicitWidth/implicitHeight driven by the content column, or at least Math.min(450, parent.width * 0.9) / implicitHeight: contentItem.implicitHeight.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@faststack/qml/QuitBatchesDialog.qml` around lines 10 - 11,
QuitBatchesDialog.qml uses fixed width: 450 and height: 250 which can clip when
text is longer or fonts/DPI increase; change the sizing to follow content by
replacing fixed width/height with responsive sizing — e.g., set implicitWidth or
width to something derived from the content column (contentItem.implicitWidth or
Math.min(450, parent.width * 0.9)) and set implicitHeight to
contentItem.implicitHeight (or use Math.min as needed) so the dialog
(QuitBatchesDialog) and its action row/Column content expand to fit
localized/large text.

19-24: Theme-agnostic hardcoded colors.

backgroundColor/textColor are themed via bindings from Main.qml, but the dialog frame border (#404040), Cancel button (#444444/#666666/#555555), and the "Quit Anyway" button reds are hardcoded. In light theme this will look inconsistent with the rest of the app (compare with recycleBinCleanupDialog, which keys colors off root.isDarkTheme). Consider exposing a darkTheme boolean property (or dedicated border/button color properties) and wiring it from Main.qml to keep the dialog theme-consistent.

Also applies to: 54-57, 73-76

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@faststack/qml/QuitBatchesDialog.qml` around lines 19 - 24, The dialog uses
hardcoded colors for the frame border (border.color "#404040" in the background
Rectangle) and for the Cancel and "Quit Anyway" buttons (lines noted around
54-57 and 73-76), so add theme-aware properties (e.g., property bool darkTheme
or dedicated color properties like property color frameBorderColor,
cancelBgColor, cancelHoverColor, cancelPressedColor, quitBgColor) to
QuitBatchesDialog.qml and replace the hardcoded hex values with bindings to
those properties; then wire those properties from Main.qml (or whichever parent
exposes root.isDarkTheme) so the dialog picks dark/light colors from the app
theme rather than using fixed hex codes.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@faststack/app.py`:
- Around line 5147-5160: The current get_defined_batch_count() uses
self.image_files emptiness and clamps ranges incorrectly, causing out-of-range
batches like [20,30] to become a fake hit; change the early guard to check
self.batches (e.g., if not self.batches: return 0) instead of if not
self.image_files, then compute max_index = len(self.image_files) - 1 and for
each (start,end) in self.batches intersect properly using clamped_start =
max(start, 0) and clamped_end = min(end, max_index), only adding when
clamped_start <= clamped_end so disjoint/stale ranges do not produce spurious
counts.

---

Outside diff comments:
In `@README.md`:
- Line 20: Update the "Quick Auto Adjust" feature blurb so it matches the
Keyboard Shortcuts and changelog: change the description for the '-' key from
"7-point steps" to "14-point steps" and mention the new '_' shortcut (e.g.,
"`-`/`_` to keep darkening the highlight/white side in 14-point steps"), leaving
the rest of the shortcuts (`l`, `L`, `A`, `=`) as-is so the bulleted sentence
aligns with the Keyboard Shortcuts section and 1.6.3 changelog.

---

Nitpick comments:
In `@faststack/qml/QuitBatchesDialog.qml`:
- Around line 10-11: QuitBatchesDialog.qml uses fixed width: 450 and height: 250
which can clip when text is longer or fonts/DPI increase; change the sizing to
follow content by replacing fixed width/height with responsive sizing — e.g.,
set implicitWidth or width to something derived from the content column
(contentItem.implicitWidth or Math.min(450, parent.width * 0.9)) and set
implicitHeight to contentItem.implicitHeight (or use Math.min as needed) so the
dialog (QuitBatchesDialog) and its action row/Column content expand to fit
localized/large text.
- Around line 19-24: The dialog uses hardcoded colors for the frame border
(border.color "#404040" in the background Rectangle) and for the Cancel and
"Quit Anyway" buttons (lines noted around 54-57 and 73-76), so add theme-aware
properties (e.g., property bool darkTheme or dedicated color properties like
property color frameBorderColor, cancelBgColor, cancelHoverColor,
cancelPressedColor, quitBgColor) to QuitBatchesDialog.qml and replace the
hardcoded hex values with bindings to those properties; then wire those
properties from Main.qml (or whichever parent exposes root.isDarkTheme) so the
dialog picks dark/light colors from the app theme rather than using fixed hex
codes.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: c24105a4-3649-4c44-828f-3e2f43428300

📥 Commits

Reviewing files that changed from the base of the PR and between 002a4ba and 20a6684.

📒 Files selected for processing (6)
  • ChangeLog.md
  • README.md
  • faststack/app.py
  • faststack/qml/Main.qml
  • faststack/qml/QuitBatchesDialog.qml
  • faststack/ui/keystrokes.py

Comment thread faststack/app.py
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 20a66849ae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread faststack/app.py Outdated
Comment on lines +5156 to +5158
clamped_start = max(0, min(start, max_index))
clamped_end = max(0, min(end, max_index))
if clamped_start <= clamped_end:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Compute true in-range batch span before counting

The new get_defined_batch_count() logic clamps both ends independently, which converts fully out-of-range batches into a fake 1-image range (for example [120,130] with max_index=99 becomes [99,99]). When batch indices become stale after image-list shrink/reindex events, this overcounts and can trigger a false quit-warning dialog even though no valid batched images remain. Count only the actual intersection with [0, max_index] (i.e., start=max(start,0), end=min(end,max_index)) so non-overlapping ranges contribute zero.

Useful? React with 👍 / 👎.

@AlanRockefeller AlanRockefeller merged commit aa63f27 into main Apr 25, 2026
3 checks passed
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