Skip to content

feat: cap loop duration with max_seconds - #22

Merged
HarrisJDCampbell merged 3 commits into
HarrisJDCampbell:mainfrom
dxnnystyles:feat/issue-18-max-seconds
Oct 30, 2026
Merged

HarrisJDCampbell merged 3 commits into
HarrisJDCampbell:mainfrom
dxnnystyles:feat/issue-18-max-seconds

Conversation

@dxnnystyles

Copy link
Copy Markdown
Contributor

What this changes

i added a max_seconds cap for the loop. if the generated timeline at the requested pace already fits, it stays unchanged; otherwise i lower pace to the highest value that keeps the loop within the cap. if even pace 0.25 is too long, rendering fails and reports the shortest supported duration.

i ran npm test (18/18 passed).

Fixes #18

Checklist

  • npm test passes (18/18)
  • Anything from an input that reaches the SVG is validated or escaped
  • No new dependencies
  • Screenshot of a frozen frame, if it changes how the animation looks (N/A: this changes loop timing only; the scene layout and colors are unchanged)

@coderabbitai

coderabbitai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a1cc451f-2ddc-4bfb-a84d-88843395e52d
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@HarrisJDCampbell HarrisJDCampbell left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for this. Binary-searching the pace is smart, and the test showing proportional scaling would miss the limit is a really nice touch. Two things before it lands:

  1. When even pace 0.25 can't fit, could it render at 0.25 and log a warning instead of failing? The action runs nightly, so a profile that gets busier during the year would suddenly start failing its workflow. That's what I meant by "clamp" in #18.
  2. #23 just merged and touches the same spots in render.mjs, index.mjs, action.yml and the README, so this needs main merged in. Happy to do that part for you if you'd like.

@dxnnystyles

Copy link
Copy Markdown
Contributor Author

thanks, good catch. impossible caps now keep the Action running at pace 0.25 w/ a warning that includes the shortest achievable duration. I also synced the branch w/ current main after #23 merged + added regression coverage. npm test passed 20/20.

@dxnnystyles

Copy link
Copy Markdown
Contributor Author

the requested fallback + upstream sync are in place, and the regression tests are passing (20/20). whenever you get a chance, could you take another look?

@HarrisJDCampbell

Copy link
Copy Markdown
Owner

Sorry for the wait, and thanks for turning this around so fast. Searching on the real timeline instead of scaling the pace linearly is the right call, since flight time stops growing past pace 1.5, and your test showing linear scaling missing the limit makes that obvious. I merged main into your branch to resolve the conflict with the hair options, keeping both. Merging.

@HarrisJDCampbell
HarrisJDCampbell merged commit 81163ef into HarrisJDCampbell:main Oct 30, 2026
5 checks passed
@dxnnystyles

Copy link
Copy Markdown
Contributor Author

thanks for the review and getting the merge conflicts sorted out!

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.

Cap the loop length with a max_seconds input

2 participants