Skip to content

Files: saving as Outline/RTF keeps every paragraph of a slide title - #1319

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
marcoarnulfo:fix/rtf-title-lines
Oct 25, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
marcoarnulfo:fix/rtf-title-lines

Conversation

@marcoarnulfo

@marcoarnulfo marcoarnulfo commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #1318.

slides_to_rtf wrote only the first non-empty paragraph of a slide title, so the rest of a two-paragraph title was lost in the Outline/RTF file. It now writes every non-empty title paragraph, keeping their bold/italic/underline runs, joined with \line inside the one level-0 paragraph: a \par would make each line a slide of its own when the file is opened again. Read back, \line becomes a space, so the RTF reopens to the same outline the plain-text export writes ("First line Second line"). I could not check what PowerPoint itself writes for a multi-paragraph title in its Outline/RTF export; \line is the one join that keeps the title a single outline entry on re-import.

Validation:

  • rtf::tests::every_title_paragraph_is_exported: fails on main (the RTF has only First line\b0\par), passes here
  • cargo test --workspace --lib -- rtf:: (deckcraft-format: 6 passed)
  • cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --all -- --check
  • (macOS, Apple silicon)

Summary by CodeRabbit

  • Bug Fixes
    • RTF exports now preserve all non-empty title paragraphs together in the slide outline, with each paragraph on a separate line.
    • Slides without non-empty title paragraphs continue to use the slide title as a fallback.

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 38d2ade and 9e9e13f.

Files selected for processing: 1
  • crates/format/src/rtf.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.

Walkthrough

RTF export now writes all non-empty title paragraphs in a single outline paragraph, separated by \line. If no non-empty title paragraphs exist, export uses the slide title fallback. A regression test checks that multiple title paragraphs round-trip.

Changes: RTF title export

Layer / File(s) Summary
Export and verify title paragraphs
crates/format/src/rtf.rs
slides_to_rtf writes all non-empty title paragraphs in one outline paragraph, separated by \line, and retains the slide-title fallback. The regression test checks the separators and round-trip outline.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Possibly related PRs

Suggested reviewers: nikitkara

Merge Risk: Minimal · up to 9e9e1

The RTF title export change is ready to merge with no concrete blocking risk identified.

Architecture risk: Medium · up to 9e9e1

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/format/src/rtf.rs: slides_to_rtf replaces selecting only the first non-empty title paragraph with iteration over all non-empty title paragraphs, separated by \line; it retains the slide-title fallback when none are present.
  • observed — Modified behavior in crates/format/src/rtf.rs: Adds a test that appends a second title paragraph and checks that export separates both title paragraphs with \line while the imported outline matches the presentation outline.

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_2; direct_dependents_2
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files. 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 clearly and concisely describes the main change: preserving every slide-title paragraph when saving as Outline/RTF.
Linked Issues check Passed Issue #1318 requires all title paragraphs to remain in one Outline/RTF paragraph. The change iterates over every non-empty title paragraph, preserves each paragraph's runs through runs, and inserts …
Out of Scope Changes check Passed The changes are limited to crates/format/src/rtf.rs. The implementation directly fixes issue #1318, and the added test verifies the required export and round-trip behavior. No unrelated change is sh…
Full details: Linked Issues check

Explanation

Issue #1318 requires all title paragraphs to remain in one Outline/RTF paragraph. The change iterates over every non-empty title paragraph, preserves each paragraph's runs through runs, and inserts \\line instead of \\par. The regression test verifies both title lines and the outline round trip.

Full details: Out of Scope Changes check

Explanation

The changes are limited to crates/format/src/rtf.rs. The implementation directly fixes issue #1318, and the added test verifies the required export and round-trip behavior. No unrelated change is shown.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 90f7239 into storytold:main Oct 25, 2026
3 checks passed
@echelon

echelon commented Oct 25, 2026

Copy link
Copy Markdown
Member

Landed on main — thank you for the contribution! If you haven't already, come join us on Discord: https://discord.gg/artcraft

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.

Files: saving as Outline/RTF drops every title paragraph after the first

3 participants