Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ProgressGranularity #1151

Merged
merged 11 commits into from
Feb 17, 2025
Merged

feat: add ProgressGranularity #1151

merged 11 commits into from
Feb 17, 2025

Conversation

juliusmarminge
Copy link
Member

@juliusmarminge juliusmarminge commented Feb 17, 2025

Summary by CodeRabbit

  • New Features

    • Introduced configurable upload progress granularity, offering multiple precision levels for tracking uploads.
    • Enabled dynamic progress styling and enhanced visual feedback for a smoother, cleaner display of upload progress percentages.
    • Added a new property uploadProgressGranularity to the upload button, dropzone, and related components for improved tracking options.
  • Refactor

    • Streamlined progress calculations and rounding logic to provide a more accurate and consistent upload progress experience.
  • Bug Fixes

    • Improved the display of upload progress percentages by rounding values for clarity.

Copy link

changeset-bot bot commented Feb 17, 2025

🦋 Changeset detected

Latest commit: ff2120b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
@uploadthing/svelte Minor
@uploadthing/react Minor
@uploadthing/solid Minor
@uploadthing/vue Minor
uploadthing Patch
@uploadthing/shared Patch
@uploadthing/expo Patch
@uploadthing/nuxt Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

vercel bot commented Feb 17, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs-uploadthing ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 17, 2025 8:23pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
legacy-docs-uploadthing ⬜️ Ignored (Inspect) Visit Preview Feb 17, 2025 8:23pm

Copy link
Contributor

coderabbitai bot commented Feb 17, 2025

Walkthrough

This pull request refines the upload progress handling across multiple components. Updates include modifications to the styling and progress display in the UploadButton and UploadDropzone components via a dynamic CSS variable and rounding logic. The changes add a new property, uploadProgressGranularity, and introduce a corresponding type and helper function to control the precision of progress reporting. Additionally, the deprecated progressWidths constant is removed, and progress calculations in the internal upload flow have been modified to use floating-point precision.

Changes

File(s) Change Summary
packages/react/src/components/button.tsx,
packages/react/src/components/dropzone.tsx
Enhanced upload progress display by adding CSSProperties import, dynamic CSS variable (--progress-width), and uploadProgressGranularity property; updated rounding logic for progress display; removed obsolete progressWidths import.
packages/react/src/components/shared.tsx Removed the exported progressWidths constant.
packages/react/src/types.ts Added new type ProgressGranularity and extended UseUploadthingProps with an optional uploadProgressGranularity property.
packages/react/src/use-uploadthing.ts Introduced a progressGranularity variable (defaulting to "coarse") and updated the average progress computation using the new roundProgress function.
packages/shared/src/component-utils.ts Added a new ProgressGranularity type with three possible values and a roundProgress function to control progress rounding based on the selected granularity.
packages/uploadthing/src/_internal/upload-browser.ts Modified progress event calculations by removing the use of Math.round to provide floating-point precision for progress values.
playground/components/uploader.tsx Added the uploadProgressGranularity property with the value "fine" to the UTButton component.
packages/solid/src/components/button.tsx,
packages/solid/src/components/dropzone.tsx
Removed progressWidths import; updated progress display logic to round values; modified styling to use CSS variables for progress width.
packages/solid/src/components/shared.tsx Removed the exported progressWidths constant.
packages/solid/src/create-uploadthing.ts,
packages/solid/src/types.ts
Introduced progressGranularity variable and updated progress calculations to ensure values do not exceed 100; added uploadProgressGranularity property to CreateUploadthingProps.
packages/svelte/src/lib/component/UploadButton.svelte,
packages/svelte/src/lib/component/UploadDropzone.svelte
Updated to use uploadProgressGranularity for progress reporting; simplified styling using CSS variables; removed progressWidths import.
packages/vue/src/components/button.tsx,
packages/vue/src/components/dropzone.tsx
Updated to use uploadProgressGranularity for progress reporting; removed progressWidths import; modified styling to use CSS variables for progress width.
packages/vue/src/components/shared.tsx Removed the exported progressWidths constant.
packages/vue/src/types.ts,
packages/vue/src/useUploadThing.ts
Introduced ProgressGranularity type and uploadProgressGranularity property in UseUploadthingProps; updated progress calculations to utilize granularity.

