Template creation on mobile and translate table-detection parity#3328
Conversation
|
Warning Review limit reached
Next review available in: 1 minute Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (9)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Greptile SummaryThis PR adds mobile template creation and tightens markdown table detection. The main changes are:
Confidence Score: 4/5This is close, but the template save gate should be fixed before merging.
src/screens/editor/screen/editorScreen.tsx Important Files Changed
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; |
There was a problem hiding this comment.
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.
| handleScheduleChange={this._handleScheduleChange} | ||
| handleShouldReblogChange={handleShouldReblogChange} | ||
| handleFormUpdate={this._handleFormUpdate} | ||
| canSaveTemplate={!isReply && !isEdit && !!(fields.title || fields.body)} |
There was a problem hiding this comment.
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.
| canSaveTemplate={!isReply && !isEdit && !!(fields.title || fields.body)} | |
| canSaveTemplate={!isReply && !isEdit && !!fields.body} |
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.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.