wedocs-plugin
wedocs-plugin copied to clipboard
enhance: doc nav block individual nav drop shadow
fixes: #233
Added shadow option for the doc navigations. Added WP default shadow and also custom shadow settings with horizontal and vertical offset, blur radius, spread radius, custom color, opacity, inset etc.
Summary by CodeRabbit
- New Features
- Added a Doc Navigation block with editor preview and rich styling controls (spacing, borders, shadow, typography, arrow styles) and optional rel prev/next for SEO.
- Style
- Added stepper component styles (horizontal/vertical), responsive Doc Navigation styling, and an uppercase text utility.
- Bug Fixes
- Improved reliability of previous/next doc detection.
- Chores
- Updated build assets, metadata, and client-side data wiring for docs/settings to improve loading and editor behavior.
Walkthrough
Adds a new Doc Navigation Gutenberg block (editor UI, block metadata, styles, SSR PHP renderer and registration), a PHP helper for doc prev/next navigation, a compiled data store for docs/settings, webpack runtime additions in built JS, CSS source-map/banner updates, and several updated asset fingerprints and dependencies (adds wp-data).
Changes
| Cohort / File(s) | Change summary |
|---|---|
Block: DocNavigation (source & built)src/blocks/DocNavigation/*, assets/build/blocks/DocNavigation/*, src/blocks/index.js |
New block: metadata (block.json), editor edit component, save (returns null), server-side render (PHP), styles (SCSS/CSS), built equivalents and registration import. |
PHP: registration & render wiringwedocs.php, assets/build/blocks/DocNavigation/render.php, src/blocks/DocNavigation/render.php |
Registers block and adds render_wedocs_doc_navigation server renderer (built and src versions). |
PHP: navigation helper & refactorincludes/functions.php |
Adds wedocs_get_doc_navigation_posts($post) and refactors wedocs_doc_nav() to use returned post objects for prev/next navigation. |
Data layer (source & built)src/data/*, assets/build/store.js, assets/build/store.asset.php |
Adds full docs and settings data stores (actions, controls, reducers, resolvers, selectors, store wiring) in src and a compiled store bundle; asset fingerprint updated. |
Built JS runtime additionsassets/build/frontend.js, assets/build/print.js |
Injects webpack runtime helpers (e.g., __webpack_require__.r) and module bootstrap code; CSS module entries and source map references added. |
CSS updates (built + source)src/blocks/DocNavigation/style.scss, assets/build/index.css, assets/build/frontend.css, assets/build/print.css |
Adds doc navigation styles (responsive layout, arrows, transitions), stepper UI rules and uppercase utility in index.css, and loader/banner + sourceMap refs in built CSS files. |
Asset metadata & deps bumpedassets/build/block.asset.php, assets/build/index.asset.php, assets/build/frontend.asset.php, assets/build/print.asset.php, assets/build/store.asset.php |
Updated version hashes; assets/build/block.asset.php dependency list now includes wp-data; other deps unchanged. |
Estimated code review effort
🎯 4 (Complex) | ⏱️ ~60 minutes
Possibly related PRs
- weDevsOfficial/wedocs-plugin#209 — Modifies the plugin data layer for settings; likely related to the new src/data/settings/store and built store bundle.
Suggested labels
Needs Review
Suggested reviewers
- iftakharul-islam
Poem
I hop between docs, left then right,
Arrows point where answers light.
Each box gets its shadow, snug and neat,
The gap stays clear between my feet.
Prev and Next—my trail is bright. 🐇✨
Pre-merge checks and finishing touches
❌ Failed checks (2 warnings)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Out of Scope Changes Check | ⚠️ Warning | In addition to the drop shadow enhancement, this pull request introduces a complete Redux-like data layer for docs and settings, stepper UI styling in index.css, numerous unrelated asset build metadata updates, and global webpack runtime injections that are not related to issue #233’s focus on drop shadow behavior. | Please remove or isolate changes unrelated to the drop shadow enhancement—such as the new data store modules, stepper UI styles, and other asset build updates—or split them into separate pull requests so this one remains focused on issue #233. |
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title Check | ✅ Passed | The pull request title accurately describes the enhancement to the Doc Navigation block’s drop shadow behavior by specifying that shadows should apply to individual navigation items rather than across the entire block. |
| Linked Issues Check | ✅ Passed | The render function now computes and applies inline shadow styles separately for the “previous” and “next” navigation blocks using the navShadow and custom shadow attributes, leaving the space between blocks unchanged and fulfilling the objectives of issue #233. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
📜 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 e52c4075d73c5a3c54bd379d243dfaeea6cd8836 and 6fea737644c5f8c869cde74f4337332e8804a6f6.
📒 Files selected for processing (2)
assets/build/index.css(7 hunks)wedocs.php(2 hunks)
🧰 Additional context used
🪛 Biome (2.1.2)
assets/build/index.css
[error] 2206-2206: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.
grid-template-columns is already defined here.
Remove or rename the duplicate property to ensure consistent styling.
(lint/suspicious/noDuplicateProperties)
[error] 6188-6188: Unexpected value or character.
Expected one of:
(parse)
[error] 6188-6188: Unexpected value or character.
Expected one of:
(parse)
[error] 6188-6188: Unexpected value or character.
Expected one of:
(parse)
[error] 6188-6188: Unexpected value or character.
Expected one of:
(parse)
[error] 6188-6188: Unexpected value or character.
Expected one of:
(parse)
[error] 6188-6188: Unexpected shorthand property flex-flow after flex-direction
(lint/suspicious/noShorthandPropertyOverrides)
[error] 6188-6188: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.
display is already defined here.
Remove or rename the duplicate property to ensure consistent styling.
(lint/suspicious/noDuplicateProperties)
[error] 6188-6188: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.
display is already defined here.
Remove or rename the duplicate property to ensure consistent styling.
(lint/suspicious/noDuplicateProperties)
[error] 6188-6188: Duplicate properties can lead to unexpected behavior and may override previous declarations unintentionally.
transition is already defined here.
Remove or rename the duplicate property to ensure consistent styling.
(lint/suspicious/noDuplicateProperties)
🔇 Additional comments (2)
wedocs.php (2)
187-193: LGTM!The block registration follows the established pattern and is implemented consistently with the DocsGrid block. The render callback is properly configured to enable server-side rendering for the DocNavigation block.
50-50: Confirmed DocNavigation render file and callback. render.php exists, defines render_wedocs_doc_navigation, and block.json is present.
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 @coderabbitai help to get the list of available commands and usage tips.
Please resolve conflict of the pr @sapayth vai