Possibly related PRs

  • fix: dropzone behavior #980: The changes in the main PR are related to those in the retrieved PR as both involve modifications to the upload progress handling and the introduction of the uploadProgressGranularity property in components that manage file uploads. Specifically, both PRs update the UploadButton and UploadDropzone components to enhance their functionality regarding upload progress display and control.

Suggested labels

examples

Suggested reviewers

  • markflorkowski
  • t3dotgg

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

Scope: all 3 workspace projects
/tmp/eslint/packages/uploadthing:
 ERR_PNPM_WORKSPACE_PKG_NOT_FOUND  In packages/uploadthing: "@uploadthing/mime-types@workspace:*" is in the dependencies but no package named "@uploadthing/mime-types" is present in the workspace

This error happened while installing a direct dependency of /tmp/eslint/packages/uploadthing

Packages found in the workspace:


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b3bb7ac and ff2120b.

📒 Files selected for processing (4)
  • .changeset/fair-tomatoes-jog.md (1 hunks)
  • docs/src/app/(docs)/api-reference/react/page.mdx (3 hunks)
  • packages/svelte/src/lib/component/UploadDropzone.svelte (6 hunks)
  • packages/svelte/src/lib/create-uploadthing.ts (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • packages/svelte/src/lib/component/UploadDropzone.svelte
  • .changeset/fair-tomatoes-jog.md
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: e2e-node (backend-adapters)
  • GitHub Check: build
🔇 Additional comments (6)
packages/svelte/src/lib/create-uploadthing.ts (3)

7-7: LGTM!

The import of roundProgress is correctly added to support the new progress granularity feature.


44-44: LGTM!

The initialization of progressGranularity with a default value of "coarse" aligns with the documented behavior.


79-82: LGTM!

The progress calculation has been improved to:

  1. Ensure progress doesn't exceed 100%
  2. Apply the specified granularity using the roundProgress function
docs/src/app/(docs)/api-reference/react/page.mdx (3)

269-271: LGTM!

The documentation for the uploadProgressGranularity property is clear, complete, and well-structured, including all necessary information: type, version, default value, and description of each possible value.


428-430: LGTM!

The documentation for the uploadProgressGranularity property is consistent with the UploadButton documentation, maintaining uniformity across components.


561-563: LGTM!

The documentation for the uploadProgressGranularity property is consistent with the component documentation, maintaining uniformity across the API.

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

github-actions bot commented Feb 17, 2025

📦 Bundle size comparison

Bundle Size (gzip) Visualization
Main 30.67KB See Treemap 📊
PR (7a8fba6) 30.66KB See Treemap 📊
Diff ↓12.00B

Copy link

pkg-pr-new bot commented Feb 17, 2025

Open in Stackblitz

More templates

@uploadthing/nuxt

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/nuxt@1151

@uploadthing/react

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/react@1151

@uploadthing/solid

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/solid@1151

@uploadthing/shared

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/shared@1151

@uploadthing/svelte

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/svelte@1151

uploadthing

npm i https://pkg.pr.new/pingdotgg/uploadthing@1151

@uploadthing/vue

npm i https://pkg.pr.new/pingdotgg/uploadthing/@uploadthing/vue@1151

commit: ff2120b

Copy link
Contributor

@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: 0

🧹 Nitpick comments (1)
packages/shared/src/component-utils.ts (1)

18-26: LGTM! Consider adding input validation.

The implementation is clean and effective. Consider adding input validation to ensure the progress value is within the valid range [0-100].

 export const roundProgress = (
   progress: number,
   granularity: ProgressGranularity,
 ) => {
+  const clampedProgress = Math.max(0, Math.min(100, progress));
   if (granularity === "all") return progress;
-  if (granularity === "fine") return Math.round(progress);
-  return Math.floor(progress / 10) * 10;
+  if (granularity === "fine") return Math.round(clampedProgress);
+  return Math.floor(clampedProgress / 10) * 10;
 };
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e3f815 and 8e663b9.

📒 Files selected for processing (8)
  • packages/react/src/components/button.tsx (6 hunks)
  • packages/react/src/components/dropzone.tsx (6 hunks)
  • packages/react/src/components/shared.tsx (0 hunks)
  • packages/react/src/types.ts (2 hunks)
  • packages/react/src/use-uploadthing.ts (3 hunks)
  • packages/shared/src/component-utils.ts (1 hunks)
  • packages/uploadthing/src/_internal/upload-browser.ts (1 hunks)
  • playground/components/uploader.tsx (1 hunks)
💤 Files with no reviewable changes (1)
  • packages/react/src/components/shared.tsx
⏰ Context from checks skipped due to timeout of 90000ms (8)
  • GitHub Check: typecheck
  • GitHub Check: lint
  • GitHub Check: e2e-node (backend-adapters)
  • GitHub Check: e2e-node (minimal-pagedir)
  • GitHub Check: build
  • GitHub Check: e2e-node (minimal-appdir)
  • GitHub Check: build
  • GitHub Check: build
🔇 Additional comments (12)
playground/components/uploader.tsx (1)

81-81: LGTM!

The addition of uploadProgressGranularity="fine" will provide more granular progress updates in 1% increments, enhancing the user experience.

packages/react/src/types.ts (1)

7-7: LGTM!

The new uploadProgressGranularity property is well-documented with clear JSDoc comments explaining the available options and their effects. The type is properly imported and integrated into the existing type system.

Also applies to: 67-74

packages/react/src/use-uploadthing.ts (1)

11-11: LGTM! Progress calculation improvements.

The changes enhance the upload progress calculation by:

  1. Preventing the total progress from exceeding 100%
  2. Using the new roundProgress function for consistent rounding based on the selected granularity
  3. Maintaining backward compatibility with a default "coarse" granularity

Also applies to: 66-66, 99-104

packages/uploadthing/src/_internal/upload-browser.ts (1)

211-211: LGTM! Progress calculation now supports granular updates.

The removal of Math.round from progress calculations enables more granular progress updates, allowing for smoother progress visualization and better control over progress display through the uploadProgressGranularity property.

Also applies to: 215-215

packages/react/src/components/button.tsx (4)

3-3: LGTM! Added CSSProperties type for better type safety.

The import of CSSProperties from React ensures proper type checking for the style object.


127-127: LGTM! Added uploadProgressGranularity for finer control.

The uploadProgressGranularity property is now passed to the internal upload function, enabling more granular control over progress updates.


252-254: LGTM! Improved progress display with rounding.

The progress value is now rounded before display, ensuring a cleaner presentation of the percentage.


319-324: LGTM! Enhanced progress visualization using CSS variable.

The progress width is now controlled through a CSS variable --progress-width, providing a more maintainable and performant way to handle progress visualization.

Also applies to: 333-333

packages/react/src/components/dropzone.tsx (4)

13-13: LGTM! Added CSSProperties type for better type safety.

The import of CSSProperties from React ensures proper type checking for the style object.


159-159: LGTM! Added uploadProgressGranularity for finer control.

The uploadProgressGranularity property is now passed to the internal upload function, enabling more granular control over progress updates.


284-286: LGTM! Improved progress display with rounding.

The progress value is now rounded before display, ensuring a cleaner presentation of the percentage.


311-316: LGTM! Enhanced progress visualization using CSS variable.

The progress width is now controlled through a CSS variable --progress-width, providing a more maintainable and performant way to handle progress visualization.

Also applies to: 383-383

Copy link
Contributor

@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

🧹 Nitpick comments (2)
packages/svelte/src/lib/types.ts (1)

74-74: Consider adding examples to the documentation.

While the documentation is clear, adding usage examples would further improve developer experience.

Add examples to the JSDoc:

   * - "coarse" - Progress is reported in increments of 10%
   * @default "coarse"
+  * @example
+  * ```ts
+  * uploadProgressGranularity: "fine" // Reports progress in 1% increments
+  * ```
   */
packages/svelte/src/lib/component/UploadDropzone.svelte (1)

266-268: LGTM! Clean implementation of progress indicator using CSS variables.

The changes improve the implementation by:

  • Using CSS variables for progress width instead of static classes
  • Adding proper state management with data attributes
  • Rounding progress numbers for cleaner display

Consider using a CSS custom property name that better reflects its purpose:

-    style={`--progress-width: ${uploadProgress}%; ${styleFieldToClassName(appearance?.button, styleFieldArg)}`}
+    style={`--upload-progress-width: ${uploadProgress}%; ${styleFieldToClassName(appearance?.button, styleFieldArg)}`}

And update the corresponding reference:

-      "after:absolute after:left-0 after:h-full after:w-[var(--progress-width)] after:bg-blue-600 after:transition-[width] after:duration-500 after:content-['']",
+      "after:absolute after:left-0 after:h-full after:w-[var(--upload-progress-width)] after:bg-blue-600 after:transition-[width] after:duration-500 after:content-['']",

Also applies to: 270-271, 274-274, 289-291

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 573e8f4 and 31876ca.

📒 Files selected for processing (15)
  • packages/solid/src/components/button.tsx (4 hunks)
  • packages/solid/src/components/dropzone.tsx (4 hunks)
  • packages/solid/src/components/shared.tsx (0 hunks)
  • packages/solid/src/create-uploadthing.ts (3 hunks)
  • packages/solid/src/types.ts (2 hunks)
  • packages/svelte/src/lib/component/UploadButton.svelte (7 hunks)
  • packages/svelte/src/lib/component/UploadDropzone.svelte (5 hunks)
  • packages/svelte/src/lib/component/shared.ts (0 hunks)
  • packages/svelte/src/lib/create-uploadthing.ts (3 hunks)
  • packages/svelte/src/lib/types.ts (2 hunks)
  • packages/vue/src/components/button.tsx (6 hunks)
  • packages/vue/src/components/dropzone.tsx (5 hunks)
  • packages/vue/src/components/shared.tsx (0 hunks)
  • packages/vue/src/types.ts (2 hunks)
  • packages/vue/src/useUploadThing.ts (3 hunks)
💤 Files with no reviewable changes (3)
  • packages/solid/src/components/shared.tsx
  • packages/svelte/src/lib/component/shared.ts
  • packages/vue/src/components/shared.tsx
🧰 Additional context used
🧠 Learnings (1)
packages/solid/src/components/dropzone.tsx (1)
Learnt from: juliusmarminge
PR: pingdotgg/uploadthing#977
File: packages/solid/src/components/dropzone.tsx:539-544
Timestamp: 2024-11-12T10:36:58.532Z
Learning: In `packages/solid/src/components/dropzone.tsx`, issues related to the `onClick` handler definition will be fixed in PR #980.
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: e2e-node (backend-adapters)
🔇 Additional comments (31)
packages/solid/src/types.ts (2)

7-7: LGTM!

The ProgressGranularity type import is correctly placed and follows the existing import pattern.


67-74: LGTM!

The uploadProgressGranularity property is well-documented with clear explanations for each value and its default. The type definition follows best practices by being optional and including undefined in the union type.

packages/svelte/src/lib/create-uploadthing.ts (3)

7-7: LGTM!

The roundProgress import is correctly added to support the new progress granularity feature.


44-44: LGTM!

The progressGranularity initialization with a default value of "coarse" aligns with the type definition and provides a sensible default.


77-82: LGTM!

The progress calculation improvements are well-implemented:

  1. Using Math.min prevents the progress from exceeding 100%
  2. The roundProgress function ensures consistent granularity based on user preference
packages/svelte/src/lib/types.ts (2)

7-7: LGTM!

The ProgressGranularity type is correctly imported from the shared package.


67-74: LGTM!

The JSDoc comments for uploadProgressGranularity are comprehensive and well-written:

  • Clear explanation of the feature's purpose
  • Detailed description of each granularity option
  • Default value is explicitly documented
packages/vue/src/useUploadThing.ts (3)

13-13: LGTM!

The roundProgress function is imported from the shared package to ensure consistent progress rounding behavior across the application.


67-67: LGTM!

The progressGranularity variable is correctly initialized with a default value of "coarse" from the options.


100-105: LGTM!

The progress calculation has been improved with:

  1. Math.min(100, sum + p) to prevent exceeding 100%.
  2. roundProgress function to ensure consistent rounding based on the granularity setting.
packages/vue/src/types.ts (1)

7-7: LGTM!

The uploadProgressGranularity property is well-documented with clear JSDoc comments explaining the available options and default value.

Also applies to: 74-74

packages/svelte/src/lib/component/UploadButton.svelte (4)

16-16: LGTM!

The imports are correctly added to support type safety and CSS object generation.

Also applies to: 22-22


81-81: LGTM!

The uploadProgressGranularity property is correctly passed to the internal upload function.


159-159: LGTM!

The style binding now uses a CSS variable for progress width, improving maintainability and performance.


223-225: LGTM!

The progress display is improved with:

  1. Proper rounding using Math.round.
  2. Clear block/hidden states for hover interaction.
packages/solid/src/components/button.tsx (3)

107-107: LGTM!

The uploadProgressGranularity property is correctly passed to the internal upload function.


224-227: LGTM!

The style binding now uses a CSS variable for progress width and correctly spreads the CSS object from styleFieldToCssObject.


209-211: LGTM!

The progress display is improved with:

  1. Proper rounding using Math.round.
  2. Clear block/hidden states for hover interaction.
packages/vue/src/components/button.tsx (3)

99-100: LGTM! Progress granularity support added.

The uploadProgressGranularity property is correctly passed to the internal upload handler.

Also applies to: 123-124


219-220: LGTM! Progress display now uses rounded values.

The upload progress percentage is now rounded for better user experience.


310-316: LGTM! Progress styling uses CSS variable.

The progress width is now controlled via a CSS variable, providing better styling flexibility.

packages/solid/src/components/dropzone.tsx (3)

132-133: LGTM! Progress granularity support added.

The uploadProgressGranularity property is correctly passed to the internal upload handler.


342-343: LGTM! Progress display now uses rounded values.

The upload progress percentage is now rounded for better user experience.


307-314: LGTM! Progress styling uses CSS variable.

The progress width is now controlled via a CSS variable, providing better styling flexibility.

packages/vue/src/components/dropzone.tsx (3)

123-124: LGTM! Progress granularity support added.

The uploadProgressGranularity property is correctly passed to the internal upload handler.


315-316: LGTM! Progress display now uses rounded values.

The upload progress percentage is now rounded for better user experience.


385-391: LGTM! Progress styling uses CSS variable.

The progress width is now controlled via a CSS variable, providing better styling flexibility.

packages/solid/src/create-uploadthing.ts (2)

11-11: LGTM!

The roundProgress import is correctly added and aligns with the new progress calculation logic.


53-53: LGTM!

The progressGranularity variable is well-placed and properly initialized with a sensible default value.

packages/svelte/src/lib/component/UploadDropzone.svelte (2)

33-33: LGTM!

The import of getFilesFromClipboardEvent is well-named and appropriately placed.


161-161: LGTM! Good use of AbortController for event cleanup.

The implementation ensures proper cleanup of the paste event listener when the component is destroyed.

Also applies to: 177-177

Copy link
Contributor

A new canary is available for testing. You can install this latest build in your project with:

pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add @uploadthing/[email protected]
pnpm add [email protected]
pnpm add @uploadthing/[email protected]

@github-actions github-actions bot removed the release canary Trigger a canary release to npm label Feb 17, 2025
Copy link
Contributor

@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: 0

🧹 Nitpick comments (2)
.changeset/fair-tomatoes-jog.md (2)

10-12: Commit Message Clarity Note

The commit message "feat: add progressGranularity option to control how granular progress events are fired at" is descriptive. However, consider rephrasing "fired at" to simply "fired" or "triggered" to enhance clarity.


16-20: Clarify the Granularity Behaviors

The bullet-point style description effectively outlines how each granularity level behaves:

  • all: forwards every XHR event.
  • find: triggers events for every 1% progress.
  • coarse: triggers events for every 10% progress.

Consider adding a note on whether the values are case sensitive to prevent any potential user confusion.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 31876ca and 6999823.

📒 Files selected for processing (1)
  • .changeset/fair-tomatoes-jog.md (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: Build & Publish a canary release
  • GitHub Check: e2e-node (backend-adapters)
  • GitHub Check: build
🔇 Additional comments (2)
.changeset/fair-tomatoes-jog.md (2)

1-8: Version Bump Declarations Are Clear

The package version bump entries are clearly declared with appropriate changetype markers (minor & patch). Please verify that these version updates align with the overall semantic versioning strategy for the project.


13-15: Detailed Explanation for Progress Granularity

The description clearly explains the new progressGranularity option and lists the allowed values (all, find, coarse). The message is concise and informative.

`bg-blue-400 after:absolute after:left-0 after:h-full after:bg-blue-600 after:content-[''] ${progressWidths[uploadProgress]}`,
state === "ready" && "bg-blue-600",
"disabled:pointer-events-none",
"data-[state=disabled]:cursor-not-allowed data-[state=readying]:cursor-not-allowed",
Copy link
Collaborator

Choose a reason for hiding this comment

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

oh this is nice

Co-authored-by: Mark R. Florkowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants