Skip to content

feat: add runtime book content addition api#360

Merged
klikli-dev merged 1 commit into
version/26.1.2from
feat/runtime-additions
May 24, 2026
Merged

feat: add runtime book content addition api#360
klikli-dev merged 1 commit into
version/26.1.2from
feat/runtime-additions

Conversation

@klikli-dev
Copy link
Copy Markdown
Owner

No description provided.

@klikli-dev klikli-dev merged commit 8cce233 into version/26.1.2 May 24, 2026
@klikli-dev klikli-dev deleted the feat/runtime-additions branch May 24, 2026 18:40
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new Runtime Content API for Modonomicon, allowing developers to programmatically add categories, entries, and pages to existing books at runtime. The implementation features a fluent batch API for queuing operations, a manager to handle validation and application of these changes, and updates to the BookDataManager to support partial book rebuilding and network synchronization. Feedback was provided regarding a redundant loop in the RuntimeBookContentManager where entries are manually re-added to a category that should already contain them following the cloning process.

Comment on lines +167 to +169
for (var entry : addCategory.entries()) {
addCategory.category().addEntry(entry);
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This loop appears to be redundant. The addCategory.category() object is a clone of the original category, created via serialization and deserialization in cloneCategory. The deserialization process (BookCategory.fromNetwork) should fully reconstruct the category object, including its internal list of entries. Therefore, the category should already contain these entries, and iterating through addCategory.entries() to add them again is unnecessary.

Removing this loop would make the code cleaner and avoid potential side effects if the addEntry method's logic were to change in the future.

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.

1 participant