Repository navigation
feat(qt): add global zoom shortcuts - #7216
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 00bdcf9910
ℹ️ 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".
✅ No Merge Conflicts DetectedThis PR currently has no conflicts with other open PRs. |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the
Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
WalkthroughAdds global font scaling to the Qt GUI: introduces FONT_SCALE_MIN / FONT_SCALE_MAX / FONT_SCALE_SHORTCUT_STEP and three View actions (Zoom In, Zoom Out, Reset) wired to a new private BitcoinGUI::adjustFontScale(int delta) that clamps, applies, refreshes, and persists font scale when allowed. Expands appearance widget slider range. Updates GUIUtil::AddButtonShortcut to accept an explicit Qt::ShortcutContext (defaulting to WindowShortcut) and registers font-size shortcuts in RPCConsole using the new helper to avoid duplicate shortcuts on theme changes. Sequence DiagramsequenceDiagram
actor User
participant BitcoinGUI
participant GUIUtil
participant OptionsModel
User->>BitcoinGUI: Trigger Zoom In / Zoom Out / Reset
BitcoinGUI->>BitcoinGUI: adjustFontScale(delta)\ncompute & clamp new scale
BitcoinGUI->>GUIUtil: set global font scale / refresh fonts
GUIUtil->>GUIUtil: update font registry\napply fonts across UI
alt OptionsModel available
BitcoinGUI->>OptionsModel: save new font scale
OptionsModel-->>BitcoinGUI: acknowledge
end
GUIUtil-->>User: UI updated with new font scale
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Pre-merge checks:
|
|
Seems to be working as expected but
|
00bdcf9 to
04cb014
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 04cb01468e
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/qt/bitcoingui.cpp`:
- Around line 529-531: The zoom-out shortcut was set to "Ctrl+_" but should be
"Ctrl+-"; update the shortcut string passed to m_zoom_out_action->setShortcuts
to QKeySequence(tr("Ctrl+-")) so it matches QKeySequence::ZoomOut, and make the
same change wherever the alternative shortcut string is used (e.g., the rpc
console's QAction/QKeySequence setup) so both m_zoom_out_action and the rpc
console shortcut use "Ctrl+-" instead of "Ctrl+_".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 741c0042-bcc9-4234-a35f-f11a73b96fbb
📥 Commits
Reviewing files that changed from the base of the PR and between 00bdcf991097a8d73320a92bc0607ebe08b1201c and 04cb01468e99d09514a17603c102bb826eb01aab.
📒 Files selected for processing (3)
CLAUDE.mdsrc/qt/bitcoingui.cppsrc/qt/bitcoingui.h
✅ Files skipped from review due to trivial changes (1)
- CLAUDE.md
🚧 Files skipped from review as they are similar to previous changes (1)
- src/qt/bitcoingui.h
036cbdb to
5743625
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5743625069
ℹ️ 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".
5743625 to
391ac6d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 391ac6d679
ℹ️ 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".
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/qt/bitcoingui.cpp`:
- Around line 779-784: After updating the font scale
(GUIUtil::g_font_registry.SetFontScale and GUIUtil::updateFonts()) and saving it
to the options model, call the window width recalculation so the tab toolbar
minimum width is recomputed; add a call to updateWidth() (the
BitcoinGUI::updateWidth() method) after the clientModel/optionsModel update to
recompute main-window width and avoid clipped labels.
- Around line 525-535: adjustFontScale currently returns early when
OptionsModel::isOptionOverridden("-font-scale") is true but leaves the UI
actions active; update adjustFontScale (or the same initialization path) to
query OptionsModel::isOptionOverridden("-font-scale") and call
m_zoom_in_action->setEnabled(false), m_zoom_out_action->setEnabled(false), and
m_zoom_reset_action->setEnabled(false) when overridden (and setEnabled(true)
when not) so the zoom QAction items reflect the override state and no longer
advertise shortcuts that perform no-ops.
In `@src/qt/forms/appearancewidget.ui`:
- Around line 185-189: AppearanceWidget::updateFontScale currently passes the
raw slider value to GUIUtil::g_font_registry.SetFontScale, which can produce an
invalid zero font size for extreme values; fix it by clamping the incoming
nScale to the valid range before calling SetFontScale (use the same bounds as
elsewhere, e.g. constexpr FONT_SCALE_MIN = -100 and FONT_SCALE_MAX = 100 and
apply std::clamp), then call GUIUtil::g_font_registry.SetFontScale(nScale) and
GUIUtil::updateFonts().
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 8de5e6e9-0f72-4a20-964e-9ad88469d59a
📥 Commits
Reviewing files that changed from the base of the PR and between 04cb01468e99d09514a17603c102bb826eb01aab and 5743625069e86aae1667e1c051e31e1f85065b96.
📒 Files selected for processing (4)
CLAUDE.mdsrc/qt/bitcoingui.cppsrc/qt/bitcoingui.hsrc/qt/forms/appearancewidget.ui
🚧 Files skipped from review as they are similar to previous changes (2)
- CLAUDE.md
- src/qt/bitcoingui.h
There was a problem hiding this comment.
Actionable comments posted: 1
♻️ Duplicate comments (1)
src/qt/bitcoingui.cpp (1)
765-767:⚠️ Potential issue | 🟡 MinorZoom actions still present as no-ops when
-font-scaleis overridden.At Line 765,
adjustFontScale()exits early, but the menu actions remain enabled and advertised. Users can trigger shortcuts that do nothing.💡 Proposed fix (sync action enabled state with override)
OptionsModel* optionsModel = _clientModel->getOptionsModel(); if (optionsModel) { + const bool font_scale_locked{optionsModel->isOptionOverridden("-font-scale")}; + m_zoom_in_action->setEnabled(!font_scale_locked); + m_zoom_out_action->setEnabled(!font_scale_locked); + m_zoom_reset_action->setEnabled(!font_scale_locked); unitDisplayControl->setOptionsModel(optionsModel); m_mask_values_action->setChecked(optionsModel->getOption(OptionsModel::OptionID::MaskValues).toBool());🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/qt/bitcoingui.cpp` around lines 765 - 767, The early return in adjustFontScale() when clientModel->getOptionsModel()->isOptionOverridden("-font-scale") leaves zoom-related QAction objects enabled and responsive but doing nothing; update adjustFontScale() to explicitly set the enabled state (e.g., zoomInAction, zoomOutAction, resetZoomAction) to false when the option is overridden (and true otherwise), and update their tooltips/status hints to reflect that zooming is disabled when overridden so shortcuts/menu items are not advertised as functional; locate and modify adjustFontScale() and the QAction members (zoomInAction, zoomOutAction, resetZoomAction) to implement this toggle.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/qt/rpcconsole.cpp`:
- Around line 1351-1359: The problem is duplicate QShortcut registrations for
ui->fontBiggerButton and ui->fontSmallerButton because
GUIUtil::AddButtonShortcut is called each time setButtonIcons() runs; fix by
registering these shortcuts only once (e.g. move the GUIUtil::AddButtonShortcut
calls out of setButtonIcons() into the dialog/class constructor or gate them
with a boolean like shortcutsInitialized), or check for existing shortcuts on
the button (via button->findChildren<QShortcut*>() or button->shortcuts())
before calling GUIUtil::AddButtonShortcut for ui->fontBiggerButton and
ui->fontSmallerButton so repeated icon/theme reloads do not create duplicate
QShortcut objects.
---
Duplicate comments:
In `@src/qt/bitcoingui.cpp`:
- Around line 765-767: The early return in adjustFontScale() when
clientModel->getOptionsModel()->isOptionOverridden("-font-scale") leaves
zoom-related QAction objects enabled and responsive but doing nothing; update
adjustFontScale() to explicitly set the enabled state (e.g., zoomInAction,
zoomOutAction, resetZoomAction) to false when the option is overridden (and true
otherwise), and update their tooltips/status hints to reflect that zooming is
disabled when overridden so shortcuts/menu items are not advertised as
functional; locate and modify adjustFontScale() and the QAction members
(zoomInAction, zoomOutAction, resetZoomAction) to implement this toggle.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 0a0e7d5c-dbf5-436e-a024-370a66f37c6e
📥 Commits
Reviewing files that changed from the base of the PR and between 5743625069e86aae1667e1c051e31e1f85065b96 and 391ac6d679665c38d9a79296c36a7913317830cd.
📒 Files selected for processing (7)
CLAUDE.mdsrc/qt/bitcoingui.cppsrc/qt/bitcoingui.hsrc/qt/forms/appearancewidget.uisrc/qt/guiutil.cppsrc/qt/guiutil.hsrc/qt/rpcconsole.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
- CLAUDE.md
- src/qt/forms/appearancewidget.ui
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/qt/bitcoingui.cpp`:
- Around line 525-535: When adjustFontScale() exits early because the
-font-scale option is overridden, disable the zoom actions so they aren't active
no-ops: in setClientModel() after retrieving optionsModel call
optionsModel->isOptionOverridden("-font-scale") (or similar) and use that
boolean to call setEnabled(false) on m_zoom_in_action, m_zoom_out_action and
m_zoom_reset_action when the option is locked; this keeps the View menu and
shortcut hints in sync with the actual behavior.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 69b282b2-962b-44df-acdb-beea25e6e8ec
📥 Commits
Reviewing files that changed from the base of the PR and between 391ac6d679665c38d9a79296c36a7913317830cd and d414f1d007fb774a36127ce4f8cccb189ea8a201.
📒 Files selected for processing (2)
src/qt/bitcoingui.cppsrc/qt/rpcconsole.cpp
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
PR widens the font scale slider from -30..30 to -100..100 and adds Ctrl+/Ctrl- global zoom shortcuts. The most impactful verified issue is that the expanded range allows font scale to reach -100, producing zero-sized (invisible) fonts. Most other findings are valid but lower severity; two findings are false positives.
🔴 1 blocking | 🟡 3 suggestion(s) | 💬 1 nitpick(s)
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/qt/bitcoingui.cpp`:
- [BLOCKING] lines 90-91: FONT_SCALE_MIN of -100 produces zero-sized fonts
The formula in `guiutil_font.h:85` is `size * (1 + (m_font_scale * 0.01))`. At scale -100 this yields `size * 0 = 0`, making all text invisible. The PR widened the UI slider range from the previous -30..30 (confirmed via git diff of `appearancewidget.ui`) to -100..100 to match these new constants. The old minimum of -30 gave `size * 0.7` which was still legible. A reasonable minimum would be around -50 (giving `size * 0.5`, i.e. half-size text).
- [SUGGESTION] lines 765-768: Menu zoom items remain enabled when -font-scale CLI override is active
When `-font-scale` is overridden via CLI, `adjustFontScale()` silently returns at line 767 without any user feedback. The View > Zoom In / Zoom Out / Reset Zoom menu items remain visually enabled and clickable, but do nothing. Users have no way to know why the controls don't work.
- [SUGGESTION] lines 90-91: Font scale range defined in two places — drift risk
The constants `FONT_SCALE_MIN{-100}` and `FONT_SCALE_MAX{100}` are defined in an anonymous namespace in `bitcoingui.cpp:90-91`. The font scale slider in `appearancewidget.ui:185-189` has matching but independently hardcoded minimum/maximum values. If either is changed independently, the slider and keyboard shortcuts would enforce different ranges.
In `src/qt/rpcconsole.cpp`:
- [SUGGESTION] lines 564-570: Overlapping shortcuts between global zoom and RPC console font-size buttons
The new window-level zoom actions use `QKeySequence::ZoomIn` (Ctrl++) and `Ctrl+=` (line 526 of bitcoingui.cpp). The RPC console registers widget-level shortcuts for the same keys (`Ctrl++`, `Ctrl+=`, `Ctrl+-`, `Ctrl+_`) at `WidgetWithChildrenShortcut` context. When the RPC console has focus, Qt may raise an ambiguous-shortcut conflict since both a `WindowShortcut` and `WidgetWithChildrenShortcut` match the same key. The two actions also do different things: one changes the global app font scale, the other changes only the console font size.
|
✅ Final review complete — no blockers (commit 98615c8) · triage: normal · Phase 2 only (queue backlog) |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76bec14969
ℹ️ 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".
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
PR #7216 adds Ctrl+/- zoom shortcuts with font scale persistence. Verified 2 agent findings: 1 confirmed with reduced severity (shortcut scope matches existing pattern), 1 dropped (factually incorrect claim about startup clamping). Found 1 additional CLI range inconsistency.
Reviewed commit: 76bec149
💬 2 nitpick(s)
2 additional findings
💬 nitpick: Zoom shortcuts use Qt::WindowShortcut scope (consistent with existing pattern)
src/qt/bitcoingui.cpp (line 1)
The zoom QActions at bitcoingui.cpp:525-535 use the default Qt::WindowShortcut context (no setShortcutContext call found anywhere in src/qt/). This means shortcuts won't fire when a separate dialog (e.g., OptionsDialog) has focus on Linux/Windows. However: (1) this is consistent with ALL other shortcuts in BitcoinGUI (e.g., Ctrl+Shift+D, Ctrl+M), (2) on macOS, native menu bar shortcuts work regardless of active window, and (3) 'global' in the commit message likely refers to zoom affecting all fonts application-wide, not the shortcut scope. Downgraded from medium since it matches existing codebase conventions.
💬 nitpick: CLI -font-scale validation still accepts [-100, 100] while shortcut/slider clamp uses [-50, 100]
src/qt/bitcoin.cpp (line 1)
Commit 76bec14 changed FONT_SCALE_MIN to -50 'to prevent zero-sized fonts', but bitcoin.cpp:750 still validates the -font-scale CLI arg against [-100, 100]. At scale -100, GetScaledFontSize() computes size * (1 + (-100 * 0.01)) = 0, producing zero-sized fonts. The slider range was also updated from [-30,30] to [-50,100] in appearancewidget.ui. Pre-existing issue but made more visible by this PR's intent to prevent zero-sized fonts. Consider updating bitcoin.cpp:750 to use -50 as the minimum for consistency.
76bec14 to
bf517df
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: bf517dfbc0
ℹ️ 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".
thepastaclaw
left a comment
There was a problem hiding this comment.
Code Review
Clean feature PR that adds global zoom shortcuts to Dash Qt by reusing existing font-scaling infrastructure and fixes a real duplicate-shortcut bug in the RPC console. The one substantive issue is that the CLI -font-scale validation still accepts -100 (producing zero-sized fonts), inconsistent with the PR's stated goal. The rest of the findings are either resolved at HEAD or false positives.
Reviewed commit: bf517df
🟡 2 suggestion(s) | 💬 1 nitpick(s)
2 additional findings
🟡 suggestion: CLI `-font-scale` validation still allows -100, producing zero-sized fonts
src/qt/bitcoin.cpp (lines 750-757)
The commit bf517df explicitly aims to "prevent zero-sized fonts" by clamping the GUI minimum to -50. The slider (appearancewidget.ui) and shortcut path (bitcoingui.cpp:773) both enforce -50..100. However, the CLI validation at bitcoin.cpp:750 still accepts -100..100, and the help text at line 504 still advertises that range.
With GetScaledFontSize(size) = size * (1 + (scale * 0.01)), a scale of -100 yields size * 0.0 = 0, giving zero-point-size fonts. A user with font-scale=-100 in dash.conf or on the command line would get invisible text.
This is pre-existing behavior, so not blocking for this PR, but since the PR explicitly targets this class of bug it would be consistent to update both the CLI bounds and the help text to match the GUI's -50..100 range.
💡 Suggested change
if (gArgs.IsArgSet("-font-scale")) {
const int nScaleMin = -50, nScaleMax = 100;
int nScale = gArgs.GetIntArg("-font-scale", GUIUtil::g_font_registry.GetFontScale());
if (nScale < nScaleMin || nScale > nScaleMax) {
QMessageBox::critical(nullptr, PACKAGE_NAME,
QObject::tr("Error: Specified font-scale invalid. Valid range %1 to %2.").arg(nScaleMin).arg(nScaleMax));
return EXIT_FAILURE;
}
GUIUtil::g_font_registry.SetFontScale(nScale);
}
🟡 suggestion: Help text for `-font-scale` advertises -100..100, should match actual bounds
src/qt/bitcoin.cpp (line 504)
If the CLI bounds are updated to -50..100 (per the previous finding), the help text at line 504 still says .arg(-100).arg(100) and would need to be updated to .arg(-50).arg(100) to stay accurate.
💡 Suggested change
argsman.AddArg("-font-scale", QObject::tr("Set a scale factor which gets applied to the base font size. Possible range %1 (smallest fonts) to %2 (largest fonts). (default: %3)").arg(-50).arg(100).arg(GUIUtil::FontRegistry::DEFAULT_FONT_SCALE).toStdString(), ArgsManager::ALLOW_ANY, OptionsCategory::GUI);
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/qt/bitcoin.cpp`:
- [SUGGESTION] lines 750-757: CLI `-font-scale` validation still allows -100, producing zero-sized fonts
The commit bf517dfbc0 explicitly aims to "prevent zero-sized fonts" by clamping the GUI minimum to -50. The slider (appearancewidget.ui) and shortcut path (bitcoingui.cpp:773) both enforce -50..100. However, the CLI validation at bitcoin.cpp:750 still accepts -100..100, and the help text at line 504 still advertises that range.
With `GetScaledFontSize(size) = size * (1 + (scale * 0.01))`, a scale of -100 yields `size * 0.0 = 0`, giving zero-point-size fonts. A user with `font-scale=-100` in `dash.conf` or on the command line would get invisible text.
This is pre-existing behavior, so not blocking for this PR, but since the PR explicitly targets this class of bug it would be consistent to update both the CLI bounds and the help text to match the GUI's -50..100 range.
- [SUGGESTION] line 504: Help text for `-font-scale` advertises -100..100, should match actual bounds
If the CLI bounds are updated to -50..100 (per the previous finding), the help text at line 504 still says `.arg(-100).arg(100)` and would need to be updated to `.arg(-50).arg(100)` to stay accurate.
5f9ea89 to
477effd
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
The complete diff at 477effd fixes persisted-scale startup validation and preserves console shortcut registration throughout the reshaped series, but the new Qt tests fail in the supported no-wallet layout. Main-window zoom-out also lacks keyboard-event coverage. This verification was static only; the supplied CI snapshot shows successful lint and formatting checks, with platform builds still pending.
🔴 1 blocking | 🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change spans Qt shortcut routing, font-scale validation and persistence, platform-specific console behavior, and regression tests, but does not change a critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 15% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/qt/test/apptests.cpp`:
- [BLOCKING] src/qt/test/apptests.cpp:71-74: Adapt the zoom tests to the no-wallet window layout
AppTests is compiled and executed without an ENABLE_WALLET guard: src/Makefile.qttest.include includes apptests.cpp unconditionally, and test_main.cpp always runs AppTests. In a no-wallet build, BitcoinGUI embeds RPCConsole as its central widget and leaves walletFrame null, so createActions() intentionally does not register global ZoomIn/ZoomOut shortcuts. The key press here therefore cannot increase GUIUtil::fontScale(), and this assertion fails despite correct application behavior. TestConsoleZoomShortcuts also fails its unconditional console->isWindow() check at line 87 because that console is embedded. Adapt both helpers to the actual layout: retain global keyboard expectations for the wallet window, exercise global zoom through the menu action in the embedded layout, and activate console->window() while verifying that console keys resize only console text. This is established by the source paths, not attributed to an observed CI failure.
- [SUGGESTION] src/qt/test/apptests.cpp:71-78: Zoom-out binding has no key-press coverage
The main-window test presses ZoomIn and Ctrl+0, but never presses QKeySequence::ZoomOut. The console's Ctrl+- test checks a different binding and handler that change only console text size. Removing the main-window zoom-out shortcut or breaking its negative-delta connection would therefore leave these tests passing. Add a main-window ZoomOut key sequence from a known in-range scale and assert that both the live and persisted application scale decrease; keep the reset check starting from a non-default scale so it continues to detect a broken reset binding.
477effd to
7a29ebb
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 1 + Phase 2
Verified the complete diff at head 7a29ebb and revalidated all five prior findings. Four prior issues are fixed; the global zoom-out coverage suggestion remains, and the new zoom persistence path throws when dynamic settings are disabled with -nosettings. This was a static review: the supplied CI snapshot reports successful lint, several platform builds, and no-wallet tests, with other build/test jobs still pending; native macOS menu routing remains unverified.
🔴 1 blocking | 🟡 1 suggestion(s)
1 carried-forward finding(s) already raised on this PR; not re-posting as new inline comments.
Review provenance
Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — The change spans Qt shortcut routing, font-scale validation and persistence, UI bounds, and regression tests without changing a critical surface. - Phase 1 reviewers:
muse-spark-1.3-contributor— general (completed, effort xhigh); agentphase1-reviewer - Phase 1 model:
muse-spark-1.3-contributor— not quota-gated; passed overgemini-3.8-flash-high(antigravity below 15% reserve: weekly 15% left, 5h 100% left),glm-5.3-flash(not used above high effort; tier asks max) - Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/qt/bitcoingui.cpp`:
- [BLOCKING] src/qt/bitcoingui.cpp:804-805: Avoid persisting zoom changes when -nosettings is active
With -nosettings and no command-line -font-scale override, setClientModel() enables the new zoom actions because it checks only whether font-scale is overridden. A main-window zoom change then calls setOption(FontScale), which reaches UpdateRwSetting(), NodeImpl::updateRwSetting(), and ArgsManager::WriteSettingsFile(). WriteSettingsFile() explicitly throws std::logic_error when GetSettingsPath() returns false, so pressing an ordinary zoom shortcut throws during Qt action handling instead of safely completing the change. Startup supports disabling dynamic settings, and ErrorSettingsWrite() even recommends -nosettings for an unwritable settings file. Disable the global zoom actions when dynamic settings are disabled, or implement session-only zoom that skips persistence, and add coverage for this configuration.
In `src/qt/test/apptests.cpp`:
- [SUGGESTION] src/qt/test/apptests.cpp:77-88: Zoom-out binding has no key-press coverage
(existing thread: https://github.com/dashpay/dash/pull/7216#discussion_r4176908396)
TestZoomShortcuts exercises the main-window Zoom In and Reset Zoom bindings, but never invokes global Zoom Out. Its shortcuts().isEmpty() check only verifies that a shortcut list exists: substituting an incorrect nonempty binding, disconnecting the zoom-out handler, or changing its delta to positive would escape these assertions. The console's Ctrl+- test exercises RPCConsole::fontSmaller(), not the global font-scale action. After zooming in, send QKeySequence::ZoomOut to the main window and assert that the live scale decreases and the persisted value matches. In the embedded-console layout, trigger the Zoom Out menu action instead, since its keyboard bindings are intentionally absent.
|
This pull request has conflicts, please rebase. |
7a29ebb to
cbf65bb
Compare
…er PR event c854022 ci: check potential conflicts on a schedule instead of per PR event (pasta) Pull request description: ## Issue being fixed or feature implemented `predict_conflicts` shows as cancelled on many open PRs (#7623, #7763, #7568, #7885, #7886, #7823, #7216, …), so PRs whose build and test jobs all pass still look red. The job ran on every `pull_request_target` and `pull_request_review` event, in one concurrency group, `predict-conflicts`, shared by every PR. `cancel-in-progress: false` only protects the *running* job. A concurrency group holds at most one *pending* run, and when another run queues, GitHub cancels the older pending one. Each cancelled run's annotation reads `Canceling since a higher priority waiting request for predict-conflicts exists`. Out of the last 100 runs, 22 were cancelled this way, mostly when a review bot posted several reviews within seconds. These cancellations never clear. Each run is its own check suite on the PR's head commit, so every cancelled run stays in the PR's checks next to later successes. #7623, for example, shows 6 cancelled and 2 successful `predict_conflicts` entries. The group existed because each run read, changed and rewrote the conflict comments on *other* PRs. Overlapping runs could lose each other's updates, so they had to take turns. ## What was done? The job now runs on a schedule (`:07` and `:37` every hour) and on `workflow_dispatch`, with no PR triggers. Scheduled runs aren't attached to any PR, so the job no longer appears in PR checks at all. Each run works out every comment from scratch, so runs no longer depend on each other's writes: - It lists open PRs and, for every pair of ready PRs that share a base branch and touch the same files, runs the existing `pre_mergeable` check once. A merge conflict between two heads is symmetric, so one check covers both merge orders. - It rewrites each PR's comment to list the PRs it conflicts with. The old comment had separate "if this PR merges first" and "if these PRs merge first" sections that listed the same PRs. - A pair it can't check keeps what the comments already say about it. That covers a failed request (including a PR whose file list can't be fetched), a PR that already needs a rebase, and a PR GitHub hasn't yet checked against its base. This way a comment doesn't disappear and come back, which would notify subscribers again. - It deletes the comment on any PR that is no longer open and ready: PRs that a comment still lists, plus every PR closed or made a draft in the last day. The one-day window means a failed delete is retried, and it also catches two conflicting PRs that close together. Comments in the old format are still read, so the first run cleans up those too. - An unchanged comment isn't edited. A comment that can't be read is never written, and the run then fails so the problem shows up in the Actions tab. Other workflow changes: - The job only runs in `dashpay/dash`, because forks run scheduled workflows too. - It has a 20-minute timeout. - The step no longer uses `continue-on-error`, since a failure no longer affects any PR. The script drops the per-PR `--pr-number` and `--cleanup-closed` modes. Overall the change removes about 400 lines. Tradeoff: a comment can now lag a push by up to about 30 minutes. A dry run against dashpay/dash today (31 ready PRs) made 90 API requests and 60 `pre_mergeable` page loads in about 80 s. A real run also lists comments on about 10 recently closed or drafted PRs, so it comes to roughly 200 API requests an hour against the repo's `GITHUB_TOKEN` limit of 1000. ## How Has This Been Tested? - `python3 .github/workflows/test_handle_potential_conflicts.py`: 13 tests pass, on Python 3.14 and 3.10. They cover: - which pairs get checked: base branch, shared files, one check per pair - pairs that can't be checked, for each reason - keeping old entries only for unchecked pairs - clearing comments on drafts and closed PRs, including ones nothing lists any more - `--dry-run` never writing - never writing a comment that couldn't be read - editing only what changed, and reading old-format comments Mutation checks: undoing any of those behaviors (19 variants tried) makes a test fail. - `--dry-run` against live dashpay/dash. The comments it would write match the conflicts the current comments report; for example #7481 and #7623 list each other. It would also clear comments on PRs merged, closed or made drafts recently, including leftovers on #7536, #7728, #7856 and #7935. - flake8 with the repo's checks (flake8 5.0.4) and `test/lint/lint-github-actions.py` (zizmor 1.30.1) pass. - The workflow can't run before merge: scheduled and manually started runs use the default branch's copy of the workflow. After merge, a maintainer can start the first run from the Actions tab instead of waiting for the schedule. ## Breaking Changes None. `predict_conflicts` was never a required check, and it no longer appears on PRs. Cancelled entries already on a PR stay until that PR's next push. ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have made corresponding changes to the documentation - [ ] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Top commit has no ACKs. Tree-SHA512: c1e43f7b8f948b23a0b3309bc35d094719edf6ba5d5793dea4dd6a868d82495ae57cde3dc6706b0eff28b507aabb0691a0e0539c28d0c5674ebf5a7c9470bceb
setButtonIcons() re-runs on every theme change (and once more from the constructor via reloadThemedWidgets()), and each run created another QShortcut for the secondary Ctrl+= / Ctrl+_ keys through GUIUtil::AddButtonShortcut(). Duplicate shortcuts for the same key in the same window are ambiguous, so Qt stops delivering them. Register the console font-size shortcuts once in the constructor instead; the keys and their window context are unchanged. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Add Zoom In, Zoom Out and Reset Zoom actions to the Window menu, bound to QKeySequence::ZoomIn / ZoomOut plus Ctrl+= / Ctrl+_, and Ctrl+0. They step the global font scale by 3 within GUIUtil::FONT_SCALE_MIN/MAX (-50..100; much lower shrinks text towards zero size), or reset it to the default, apply it live through GUIUtil::updateFonts(), recompute the toolbar width and persist it like the Appearance tab's font scale. With -nosettings there is no settings file to write to (writing would throw), so the zoom then lasts for the session only. The Appearance slider takes its range from the same bounds, widening it from -30..30 so it can show every scale the shortcuts can reach. The actions stay disabled until a client model is set (and again once it is cleared), and while -font-scale is given on the command line, matching the Appearance slider. The RPC console keeps its own font-size shortcuts: - Without a wallet the console is the main window's central widget and already binds the zoom-in/out keys, so the global zoom-in/out actions get no key bindings there; the menu entries still zoom the whole UI. - On macOS the main window's menu bar stays active while the separate console window has focus and would grab Cmd++, so while the console window is active the zoom-in/out actions resize the console text and Reset Zoom does nothing, as on other platforms. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
-font-scale accepted -100..100, but -100 scales every font by 1 + (-100 * 0.01) = 0, making all text invisible, and the Appearance slider and zoom shortcuts stop at -50. Validate the option and describe it in its help text using GUIUtil::FONT_SCALE_MIN/MAX, so values below -50 on the command line or in the config file are now rejected at startup. The validation moves into GUIUtil::setFontScaleFromArg() so tests can drive the same check GuiMain() runs. That check also sees settings.json, and a saved value must not keep the GUI from starting. OptionsModel::Init() therefore clamps the persisted font scale and, when it came from settings.json, writes the clamped value back before GuiMain() validates. Command-line and config-file values are not written back, so a config value is never shadowed by settings.json and an out-of-range one is still rejected. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Zoom in, zoom out and press Reset Zoom on the real main window and check that the live font scale moves and that OptionsModel persists the new value. With dynamic settings disabled (-nosettings) zooming must still work without writing the setting. Then press the zoom keys in the RPC console and check that they resize only the console text and leave the application font scale alone. That includes the secondary Ctrl+= / Ctrl+_ keys, which were dead while the console registered them more than once. Cover both layouts. With a wallet the RPC console is a separate window and the Zoom In/Out actions own the zoom keys. Without one (built with --disable-wallet or run with -disablewallet) the console is embedded in the main window and keeps those keys for its own font size, so the actions must have no shortcuts and are triggered from the menu instead; Reset Zoom stays on Ctrl+0 in both. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
cbf65bb to
98615c8
Compare
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (queue backlog)
The current head correctly implements global Qt zoom shortcuts, preserves RPC-console font shortcuts, normalizes persisted font-scale values, and covers keyboard routing across wallet and embedded-console layouts. The relevant code-quality and main checks pass; the remaining failed check only enforces PR milestone metadata and is not caused by the code changes.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
normalbygpt-6.1-sol(effort low) — This is a cross-cutting Qt UI and settings change involving keyboard routing, persistence, startup validation, platform-specific behavior, and substantial tests, but it does not modify a critical surface such as consensus, funds, cryptography, networking, or storage migrations. - Phase 1 reviewers: not run (skipped for throughput: 13 PRs queued, above the 10 limit)
- Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort high); agentphase2-reviewer,gpt-6.1-sol— dash-core-commit-history (completed, effort high); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
Issue being fixed or feature implemented
Settings > Options > Appearance. There are no zoom shortcuts, so the usualCtrl++,Ctrl+-andCtrl+0do nothing in the main window.-font-scaleaccepts values down to -100, where every font is scaled to zero size and all text disappears.Ctrl+=andCtrl+_are dead:setButtonIcons()registers them twice during construction (and again on every theme change), and Qt does not fire ambiguous shortcuts.What was done?
Screen.Recording.2026-03-12.at.10.41.57.mov
(The recording predates moving the entries from a separate View menu into the Window menu.)
BitcoinGUI, listed in the Window menu and bound toQKeySequence::ZoomIn/QKeySequence::ZoomOutplusCtrl+=/Ctrl+_, andCtrl+0for reset.BitcoinGUI::setFontScale()clamps the new scale to the supported range, applies it live withGUIUtil::updateFonts(), recomputes the toolbar width and persists it throughOptionsModel::FontScale. With-nosettingsthere is no settings file to write (writing would throwstd::logic_errorfromArgsManager::WriteSettingsFile()), so the zoom applies for the session only.-font-scalehelp and validation, Appearance slider, shortcuts), defined once asGUIUtil::FONT_SCALE_MIN/MAX. The slider used to stop at -30..30.settings.jsonis never fatal.GuiMain()validates-font-scalethroughgArgs, which also seessettings.json, soOptionsModel::Init()clamps a saved value and writes the clamped value back before that check runs. Nothing is written back when the effective value comes from the command line or config file, so a config value is never shadowed bysettings.json.settings.json. It is kept deliberately: develop accepts such a file down to -100, and without the clamp it would abort startup with a-font-scaleerror for an option the user never passed.-font-scaleis given on the command line (like the Appearance slider) and while there is no client model.Ctrl++/Ctrl+=/Ctrl+-/Ctrl+_font-size shortcuts stay, and are now registered once in the constructor instead of insetButtonIcons().-disablewalletor no-wallet builds), the zoom in/out actions get no key bindings so they don't make the console's shortcuts ambiguous; the menu entries still zoom the whole UI.doc/release-notes-7216.md.Commits:
fix(qt): register RPC console font-size shortcuts only oncefeat(qt): add global zoom shortcuts(actions in the Window menu, -50..100 bounds inGUIUtil, wider Appearance slider, enabled-state handling, RPC console key routing)fix(qt): limit -font-scale and the saved font scale to -50..100(startup validation moved intoGUIUtil::setFontScaleFromArg()so tests can run the same check; clamp and write-back of out-of-rangesettings.jsonvalues)test(qt): cover the zoom shortcuts in AppTestsdoc: add release notes for zoom shortcuts and font scale rangeHow Has This Been Tested?
util::tocommon::on develop, so the new code and tests usecommon::Settings/common::SettingsValueand<common/args.h>.dash-qtandtest_dash-qton macOS arm64 (depends prefix,--enable-debug --enable-werror).src/qt/test/test_dash-qtwith the defaultminimalplatform: all tests pass, includingAppTestsandOptionTests::fontScaleSources.QT_QPA_PLATFORM=cocoa src/qt/test/test_dash-qt:AppTestsand allOptionTestspass.SharedMnWalkthroughTests::walkthroughtimes out under cocoa on this headless machine with or without this PR, and passes underminimal.AppTestspresses the real zoom-in, zoom-out and reset key sequences on the main window and checks the live and the persisted font scale, then zooms under a forced-nosettingsand checks nothing is written. In the RPC console it pressesCtrl++,Ctrl+-,Ctrl+=andCtrl+_on the command line and checks that only the console font size changes. It handles both layouts: in a no-wallet build (CI'slinux64_nowallet) the console is embedded, the zoom in/out actions must have no shortcuts and are triggered from the menu.fontScaleSourcesdrivesOptionsModel::Init()followed by theGuiMain()validation forsettings.json, command-line and config-file values (settings.json -80 starts, clamps to -50 and is rewritten; command-line/config -80 rejected; config 20 accepted and not copied intosettings.json; command line over settings.json leaves the file alone).rpcconsole.cppchange reverted,AppTestsfails on theCtrl+=press (console font size stays at 12, expected 13).setFontScaleFromArg()each madefontScaleSourcesfail; removing the zoom-in or reset key bindings, or the console'sCtrl++binding, madeAppTestsfail; without the-nosettingsguardtest_dash-qtaborted with thatstd::logic_error.dash-qt -regtestwithsettings.jsonholding"font-scale": "-80"starts and the file is rewritten to"-50".NSMenukey equivalents.-disablewalletat runtime in a wallet build. It produces the same embedded layout as the no-wallet build, which is covered.Breaking Changes
-font-scalevalues below -50 on the command line or in the config file (previously accepted down to -100) are now rejected at startup. Covered in the release notes.Checklist:
🤖 Generated with Claude Code