Skip to content

Conversation

normanrz
Copy link
Member

@normanrz normanrz commented Aug 26, 2025

Adds a placeholder to the voxel size field in the upload form with the expected format.

Screenshot 2025-08-26 at 14 53 24
  • Added changelog entry (create a $PR_NUMBER.md file in unreleased_changes or use ./tools/create-changelog-entry.py)

@normanrz normanrz self-assigned this Aug 26, 2025
Copy link
Contributor

coderabbitai bot commented Aug 26, 2025

Warning

Rate limit exceeded

@normanrz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 13 minutes and 37 seconds before requesting another review.

⌛ 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.

📥 Commits

Reviewing files that changed from the base of the PR and between 2e9abea and 3ec99e7.

📒 Files selected for processing (1)
  • frontend/javascripts/admin/dataset/dataset_upload_view.tsx (3 hunks)
📝 Walkthrough

Walkthrough

Added a new voxelSizeUnit field to the upload form type, updated voxel-size UI text and placeholder, and refactored two validators into inline lambdas in the frontend upload view; added an unreleased note documenting the placeholder.

Changes

Cohort / File(s) Summary
Frontend upload view & type
frontend/javascripts/admin/dataset/dataset_upload_view.tsx
Added voxelSizeUnit: UnitLong to UploadFormFieldTypes; replaced voxelSize/unit initial values with voxelSizeUnit; updated voxel size help text to reference WEBKNOSSOS and added placeholder "e.g. 11.23, 11.23, 28.3"; refactored storage-quota and unfinished-upload validators into single-line inline lambdas preserving messages and behavior.
Unreleased notes
unreleased_changes/8876.md
Added an “Added” entry documenting the new voxel size input placeholder in the upload form.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

usability

Suggested reviewers

  • philippotto
  • hotzenklotz

Poem

I nibble code with tiny feet,
A helpful hint now makes it neat;
Validators hop into a line,
Units tucked so numbers shine.
A carrot note in docs we meet. 🥕

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch voxel-size-placeholder

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
🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

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

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@normanrz normanrz requested a review from hotzenklotz August 26, 2025 12:55
@fm3
Copy link
Member

fm3 commented Aug 26, 2025

how about preselecting a unit? if 90% of users have the same unit, we could save them a click?

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 (4)
unreleased_changes/8876.md (1)

1-2: Changelog entry exists — consider expanding scope to reflect all user-visible changes

The PR also tweaks the voxel-size help copy and improves two validation messages (storage quota and unfinished-upload file matching). Adding those here helps downstream users/admins know what to expect.

Apply this diff to expand the entry:

 ### Added
-- Added a placeholder to the voxel size input field in the upload form.
+- Upload form: Added a placeholder to the “Voxel Size” input field (e.g., 11.23, 11.23, 28.3).
+  This clarifies the expected x, y, z format.
+
+### Changed
+- Clarified help text shown for voxel size when a dataset isn’t yet in a WEBKNOSSOS format.
+- Improved validation messages:
+  - Storage quota error now points users/admins to how to request more storage.
+  - When resuming an unfinished upload, the validator shows which filenames must be selected.
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (3)

870-904: Help copy: tighten wording and make intent explicit

Nit: “a WEBKNOSSOS format” reads a bit awkward. Suggest “WEBKNOSSOS-supported format” and explicitly mention x, y, z to match the field label. Also, since users must provide voxel size when conversion is needed, double-check that the adjacent disabled prop (on the same FormItemWithInfo) isn’t inadvertently disabling the field when needsConversion is true. If it does, please drop it.

Suggested copy tweak:

-                    help="Your dataset is not yet in a WEBKNOSSOS format. Therefore, you need to define the voxel size."
+                    help="Your dataset is not yet in a WEBKNOSSOS‑supported format. Please define the voxel size (x, y, z) to continue."

992-996: Inline storage-quota validator looks good; consider including numbers for UX

Logic is correct and leverages getLeftOverStorageBytes. Optional: include the selected total size and remaining quota in the error to help users decide what to remove. This would require using a custom validator function (to compute a dynamic message) instead of syncValidator’s fixed string.


1020-1034: Tiny copy fix: add a space before the appended filename list

Currently produces “…as before.The file names…”. Add a leading space for readability. Optionally, limit the number of listed files and add “and N more…” to avoid very long messages.

Apply this diff:

-                  }, "The selected files do not match the files of the unfinished upload. Please select the same files as before." + (unfinishedUploadToContinue?.filePaths != null ? `The file names are: ${unfinishedUploadToContinue?.filePaths?.join(", ")}.` : "")),
+                  }, "The selected files do not match the files of the unfinished upload. Please select the same files as before." + (unfinishedUploadToContinue?.filePaths != null ? ` The file names are: ${unfinishedUploadToContinue?.filePaths?.join(", ")}.` : "")),
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 7317060 and ed4d6fb.

