Skip to content

Fix: hide empty segment#2844

Merged
ItzNotABug merged 3 commits intomainfrom
fix-progress
Feb 9, 2026
Merged

Fix: hide empty segment#2844
ItzNotABug merged 3 commits intomainfrom
fix-progress

Conversation

@ItzNotABug
Copy link
Member

@ItzNotABug ItzNotABug commented Feb 9, 2026

What does this PR do?

0 based segmented area is too small and looks very odd.

Test Plan

Manual.

Before:

Screenshot 2026-02-09 at 1 34 21 PM

After:

Screenshot 2026-02-09 at 1 34 30 PM

Related PRs and Issues

N/A

Have you read the Contributing Guidelines on issues?

Yes.

Summary by CodeRabbit

  • New Features
    • Added the ability to hide empty segments in progress bars, allowing for cleaner visualizations when segments have zero or non-positive values.
    • Implemented automatic spacing adjustment between progress bar segments based on segment count.

@ItzNotABug ItzNotABug self-assigned this Feb 9, 2026
@appwrite
Copy link

appwrite bot commented Feb 9, 2026

Console (appwrite/console)

Project ID: 688b7bf400350cbd60e9

Sites (1)
Site Status Logs Preview QR
 console-stage
688b7cf6003b1842c9dc
Ready Ready View Logs Preview URL QR Code

Tip

Function scopes give you fine-grained control over API permissions

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 9, 2026

Warning

Rate limit exceeded

@ItzNotABug has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 26 minutes and 17 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.

Walkthrough

This PR adds a new hideEmptySegments public prop to the ProgressBar component that filters out segments with non-positive size from rendering. The implementation introduces a derived segments dataset that conditionally filters the input data based on the prop value, recalculates the remainder using the filtered segments while preserving the original maxSize, adds dynamic gap calculation between segments (2px when multiple segments exist, 0px otherwise), and applies the gap via CSS variables. The type definition is updated to include the optional property, and the feature is integrated into two ProgressBar instances in the varchar column renderer.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix: hide empty segment' directly relates to the main change - adding hideEmptySegments prop to control segment visibility, specifically hiding segments with zero size.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-progress

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 and usage tips.

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

🤖 Fix all issues with AI agents
In `@src/lib/components/progressbar/ProgressBar.svelte`:
- Around line 12-15: Update the JSDoc for the exported prop hideEmptySegments to
accurately describe the behavior: change the comment that currently says "Hides
empty segments where size is < 0" to state that segments with size <= 0 (i.e.,
size === 0 and negative sizes) are hidden, matching the actual filter that uses
item.size > 0 in the component.

@ItzNotABug ItzNotABug merged commit feee244 into main Feb 9, 2026
4 checks passed
@ItzNotABug ItzNotABug deleted the fix-progress branch February 9, 2026 08:11
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.

2 participants