Repository navigation
fix: discount URLs in commit character allowance - #805
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Client counting and issue-mode eligibility can allow submissions that server validation rejects.
3 open issues
What changed in this PR
This PR addresses #793 by discounting prose URLs toward commit limits while preserving full destinations.
Changes:
- Count each prose URL as at most 23 characters.
- Share validation across submission endpoints, with URL and raw-body limits.
- Update composer counters, tests, and documentation.
| File | Description |
|---|---|
| tests/Unit/Services/UrlsTest.php | Tests URL limits and discounted counts. |
| tests/Unit/LinkifiedText.test.tsx | Tests frontend counting and issue-mode counters. |
| tests/Feature/Controllers/CommitControllerTest.php | Tests submission limits and destination preservation. |
| resources/js/lib/urls.ts | Extracts shared URL recognition helpers. |
| resources/js/lib/commit.ts | Adds URL-adjusted body counting. |
| resources/js/lib/code.ts | Adds committed-prose mapping. |
| resources/js/components/linkified-text.tsx | Reuses shared URL helpers. |
| resources/js/components/commit-thread.tsx | Updates reply limits and eligibility. |
| resources/js/components/commit-quote-button.tsx | Updates quote limits and eligibility. |
| resources/js/components/commit-composer.tsx | Updates composer counting and limits. |
| resources/js/components/body-counter.tsx | Displays adjusted counts and over-limit states. |
| KNOWLEDGE_BASE.md | Documents URL allowances and limits. |
| app/Services/Urls.php | Adds URL length checks and counting. |
| app/Rules/CommitBodyLength.php | Validates adjusted commit length. |
| app/Http/Requests/CreateScheduledCommitRequest.php | Applies shared scheduled-commit validation. |
| app/Http/Requests/CreateCommitRequest.php | Centralizes body validation rules. |
| app/Http/Requests/CreateCommitReplyRequest.php | Applies shared reply validation. |
| app/Http/Requests/CreateCommitPreviewRequest.php | Applies shared preview validation. |
| app/Http/Requests/CreateCliCommitRequest.php | Applies shared terminal validation. |
| app/Http/Requests/CreateApiCommitRequest.php | Applies shared API validation. |
Review effort: Balanced
Count prose links as at most 23 characters while preserving their destinations. Enforce a 2048-character URL limit and a 40000-character raw-body limit across commit submission endpoints. Closes #793 Co-authored-by: Pauline Vos <pvos88@gmail.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a158da-5d32-74ba-b9ef-5a1b2b6ddd34
paulinevos
force-pushed
the
fix/793-url-character-allowance
branch
from
October 20, 2026 11:27
2d19329 to
3420617
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Count prose links as at most 23 characters while preserving their destinations. Enforce a 2048-character URL limit and a 40000-character raw-body limit across commit submission endpoints.
Closes #793
Amp-Thread-ID: https://ampcode.com/threads/T-01a158da-5d32-74ba-b9ef-5a1b2b6ddd34