Skip to content

ui: add custom stepper controls for numeric settings - #58

Merged
bashrusakh merged 3 commits into
mainfrom
settings-stepper-control
Jun 29, 2026
Merged

ui: add custom stepper controls for numeric settings#58
bashrusakh merged 3 commits into
mainfrom
settings-stepper-control

Conversation

@bashrusakh

@bashrusakh bashrusakh commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Closes #57

Summary

Replace standard browser number inputs with custom stepper controls featuring +/- buttons in Settings → Transfer section.

Problem

Numeric fields (Connections per file, Concurrent downloads, Retry attempts) used white browser spinners that didn't match the app's dark theme. The "Verification mode" dropdown was styled correctly and served as the reference.

Changes

HTML (index.html):

  • Wrap connections, maxActive, retries fields in .stepper-control
  • Add - and + buttons with proper ARIA labels
  • Add data-default attributes for value restoration

CSS (style.css):

  • Add .stepper-control flex layout
  • Style input field (dark background, centered text, no native spinners)
  • Style stepper buttons with hover/active states matching theme
  • Purple accent on active state (like Verification dropdown focus)
  • Disabled state at min/max boundaries

JavaScript (app.js):

  • Add initStepperControls() function
  • Proper NaN handling with parseBound() helper
  • Clamp values on blur, not during typing
  • Button state updates on value changes

Screenshots

Before: White browser spinners
After: Styled +/- buttons matching dark theme

Testing

  • Click +/- changes value by 1
  • Direct input works
  • Min/max boundaries respected
  • Buttons disabled at boundaries
  • Values clamp on blur
  • Empty values restore default on blur
  • Settings save correctly

Checklist

  • Code follows project style
  • Tests pass (go test ./internal/server)
  • JS syntax valid (node --check)
  • Code review issues addressed

Summary by CodeRabbit

  • New Features / UI Improvements
    • Updated numeric settings fields (e.g., transfer connections, max active, and retries) to use stepper controls with “−” and “+” buttons.
    • Added refined stepper styling, including hover/active/disabled visual states and cleaner number-input presentation.
    • Improved number input behavior: enforces min/max limits, refreshes button enablement while typing, and restores/clamps values on blur when empty or invalid.

Replace standard browser number inputs with custom stepper controls
featuring +/- buttons to match the app\'s dark theme and Verification
dropdown styling.

Changes:
- HTML: wrap connections, maxActive, retries fields in stepper-control
- CSS: add styles for stepper buttons and inputs (dark theme)
- JS: add initStepperControls() with proper min/max validation

Fixes:
- Remove non-standard "appearance: textfield" CSS
- Fix NaN handling in parseInt for empty values
- Clamp values on blur, not during typing

Refs: #N/A
@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: e152d950-97f7-4e72-9246-ae42d6b0429c

📥 Commits

Reviewing files that changed from the base of the PR and between aab8fcf and 3cf4b1d.

📒 Files selected for processing (1)
  • internal/assets/static/index.html
🚧 Files skipped from review as they are similar to previous changes (1)
  • internal/assets/static/index.html

📝 Walkthrough

Walkthrough

Adds stepper controls to the Transfer settings numeric fields. The settings UI now wraps connections, maxActive, and retries in stepper-control containers with /+ buttons. CSS and JavaScript styles and wire the controls, enforce bounds, and restore valid values on blur.

Changes

Stepper Control for Transfer Settings

Layer / File(s) Summary
CSS and stepper logic
internal/assets/static/css/style.css, internal/assets/static/js/app.js
Adds .stepper-control styling and initializes stepper behavior for number inputs, including button state updates, min/max enforcement, and blur handling.
Transfer settings markup
internal/assets/static/index.html
Wraps the connections, maxActive, and retries number inputs in .stepper-control containers with data-action buttons and data-default values.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UI change: custom stepper controls for numeric settings.
Linked Issues check ✅ Passed The PR implements the requested stepper controls, styling, and validation for all three Transfer numeric fields.
Out of Scope Changes check ✅ Passed The changes stay focused on the requested Settings Transfer numeric input redesign and its supporting behavior.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch settings-stepper-control

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 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 `@internal/assets/static/index.html`:
- Around line 741-743: Update the stepper controls so each button in the related
input groups uses a field-specific aria-label instead of the generic
“Decrease”/“Increase”; adjust the buttons associated with the connections,
timeout, and the third stepped setting to include the setting name in their
labels. While updating the button markup, add aria-controls on each stepper
button to point to its corresponding input element, using the existing stepper
button structure and input ids to locate the controls.
🪄 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 Plus

Run ID: 221f0e4b-a31f-4895-980c-4c53d825bc82

📥 Commits

Reviewing files that changed from the base of the PR and between 91d36b6 and aab8fcf.

📒 Files selected for processing (3)
  • internal/assets/static/css/style.css
  • internal/assets/static/index.html
  • internal/assets/static/js/app.js

Comment thread internal/assets/static/index.html Outdated
Replace standard browser number inputs with custom stepper controls
featuring +/- buttons to match the app\'s dark theme and Verification
dropdown styling.

Changes:
- HTML: wrap connections, maxActive, retries fields in stepper-control
- CSS: add styles for stepper buttons and inputs (dark theme)
- JS: add initStepperControls() with proper min/max validation

Fixes:
- Remove non-standard "appearance: textfield" CSS
- Fix NaN handling in parseInt for empty values
- Clamp values on blur, not during typing

Refs: #N/A
@bashrusakh
bashrusakh merged commit ee62abb into main Jun 29, 2026
7 checks passed
@bashrusakh
bashrusakh deleted the settings-stepper-control branch June 29, 2026 18:01
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.

Settings Transfer: inconsistent number input styling

1 participant