Skip to content

Conversation

@kaeizen
Copy link
Contributor

@kaeizen kaeizen commented Nov 17, 2025

Summary by CodeRabbit

  • New Features
    • Added scroll top offset configuration for the table of contents block with responsive settings support, enabling flexible spacing adjustments across different screen sizes.

@coderabbitai
Copy link

coderabbitai bot commented Nov 17, 2025

Walkthrough

A new scrollTopOffset attribute is added to the table-of-contents block schema as a responsive, configurable number property. The method for registering its corresponding style is changed from singular addBlockStyle to plural addBlockStyles in the style registration file.

Changes

Cohort / File(s) Summary
Table-of-Contents Attribute Configuration
src/block/table-of-contents/schema.js
New attribute scrollTopOffset added with type number, responsive support, and version 3.19.3 metadata
Table-of-Contents Style Registration
src/block/table-of-contents/style.js
API method for style registration updated from addBlockStyle to addBlockStyles for the scrollTopOffset style group

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

  • Review consistency between schema attribute definition and style registration method
  • Verify addBlockStyles API supports the same style object structure as addBlockStyle
  • Confirm scrollTopOffset naming is consistent across both files

Poem

🐰 A scroll offset joins the scheme,
Responsive, numbered, lean and clean,
Style methods shift from one to many,
One small change, no fuss or any—
The table of contents now scrolls serene! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix (Table of Contents): scroll top offset' directly corresponds to the changes made in the pull request, which add and configure a new scrollTopOffset attribute for the table-of-contents block.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/table-of-contents-scrolltop-offset

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9338467 and a7f1551.

📒 Files selected for processing (2)
  • src/block/table-of-contents/schema.js (1 hunks)
  • src/block/table-of-contents/style.js (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (7)
  • GitHub Check: PHP 8.2 and WP latest
  • GitHub Check: PHP 8.2 and WP 6.7.2
  • GitHub Check: PHP 8.2 and WP 6.5.5
  • GitHub Check: PHP 7.3 and WP 6.5.5
  • GitHub Check: PHP 8.2 and WP 6.6.2
  • GitHub Check: PHP 7.3 and WP latest
  • GitHub Check: build
🔇 Additional comments (2)
src/block/table-of-contents/style.js (1)

124-131: LGTM! Consistent API usage.

The change from addBlockStyle (singular) to addBlockStyles (plural) correctly aligns with all other style registrations in this file. The style configuration properly applies scroll-padding-top to the html element with responsive support and pixel formatting.

src/block/table-of-contents/schema.js (1)

151-161: LGTM! Attribute properly configured.

The new scrollTopOffset attribute is correctly structured with responsive support (stkResponsive: true) that matches the style configuration in style.js. The use of an empty string default for a number type, while unconventional, is consistent with other responsive number attributes in this file (e.g., columns, columnGap, iconGap, rowGap).


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 and usage tips.

@kaeizen kaeizen self-assigned this Nov 17, 2025
@github-actions
Copy link

🤖 Pull request artifacts

file commit
pr3640-stackable-3640-merge.zip a7f1551

github-actions bot added a commit that referenced this pull request Nov 17, 2025
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.

2 participants