Group a slide's entrance with its own heading in the Table of Contents - #273
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. 📝 WalkthroughWalkthroughThe TOC generator recursively detects when an action opens with a title and moves that title before the action. Merge Risk: ⚪ Minimal · up to The TOC update groups each slide entrance pause with its own heading. No current merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) 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 |
panglesd
left a comment
There was a problem hiding this comment.
Good hoisting, thanks! There is something to fix though.
You can add a changelog entry!
| title. Hoist such a title above the action that contains it, so a slide's | ||
| entrance is grouped with its own heading. *) | ||
| let rec hoist_contained_titles = function | ||
| | (`Action a as action) :: `Title t :: rest when Brr.El.contains a ~child:t -> |
There was a problem hiding this comment.
I think the when clause should be:
When the first child of
aist
Otherwise:
{pause}
> Blablabla
>
> Something something
>
> # First title but after some content
would put the pause after the title!
There was a problem hiding this comment.
Ah yes! I didn't think of this case :-)
3fdad8e to
e5a8751
Compare
panglesd
left a comment
There was a problem hiding this comment.
Sorry, I still have some changes! If you prefer, I can take over the PR, just let me know.
A changelog entry is missing too!
| heading is nested under .slip/.slip-body, hence the walk down first children. *) | ||
| let same el el' = Jv.equal (Brr.El.to_jv el) (Brr.El.to_jv el') in | ||
| let rec opens_with a ~title = | ||
| match Brr.El.children ~only_els:true a with |
There was a problem hiding this comment.
Why ~only_els:true? Is it to avoid whitespace text elements?
Because I also would prefer not having a hoist in the following case:
<div pause>Some text<h1>title</h1></div>
even though title is the first child element...
There was a problem hiding this comment.
Right, what about something like:
let blank el =
Brr.El.is_txt el && Jstr.is_empty (Jstr.trim (Brr.El.txt_text el))
in
let rec opens_with a ~title =
match List.filter (Fun.negate blank) (Brr.El.children a) with
?
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Team
Run ID: 90247ba0-355e-42fc-86d7-ee6fb473fd3f
📒 Files selected for processing (1)
src/engine/runtime/table_of_content/table_of_content.ml
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
Co-authored-by: Paul-Elliot Anglès d'Auriac <peada@free.fr>
a632dea to
2ce80a7
Compare
|
Thanks for the suggestions! There's a lot of edge cases here :-) I think the current diff exhibits the correct behaviour for this file: |
|
Thanks a lot! I pushed an ocamlformatting, wait a bit for CI and merge. |
This slipshow file reproduces the issue:
Previously the
#secondpause was listed under the 'First' section in the ToC. Now it's the first entry under the 'Second' section in the ToC.This was programmed with claude code.