Skip to content

perf: skip emoji parsing in text without shortcode delimiters - #1423

Merged
nunomaduro merged 1 commit into
dev-null-sh:productionfrom
MrPunyapal:perf/skip-emoji-processing-without-colons
Nov 7, 2026
Merged

nunomaduro merged 1 commit into
dev-null-sh:productionfrom
MrPunyapal:perf/skip-emoji-processing-without-colons

Conversation

@MrPunyapal

@MrPunyapal MrPunyapal commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Change

Skips shortcode parsing for text that contains no colon delimiter. Text with shortcode delimiters follows the existing parsing path.

Tests

Focused emoji tests passed (9 tests), covering ordinary text and shortcode processing. Type checks and lint passed.

Summary by CodeRabbit

  • Bug Fixes
    • Emoji conversion now leaves text without a shortcode unchanged. While editing such text, the entered content and caret position are preserved, preventing plain writing from being altered or the cursor from shifting when no emoji shortcode is present during normal text entry.

@coderabbitai

coderabbitai Bot commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

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: e247e776-d582-4ee2-be63-4525ec727900
Commits

Reviewing files that changed from the base of the PR and between c65a615 and c6c4a46.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

emojify and emojifyInput now return early when the input contains no colon. A unit test verifies that plain prose remains unchanged and that emojifyInput preserves the supplied caret position.

Changes: Emoji shortcode fast path

Layer / File(s) Summary
Shortcode-free input handling
resources/js/lib/emoji.ts, tests/Unit/EmojiShortcodes.test.tsx
emojify returns the input unchanged when it contains no colon. emojifyInput returns the original text and caret without typed-prose mapping. The test checks both results for plain prose.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Possibly related PRs

Suggested reviewers: xheaven, mnapoli

Merge Risk: Minimal · previous review cb595

The targeted emoji optimization does not introduce an established regression or merge-blocking risk.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title "perf: skip emoji parsing in text without shortcode delimiters" matches the main change. The raw summary says emojify and emojifyInput return early when input has no colon, so shortcode pars…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title "perf: skip emoji parsing in text without shortcode delimiters" matches the main change. The raw summary says emojify and emojifyInput return early when input has no colon, so shortcode parsing is skipped for such text. The PR objectives describe the same change. The title is specific, concise, and follows a conventional commit style.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 2 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
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: af54ed57-5ebc-48e2-be9f-368e5f39cfad
Commits

Reviewing files that changed from the base of the PR and between c934501 and cb595ca.

Files selected for processing: 2
  • resources/js/lib/emoji.ts
  • tests/Unit/EmojiShortcodes.test.tsx

Limit details: You’ve used all 10 included reviews currently available.

@MrPunyapal
MrPunyapal force-pushed the perf/skip-emoji-processing-without-colons branch from fca7f78 to cb595ca Compare November 3, 2026 05:55
@MrPunyapal
MrPunyapal marked this pull request as ready for review November 3, 2026 06:02
@MrPunyapal
MrPunyapal force-pushed the perf/skip-emoji-processing-without-colons branch 2 times, most recently from 8c4fb58 to c65a615 Compare November 4, 2026 11:05
@MrPunyapal
MrPunyapal force-pushed the perf/skip-emoji-processing-without-colons branch from c65a615 to c6c4a46 Compare November 4, 2026 20:26
@nunomaduro
nunomaduro merged commit e41e3fc into dev-null-sh:production Nov 7, 2026
1 check passed
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.

2 participants