Skip to content

fix: discount URLs in commit character allowance - #805

Merged
paulinevos merged 1 commit into
productionfrom
fix/793-url-character-allowance
Oct 20, 2026
Merged

paulinevos merged 1 commit into
productionfrom
fix/793-url-character-allowance

Conversation

@paulinevos

Copy link
Copy Markdown
Contributor

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

Copilot AI balanced review requested due to automatic review settings October 20, 2026 11:04

Copilot AI 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.

🟡 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

Comment thread resources/js/lib/commit.ts Resolved
Comment thread resources/js/lib/urls.ts Resolved
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
paulinevos force-pushed the fix/793-url-character-allowance branch from 2d19329 to 3420617 Compare October 20, 2026 11:27
@paulinevos
paulinevos merged commit c6497df into production Oct 20, 2026
5 checks passed
@paulinevos
paulinevos deleted the fix/793-url-character-allowance branch October 20, 2026 11:37
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.

Implement url shortener for links

3 participants