Skip to content

Template creation on mobile and translate table-detection parity#3328

Merged
feruzm merged 4 commits into
developmentfrom
feature/template-translate-followups
Jul 6, 2026
Merged

Template creation on mobile and translate table-detection parity#3328
feruzm merged 4 commits into
developmentfrom
feature/template-translate-followups

Conversation

@feruzm

@feruzm feruzm commented Jul 6, 2026

Copy link
Copy Markdown
Member

Two follow-ups bundled.

Save as template

Mobile could apply and delete templates but not create them. The post options modal (gear) gains a "Save as template" row that prompts for a name and saves the current editor content as a template draft (meta.postTemplate + templateName, same shape as web), including tags, beneficiaries, poll, reward type and description.

  • Hidden in reply and edit modes and when the editor is empty.
  • Uses its own addDraft call and never touches the current draft id, autosave state, or editor caches, so drafting continues unaffected.
  • Placed in the options modal because the save-icon alert already has three buttons (Android's Alert maximum). Name prompt follows the snippet editor modal idiom.
  • The templates empty-state copy now says templates can be saved from the editor.

Translate table-detection parity

Ports the web tightening from ecency/vision-next#1088: a separator row only marks a block as a table when it sits directly below a pipe row with the same cell count, so prose containing pipes near a separator-like line translates instead of being silently skipped. Web-mirroring tests added.

Full suite 550 passed / 1 skipped; eslint delta clean on all changed files.

Review note

Title-only templates are allowed on purpose (same gate as web): a template holding just a title pattern plus tags, community, beneficiaries and reward settings is a valid scaffold, with the body written fresh on each use. Applying one cannot publish an empty post since the editor still requires a body before posting. The save path always writes body as a string.

@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next review available in: 1 minute

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: f90d2d1d-0906-4a33-bb26-8a3eaf92b7bb

📥 Commits

Reviewing files that changed from the base of the PR and between 1e6a25b and ac346eb.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • package.json
  • src/config/locales/en-US.json
  • src/providers/translation/translateMarkdown.test.ts
  • src/providers/translation/translateMarkdown.ts
  • src/screens/editor/children/postOptionsModal.tsx
  • src/screens/editor/children/saveTemplateModal.tsx
  • src/screens/editor/children/saveTemplateModalStyles.ts
  • src/screens/editor/container/editorContainer.tsx
  • src/screens/editor/screen/editorScreen.tsx
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/template-translate-followups

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 adds mobile template creation and tightens markdown table detection. The main changes are:

  • A save-template option in the editor post options modal.
  • A name prompt and draft save path for template drafts.
  • Updated template empty-state copy.
  • Table detection that checks adjacent separator rows by cell count.
  • Tests for pipe prose and borderless table handling.

Confidence Score: 4/5

This is close, but the template save gate should be fixed before merging.

  • The save-template row still appears for a title-only editor state.
  • That path can save a template whose body is an empty string.
  • Applying that template later gives the user an empty post body.

src/screens/editor/screen/editorScreen.tsx

Important Files Changed

Filename Overview
src/screens/editor/screen/editorScreen.tsx Adds the save-template modal trigger and visibility gate, but the gate still allows title-only saves with empty template bodies.
src/screens/editor/container/editorContainer.tsx Adds a separate template draft save path that preserves the active draft state.
src/providers/translation/translateMarkdown.ts Updates markdown table detection to require matching adjacent row cell counts.

Fix All in Claude Code

Reviews (3): Last reviewed commit: "bump @ecency/sdk to 2.3.37" | Re-trigger Greptile


_handleSaveAsTemplate = (templateName) => {
const { saveAsTemplate } = this.props;
const { fields } = this.state;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Title-Only Templates Save Empty Bodies

When a post has only a title, the new gate still calls saveAsTemplate, and _saveAsTemplate forwards draftField.body directly to metadata extraction and addDraft. That creates a template draft with no body content, so the template can be saved successfully but later applies as an empty post body.

Fix in Claude Code

handleScheduleChange={this._handleScheduleChange}
handleShouldReblogChange={handleShouldReblogChange}
handleFormUpdate={this._handleFormUpdate}
canSaveTemplate={!isReply && !isEdit && !!(fields.title || fields.body)}

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 Empty Body Templates
When the editor has a title but no body, this condition still shows the save-template action. _handleSaveAsTemplate uses the same title-or-body check before saving, and the save path writes body as an empty string. A user can save that template successfully, but applying it later produces a template with no post body. Gate this action on body content so empty-body templates cannot be created from a title-only editor state.

Suggested change
canSaveTemplate={!isReply && !isEdit && !!(fields.title || fields.body)}
canSaveTemplate={!isReply && !isEdit && !!fields.body}

Fix in Claude Code

@feruzm feruzm merged commit 61f1f46 into development Jul 6, 2026
11 of 13 checks passed
@feruzm feruzm deleted the feature/template-translate-followups branch July 6, 2026 21:03
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