Skip to content

Improve JSON dynamic progress bars#207

Merged
guibranco merged 3 commits into
guibranco:mainfrom
nimble-turtle:json-updates
Apr 14, 2026
Merged

Improve JSON dynamic progress bars#207
guibranco merged 3 commits into
guibranco:mainfrom
nimble-turtle:json-updates

Conversation

@nimble-turtle

@nimble-turtle nimble-turtle commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Fixes:

  • Add example to readme without label.
  • Move examples into the example table
  • Don't show decimal point unless source data has it.

Summary by CodeRabbit

  • Documentation

    • Updated examples section with improved visual presentation using a comparison table of JSON preview outputs and their URLs
  • Bug Fixes

    • Fixed progress display to show whole numbers without unnecessary decimal points

@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

@nimble-turtle is attempting to deploy a commit to the guibranco's projects Team on Vercel.

A member of the Team first needs to authorize it.

@sourcery-ai

sourcery-ai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the README to show two dynamic JSON progress bar examples (one with a title label and one without) in a preview table, and introduces a helper in app.py to suppress trailing .0 for integer-like float progress values before rendering.

Class diagram for updated progress formatting in app module

classDiagram
  class app {
    +dict get_style_fields(style)
    +object format_progress_text(progress)
    +dict get_template_fields(progress)
  }

  app : get_style_fields(style)
  app : format_progress_text(progress)
  app : get_template_fields(progress)

  class format_progress_text {
    +object format_progress_text(progress)
  }

  class get_template_fields {
    +dict get_template_fields(progress)
  }

  get_template_fields --> format_progress_text : calls
Loading

Flow diagram for formatting progress text without unnecessary decimal point

flowchart TD
  A[Input progress value] --> B{Is progress a float?}
  B -- No --> E[Return progress as is]
  B -- Yes --> C{Is progress an integer value?}
  C -- Yes --> D[Convert progress to int and return]
  C -- No --> E[Return progress as is]
Loading

File-Level Changes

Change Details Files
Improve README dynamic JSON section with visual examples, including a no-label variant.
  • Renamed the section heading from a single example to plural examples for dynamic JSON usage.
  • Replaced the single plain-text URL example with a Markdown table that shows preview images and clickable URLs for both labeled and unlabeled dynamic JSON progress bars.
  • Removed the old standalone image example that duplicated one of the new table entries.
README.md
Normalize progress text formatting so integer-valued floats do not display a decimal point.
  • Added a format_progress_text helper that converts float progress values that are mathematically integers into ints, leaving other values unchanged.
  • Updated get_template_fields to use format_progress_text when computing progress_text so rendered progress bars no longer show a .0 suffix when source data is a whole number represented as a float.
app.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@github-actions github-actions Bot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Apr 14, 2026
@gstraccini gstraccini Bot requested a review from guibranco April 14, 2026 17:05
@gstraccini gstraccini Bot added the 🚦 awaiting triage Items that are awaiting triage or categorization label Apr 14, 2026
@coderabbitai

coderabbitai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@nimble-turtle has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 40 minutes and 51 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 40 minutes and 51 seconds.

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

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: eeded0c2-085d-46d3-90f6-303a39e90757

📥 Commits

Reviewing files that changed from the base of the PR and between addf99f and 9a086c1.

📒 Files selected for processing (2)
  • README.md
  • docs/dynamic-json-sample.json

Walkthrough

Documentation updated with an expanded examples table showing multiple JSON-derived progress visualizations. A new helper function format_progress_text() converts whole-number float progress values to integers for text rendering, improving template field formatting in progress display logic.

Changes

Cohort / File(s) Summary
Documentation
README.md
Replaced single example snippet with two-row markdown table displaying JSON-derived progress previews with corresponding URLs and visual representations.
Progress Formatting
app.py
Added format_progress_text() helper function to convert whole-number float progress values to integers; updated get_template_fields() to use this formatter for the progress_text field.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A table blooms where examples grew,
With progress shown in formats new,
Whole numbers dressed in cleaner ways,
Your template shines through clearer displays! ✨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Improve JSON dynamic progress bars' is partially related to the changeset. While the PR does modify JSON-related functionality (progress text formatting in app.py), the title is somewhat vague and doesn't specifically capture the main objectives: adding an example to the README without a label and removing unnecessary decimal points in progress text. Consider a more specific title that captures the core changes, such as 'Remove decimal points from progress text and add unlabeled JSON example' or 'Format progress text without decimals and update examples'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@deepsource-io

deepsource-io Bot commented Apr 14, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in c4181d4...9a086c1 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
Secrets Apr 14, 2026 5:24p.m. Review ↗
Python Apr 14, 2026 5:24p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@gstraccini

gstraccini Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Please provide a description for this pull request.

@nimble-turtle nimble-turtle changed the title Add example to readme without label. Dont show decimal point unless source data has it. Improve JSON dynamic Apr 14, 2026
@penify-dev

penify-dev Bot commented Apr 14, 2026

Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

@nimble-turtle nimble-turtle changed the title Improve JSON dynamic Improve JSON dynamic progress bars Apr 14, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Consider having format_progress_text consistently return a string (e.g., str(int(progress)) for whole-number floats) to avoid changing the type of progress_text from float to int and to keep downstream template/consumers behavior more predictable.
  • You might want to reuse or factor out the long JSON sample URL in the README (e.g., via link references or a base URL variable) to avoid duplication and make future updates to that URL less error-prone.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider having `format_progress_text` consistently return a string (e.g., `str(int(progress))` for whole-number floats) to avoid changing the type of `progress_text` from float to int and to keep downstream template/consumers behavior more predictable.
- You might want to reuse or factor out the long JSON sample URL in the README (e.g., via link references or a base URL variable) to avoid duplication and make future updates to that URL less error-prone.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@codacy-production

codacy-production Bot commented Apr 14, 2026

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

TIP This summary will be updated as you push new changes. Give us feedback

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 the current code and only fix it if needed.

Inline comments:
In `@app.py`:
- Around line 345-349: format_progress_text currently converts integral floats
to int, causing source-authored 73.0 to become 73; revert that behavior by
removing the int coercion in format_progress_text so a float is returned
unchanged (thus preserving "73.0" when serialized), and also update
extract_progress_with_jsonpath to avoid collapsing original numeric types into
float (preserve the original JSON token type or capture the original string form
and pass it through) so the formatter receives the actual source representation.
🪄 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

Run ID: c288eb4c-2a6d-4614-8c17-2e9a7a61e2ec

📥 Commits

Reviewing files that changed from the base of the PR and between c4181d4 and addf99f.

📒 Files selected for processing (2)
  • README.md
  • app.py

Comment thread app.py
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
progressbar Ready Ready Preview, Comment Apr 14, 2026 5:55pm

@guibranco guibranco merged commit 727316f into guibranco:main Apr 14, 2026
18 of 19 checks passed
@nimble-turtle nimble-turtle deleted the json-updates branch April 15, 2026 00:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚦 awaiting triage Items that are awaiting triage or categorization size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants