Skip to content

Require GFM adjacency for translate table detection#1088

Merged
feruzm merged 2 commits into
developfrom
bugfix/translate-table-adjacency
Jul 6, 2026
Merged

Require GFM adjacency for translate table detection#1088
feruzm merged 2 commits into
developfrom
bugfix/translate-table-adjacency

Conversation

@feruzm

@feruzm feruzm commented Jul 6, 2026

Copy link
Copy Markdown
Member

Parity port of the tightening that shipped in the mobile compose-translation review (ecency/ecency-mobile#3325): translateMarkdown classified a block as a table when any line had a pipe and any other line looked like a |---| separator, so prose containing pipe characters near a separator-like line was silently skipped by translation. The separator row must now sit directly below a pipe-containing row (the GFM shape).

Two regression tests added (real table still skipped; pipes-in-prose now translates); suite 30/30.

Replaces #1087 (branch renamed so the build workflow triggers).

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@feruzm, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 19 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff980bb6-2503-4223-b32c-bb32f6445c02

📥 Commits

Reviewing files that changed from the base of the PR and between 071f467 and 3f8733b.

📒 Files selected for processing (2)
  • apps/web/src/api/translation.ts
  • apps/web/src/specs/api/translate-markdown.spec.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bugfix/translate-table-adjacency

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.

@greptile-apps

greptile-apps Bot commented Jul 6, 2026

Copy link
Copy Markdown

Greptile Summary

This PR tightens markdown table detection for translated content. The main changes are:

  • Requires a separator row to sit directly below a pipe row.
  • Adds matching cell-count checks before skipping a block as a table.
  • Adds tests for real tables, stray separator-like lines, and pipe prose.

Confidence Score: 4/5

This is close, but the table heuristic can still skip translatable prose.

  • Adjacent prose with matching pipe counts can still be classified as a table.
  • That path leaves user text untranslated without an error.

apps/web/src/api/translation.ts

Important Files Changed

Filename Overview
apps/web/src/api/translation.ts Updates table detection to require adjacent separator rows with matching cell counts.
apps/web/src/specs/api/translate-markdown.spec.ts Adds tests for table skipping and pipe-prose translation behavior.

Fix All in Claude Code

Reviews (2): Last reviewed commit: "fix(publish): match table cell counts in..." | Re-trigger Greptile

Comment thread apps/web/src/api/translation.ts Outdated
line.includes("|") &&
line.includes("-") &&
TABLE_SEPARATOR_LINE.test(line) &&
lines[i - 1].includes("|") &&

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Matching Counts Still Skip

When adjacent prose has the same pipe-delimited count as a separator-looking line, this still treats the whole block as a table. For example, Valores: min | max | defecto\n-- | -- | -- gives both lines a count of 3, so translateMarkdown skips the block instead of translating the prose. The count check fixes mismatched examples, but matching-count prose still produces the silent untranslated output this change is meant to prevent.

Context Used: CLAUDE.md (source)

Fix in Claude Code

@feruzm feruzm merged commit 1f19d1f into develop Jul 6, 2026
7 checks passed
@feruzm feruzm deleted the bugfix/translate-table-adjacency branch July 6, 2026 20:09
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