Skip to content

feat: Display duration in days when exceeding 48 hours#16

Merged
NotYuSheng merged 1 commit intomainfrom
feature/duration-days-display
Feb 2, 2026
Merged

feat: Display duration in days when exceeding 48 hours#16
NotYuSheng merged 1 commit intomainfrom
feature/duration-days-display

Conversation

@NotYuSheng
Copy link
Owner

Update overview duration formatter to show days with 1 decimal place when duration exceeds 48 hours for better readability of long captures.

  • Durations > 48h: Display as "X.X days"
  • Durations <= 48h: Keep existing format (Xh Ym, Xm Ys, Xs)

Update overview duration formatter to show days with 1 decimal place
when duration exceeds 48 hours for better readability of long captures.

- Durations > 48h: Display as "X.X days"
- Durations <= 48h: Keep existing format (Xh Ym, Xm Ys, Xs)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@gemini-code-assist
Copy link

Summary of Changes

Hello @NotYuSheng, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the user experience by making long capture durations more digestible. It modifies the overview duration formatter to display values greater than 48 hours in a day-based format, ensuring that users can quickly grasp the magnitude of extended time periods without needing to mentally convert hours to days.

Highlights

  • Duration Formatting: Introduced a new display format for durations exceeding 48 hours, presenting them in 'X.X days' for improved readability.
  • Conditional Display: Durations of 48 hours or less will continue to use the existing 'Xh Ym', 'Xm Ys', or 'Xs' formats.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@NotYuSheng NotYuSheng merged commit 0967c1b into main Feb 2, 2026
1 check passed
@NotYuSheng NotYuSheng deleted the feature/duration-days-display branch February 2, 2026 08:32
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a helpful feature to display durations longer than 48 hours in days for better readability. The implementation is a good step forward, but I've identified a minor bug in the logic for checking the duration threshold. Durations between 48 and 49 hours are not being formatted as days due to integer truncation. I have provided a review comment with a suggested code change to correct this behavior.

Comment on lines +28 to +31
if (hours > 48) {
const days = hours / 24;
return `${days.toFixed(1)} days`;
}

Choose a reason for hiding this comment

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

high

The current logic for checking if the duration exceeds 48 hours has a subtle bug. Because hours is a floored integer, the condition hours > 48 will only be true for durations of 49 hours or more, not for durations between 48 and 49 hours.

To fix this, the comparison should be done using the total seconds, which is more precise. The calculation for days should also be based on seconds to ensure accuracy.

Suggested change
if (hours > 48) {
const days = hours / 24;
return `${days.toFixed(1)} days`;
}
if (seconds > 48 * 3600) {
const days = seconds / (24 * 3600);
return `${days.toFixed(1)} days`;
}

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.

1 participant