📒 Files selected for processing (2)
  • frontend/javascripts/admin/dataset/dataset_upload_view.tsx (4 hunks)
  • unreleased_changes/8876.md (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (2)
frontend/javascripts/types/validation.ts (1)
  • syncValidator (83-86)
frontend/javascripts/admin/organization/pricing_plan_utils.ts (1)
  • getLeftOverStorageBytes (51-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests
🔇 Additional comments (1)
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (1)

892-901: Vector3Input uses a single text input; per-axis placeholders aren’t supported

Vector3Input (inherited from BaseVector in frontend/javascripts/libs/vector_input.tsx) renders one InputComponent that displays the vector as comma-separated text and forwards the single placeholder string directly to it (see the render method around lines 162–167). It doesn’t render three separate inputs nor accept an array/tuple of placeholders. Keeping

<Vector3Input
  allowDecimals
  placeholder="e.g. 11.23, 11.23, 28.3"
  
/>

is correct.

Likely an incorrect or invalid review comment.

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 (5)
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (5)

801-805: Preselected voxel size unit default looks good; aligns with reviewer suggestion

Defaulting to UnitLong.nm is a sensible choice and directly addresses fm3’s comment about saving a click for the common case.

If you want to further streamline UX, consider persisting the last used unit in localStorage and using it as the initial value when present (falling back to nm).


872-891: Clarify help text wording and remove an ineffectual disabled prop

  • Wording: “in a WEBKNOSSOS format” is ambiguous (WEBKNOSSOS isn’t a file format). Prefer “WEBKNOSSOS‑supported format” for precision.
  • The disabled prop on FormItemWithInfo is ts‑ignored and likely ignored at runtime. If the intent is to actually disable the Vector3Input, pass disabled to the input component instead; otherwise, drop the prop to avoid confusion.

Apply this focused copy change and remove the stray prop:

-                    // @ts-ignore
-                    disabled={this.state.needsConversion}
-                    help="Your dataset is not yet in a WEBKNOSSOS format. Therefore, you need to define the voxel size."
+                    help="Your dataset is not in a WEBKNOSSOS‑supported format. Therefore, you need to define the voxel size."

If you do need to disable the control based on state, wire it to Vector3Input:

-                    <Vector3Input
+                    <Vector3Input
+                      disabled={this.state.needsConversion /* or the intended condition */}

891-900: Nice placeholder; consider reflecting the selected unit

The placeholder is helpful. For even clearer guidance, append the currently selected unit’s short label so users see the expected unit at a glance.

Apply this small tweak:

-                    <Vector3Input
-                      allowDecimals
-                      placeholder="e.g. 11.23, 11.23, 28.3"
+                    <Vector3Input
+                      allowDecimals
+                      placeholder={`e.g. 11.23, 11.23, 28.3 ${LongUnitToShortUnitMap[
+                        this.formRef.current?.getFieldValue("voxelSizeUnit") ?? UnitLong.nm
+                      ]}`}

991-995: Storage quota validator: good inline refactor; minor i18n/UX follow-up

Logic is correct and efficient. Consider moving the error string into messages for consistency with other i18n’d strings. Also, if organization storage changes while the dialog is open, a quick revalidate on organization updates would keep the error fresh (optional).


1019-1033: Unfinished upload file match: correct set comparison; cap error length and show base names

Logic correctly checks for order-independent equality. However, concatenating all paths can create an extremely long error. Show base names and truncate the list.

Apply this trimming in-place:

-                  }, "The selected files do not match the files of the unfinished upload. Please select the same files as before." + (unfinishedUploadToContinue?.filePaths != null ? `The file names are: ${unfinishedUploadToContinue?.filePaths?.join(", ")}.` : "")),
+                  }, "The selected files do not match the files of the unfinished upload. Please select the same files as before." + (() => {
+                    const files = unfinishedUploadToContinue?.filePaths;
+                    if (!files) return "";
+                    const names = files.map((p) => p.split(/[\\/]/).pop() || p);
+                    const shown = names.slice(0, 5).join(", ");
+                    return ` The files are: ${shown}${names.length > 5 ? `, +${names.length - 5} more` : ""}.`;
+                  })()),

Optional: if privacy is a concern, keeping only base names (as above) avoids exposing local folder structures in the UI.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between ed4d6fb and 2e9abea.

📒 Files selected for processing (1)
  • frontend/javascripts/admin/dataset/dataset_upload_view.tsx (5 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
frontend/javascripts/admin/dataset/dataset_upload_view.tsx (2)
frontend/javascripts/types/validation.ts (1)
  • syncValidator (83-86)
frontend/javascripts/admin/organization/pricing_plan_utils.ts (1)
  • getLeftOverStorageBytes (51-53)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests

@normanrz normanrz enabled auto-merge (squash) August 26, 2025 13:11
@normanrz normanrz merged commit 96a88c0 into master Aug 26, 2025
5 checks passed
@normanrz normanrz deleted the voxel-size-placeholder branch August 26, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants