Skip to content

feat(web): display similarity threshold as a percentage - #18974

Merged
wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/similarity-slider-percentage
Aug 28, 2026
Merged

wangq8 merged 1 commit into
infiniflow:mainfrom
dcc123456:fix/similarity-slider-percentage

Conversation

@dcc123456

Copy link
Copy Markdown
Collaborator

Summary

The similarity threshold is stored as a 0-1 float but was shown raw in the slider and number input. Enable the percentage mode of SliderInputFormField so the control reads 0-100 while the underlying form value stays unchanged.

The similarity threshold is stored as a 0-1 float but was shown raw in
the slider and number input. Enable the percentage mode of
SliderInputFormField so the control reads 0-100 while the underlying
form value stays unchanged.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dosubot dosubot Bot added size:XS This PR changes 0-9 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code labels Aug 28, 2026
@dcc123456
dcc123456 requested a review from wangq8 August 28, 2026 08:24
@dcc123456 dcc123456 added the ci Continue Integration label Aug 28, 2026
@dcc123456
dcc123456 marked this pull request as draft August 28, 2026 08:25
@dcc123456
dcc123456 marked this pull request as ready for review August 28, 2026 08:25
@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown
Contributor

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: 2fb7532b-3e95-4de3-a356-66eb045b0d89

📥 Commits

Reviewing files that changed from the base of the PR and between 1d4a86e and 4945bad.

📒 Files selected for processing (1)
  • web/src/components/similarity-slider/index.tsx

Included review availability: Your plan provides up to 10 included reviews per hour; 6 remain after this review.


📝 Walkthrough

Walkthrough

The similarity threshold slider now passes the percentage prop to display threshold values as percentages.

Changes

Similarity threshold display

Layer / File(s) Summary
Percentage display
web/src/components/similarity-slider/index.tsx
The similarity threshold field now receives the percentage prop.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to 4945b

This change only displays the similarity threshold as a percentage while keeping the submitted value unchanged. No actionable merge-blocking risk remains beyond normal checks and review.

Suggested reviewers: wangq8

Poem

A rabbit sees the slider glow
Percent signs hop from row to row
The threshold wears a clearer face
One small prop puts values in place
Ears up, the change is done

🚥 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%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
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.
Description check ✅ Passed The description includes the required Summary section. It explains the current behavior, the intended percentage display, and preservation of the underlying 0–1 form value.
Title check ✅ Passed The title clearly and concisely describes the main change: displaying the similarity threshold as a percentage.
  • Fix all pre-merge checks with AI

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.

@wangq8 wangq8 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This is an AI review comment.

LGTM. The change correctly enables the existing percentage prop of SliderInputFormField, which scales min/max/step by 100 and round-trips the underlying 0–1 float via Math.round(value) / 100. With max={1} and step={0.01} already set on the similarity slider, this yields a 0–100 display in 1% increments while the form value stays unchanged. No regressions (pure presentational change).

Minor (non-blocking): Math.round(value) / 100 quantizes the value to 2 decimal places. Fine for similarity thresholds (step 0.01), but any future sub-0.01 precision would be lost on the slider round-trip.

This is an AI review comment.

@wangq8
wangq8 merged commit d83eb1b into infiniflow:main Aug 28, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continue Integration size:XS This PR changes 0-9 lines, ignoring generated files. 🧰 typescript Pull requests that update Typescript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants