fix(Editor): guard calls for unavailable list extensions by dropdead619 ยท Pull Request #6100 ยท nuxt/ui

No actionable comments were generated in the recent review. ๐ŸŽ‰

โ„น๏ธ Recent review info

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

๐Ÿ“ฅ Commits

Reviewing files that changed from the base of the PR and between 05e5bd5 and 06a9d84.

๐Ÿ“’ Files selected for processing (1)
  • src/runtime/utils/editor.ts

๐Ÿ“ Walkthrough

Walkthrough

This change refactors list type handling in the editor utility to support runtime detection of available list extensions rather than relying on hard-coded assumptions. Two new helper functions are introduced: getAvailableListTypes(editor) to identify active list extensions and liftFromLists(chain, editor) to sequentially unwrap available list wrappers. The canExecute check, list unwrapping logic, and list type conversion now use these runtime checks to determine which list node types are available, replacing compile-time references to bulletList, orderedList, and taskList.

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~20 minutes

๐Ÿšฅ Pre-merge checks | โœ… 4 | โŒ 1

โŒ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage โš ๏ธ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
โœ… Passed checks (4 passed)
Check name Status Explanation
Title check โœ… Passed The title clearly describes the main change: guarding lift() calls for unavailable list extensions to prevent runtime errors.
Description check โœ… Passed The description is directly related to the changeset, explaining the bug, root cause (taskList extension not always present), and the solution implemented.
Linked Issues check โœ… Passed The PR successfully addresses issue #6099 by implementing dynamic list type handling that prevents errors when taskList or other extensions are unavailable.
Out of Scope Changes check โœ… Passed All changes in editor.ts are focused on fixing the list type handling issue described in #6099; no out-of-scope changes detected.

โœ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.

โœจ Finishing Touches
  • ๐Ÿ“ Generate docstrings (stacked PR)
  • ๐Ÿ“ Generate docstrings (commit on current branch)
๐Ÿงช Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.