Skip to content

feat: Fragments content registration#39

Merged
lesleysin merged 1 commit into
v4from
fragments
Aug 10, 2025
Merged

feat: Fragments content registration#39
lesleysin merged 1 commit into
v4from
fragments

Conversation

@lesleysin

@lesleysin lesleysin commented Aug 9, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added support for registering and retrieving data fragments by key within the registry system. If a requested fragment is not found, a warning is displayed.

Added a new static method registerFragment for registering fragments by key and a method getFragment for receiving a fragment by key with logging in case of absence. Also added an internal registry of fragments _fragmentRegistry.
@lesleysin lesleysin self-assigned this Aug 9, 2025
@coderabbitai

coderabbitai Bot commented Aug 9, 2025

Copy link
Copy Markdown

Walkthrough

A private static map for fragments was added to the registry class, along with two new static methods: one for registering a fragment under a string key, and another for retrieving a fragment by key. If retrieval fails, a warning is logged and null is returned.

Changes

Cohort / File(s) Change Summary
Fragment Registry Extension
lib/src/registry_api/registry.dart
Added a private static fragment map and two static methods: registerFragment for storing, and getFragment for retrieving fragment data by key, including warning logging on missing keys.

Sequence Diagram(s)

sequenceDiagram
    participant Caller
    participant DuitRegistry

    Caller->>DuitRegistry: registerFragment(key, fragment)
    DuitRegistry-->>DuitRegistry: Store fragment in _fragmentRegistry[key]

    Caller->>DuitRegistry: getFragment(key)
    DuitRegistry-->>DuitRegistry: Lookup fragment in _fragmentRegistry
    alt Fragment found
        DuitRegistry-->>Caller: Return fragment
    else Fragment not found
        DuitRegistry-->>DuitRegistry: Log warning
        DuitRegistry-->>Caller: Return null
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~7 minutes

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4b4c4d1 and 47fd9b6.

📒 Files selected for processing (1)
  • lib/src/registry_api/registry.dart (2 hunks)

Comment thread lib/src/registry_api/registry.dart
Comment thread lib/src/registry_api/registry.dart
Comment thread lib/src/registry_api/registry.dart
@lesleysin
lesleysin merged commit 0c50fde into v4 Aug 10, 2025
5 checks passed
@lesleysin
lesleysin deleted the fragments branch August 10, 2025 08:42
lesleysin added a commit that referenced this pull request Nov 5, 2025
* breaking: DuitDataSource (#32)

* experiment - removing attribute support

* wip

* wip

* wip

* refacror ViewAttributes class

* Added  tests

* wip

* Added early exit from methods

* Added new functions for handling JSON parsing results, improved default result return logic, and added table mapping for BlendMode and FloatingActionButtonLocation.

* docs

* add tests

* Added tests

* Removed static mapping tables for Clip, TextAlign, TextOverflow and TextWidthBasis in the DuitDataSource class.

* Added new methods for JSON processing, including support for textDecorationStyle, fontWeight, fontStyle and other attributes. Improved logic for returning default values ​​and added corresponding tests.

* Added tests

* Removed unused methods and added new functions to handle theme rules and image filters. Updated tests to check new features and JSON processing logic.

* Upd .gitignore

* wip

* Upd tests, added Tween parser

* Removed ventilation methods, added new functions for widget handling. Updated tests to check new features and JSON handling logic.

* Refactored functions for creating InputBorder and ShapeBorder from a map, as well as corresponding lookup tables. Simplified logic for selecting the border type.

* Added docs

* upd actions config

* wip

* wip

* Update test/theme_test.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* clean dead code

* fix

* Update lib/src/view_attributes/lookup.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Added export of Command.dart file to action_api and removed it from animation_api. Updated data references in DuitDataSource class to use new "stretchModes" key. Fixes to tests to match changes in step data.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Remote commands API update (#33)

* breaking: Themes refactoring (#34)

* Registry API update: Added new RefWithTarget class, changed component initialization and registration functions, removed unused files, and improved export structure. Updated tests and removed deprecated topic tokens.

* upd workflow

* breaking: Reworking the widget model API and simplifying registration of custom widgets (#35)

* Removed unused factory_record.dart file and updated component registration logic in DuitRegistry class, removed references to model factories. Updated factory getter methods to match new changes.

* Small fix for tweens parser

* rm unused API part

* Update lib/src/registry_api/registry.dart

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* review fixes

* fix

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Improve lootup tables for enums (#36)

* Flutter types json encoding (#37)

* Added encoding functions for: Duration, Size, EdgeInsets, TextStyle, Color, LinearGradient, BoxShadow, Offset, BoxDecoration, BorderRadius, Border, BorderSide, InputBorder, InputDecoration, VisualDensity, ScrollPhysics, ShapeBorder

* wip

* Added tests

* Apply suggestions from code review

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Fix tests

* Added docs

* dart format

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* feat: action debounce and throttle configuration (#38)

* Added execution options for actions: added ExecutionOptions class with throttle and debounce modifiers, updated ServerAction classes and their descendants to support the new options. Updated parsing methods and added corresponding lookup tables for execution modifiers.

* - Added test
- Refactor DuitDataSource methods with one-line return and fail-fast approach at lookup tables work

* fix Color parsers behavior

* refactoring: improved color handling in _colorFromList function

Changed the typification function of the _colorFromList parameter from List<num> to List, added preprocessing of color data to ensure correct conversion. Updated the corresponding calls in the JSON parsing and processing methods in the DuitDataSource class.

* feat: Fragments registration in DuitRegistry (#39)

Added a new static method registerFragment for registering fragments by key and a method getFragment for receiving a fragment by key with logging in case of absence. Also added an internal registry of fragments _fragmentRegistry.

* Component system refactor (#40)

* Components refactoring via JSON patching instead of Map mutation

* Added tests for json patching and components patches generation

* Review fixes

* Upd lookup table for Curves

* Remover legacy API references

* feat: DuitDataSource methods extension (#41)

* Extend parser for BorderRadius type, added Radius type parsing, upd tests

* fix tests

* Added new Size parsing behavior

* wip

* feat: Custom json reviver (#42)

* Refactor env variables, refactor analysis issues in test files, added FlutterPropertyKeys class

* wip

* wip

* wip

* Fixed analysis issues

* wip

* Fixed getActionDependencies and childObjects methods

* Upd env variables keys

* Code review fixes

* Fix test

* Upd post-merge workflow
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