Skip to content

feat(ui): autocomplete binding user state - WF-542 - #950

Merged
madeindjs merged 3 commits into
devfrom
WF-543-3
Jun 19, 2025
Merged

feat(ui): autocomplete binding user state - WF-542#950
madeindjs merged 3 commits into
devfrom
WF-543-3

Conversation

@madeindjs

@madeindjs madeindjs commented Jun 19, 2025

Copy link
Copy Markdown
Collaborator
Screen.Recording.2025-06-19.at.10.19.51.mov

Summary by CodeRabbit

  • New Features

    • Enhanced autocomplete functionality to support deep traversal of nested state objects, providing more comprehensive and organized suggestions.
    • Autocomplete options are now sorted alphabetically and display dot-separated paths for nested keys.
  • Refactor

    • Switched from a single user state source to a combined approach, merging both static and binding-based user states for improved flexibility.
    • Updated the naming and structure of user state hooks for clarity and modularity.
  • Tests

    • Introduced a new test suite for dynamic user state handling.
    • Removed the previous test suite for the old user state implementation.
  • Chores

    • Cleaned up unused imports and improved type definitions for better maintainability.
  • Bug Fixes

    • Updated end-to-end test expectations to reflect the new ordering and grouping of autocomplete suggestion types.

When the user use Binding, we include it in the "user state"
that is proposed as completetion in some fields
@madeindjs madeindjs self-assigned this Jun 19, 2025
@coderabbitai

coderabbitai Bot commented Jun 19, 2025

Copy link
Copy Markdown
Contributor

Walkthrough

The changes refactor the user state logic in the builder UI, replacing useBlueprintUserState with useDynamicUserState, which now returns both blueprint-derived and binding-derived user states. Autocomplete logic is updated to use these new sources and recursively gather options. Associated tests are updated, with tests for the new hook added and the old ones removed.

Changes

File(s) Change Summary
src/ui/src/builder/BuilderTree.vue Simplified import statement by removing unused imports.
src/ui/src/builder/settings/BuilderTemplateInput.vue Switched from useBlueprintUserState to useDynamicUserState; updated autocomplete logic to use both blueprint and binding states, with recursive option extraction and explicit typing.
src/ui/src/builder/useBlueprintUserState.spec.ts Removed test suite for useBlueprintUserState.
src/ui/src/builder/useDynamicUserState.ts Renamed and refactored composable to useDynamicUserState, now returning both blueprint and binding user states; internal logic modularized.
src/ui/src/builder/useDynamicUserState.spec.ts Added new test suite for useDynamicUserState, covering blueprint and binding state extraction, error handling, and security checks.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant BuilderTemplateInput
    participant useDynamicUserState
    participant Core

    User->>BuilderTemplateInput: Types @ for autocomplete
    BuilderTemplateInput->>useDynamicUserState: Request user state
    useDynamicUserState->>Core: Fetch components
    useDynamicUserState-->>BuilderTemplateInput: Return {blueprintsUserState, bindingsUserState}
    BuilderTemplateInput->>BuilderTemplateInput: Merge states, recursively extract autocomplete options
    BuilderTemplateInput-->>User: Show autocomplete suggestions
Loading

Assessment against linked issues

Objective Addressed Explanation
All variables defined in an Agent can be fetched when you type @ (WF-542)
Persist current page for Blueprints and UI (WF-543) No code related to page persistence is present in these changes.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Simplified import statement in BuilderTree.vue (src/ui/src/builder/BuilderTree.vue) This is a minor cleanup and not related to user state or autocomplete objectives in WF-542.

Possibly related PRs

Poem

In burrows deep, the state did hide,
But now with paws and whiskers wide,
I fetch each variable, near and far—
For autocomplete, just type "@"!
With blueprints, bindings, all in view,
The builder bunny hops anew.
🐇✨


📜 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 a5ff71a and 55bae75.

📒 Files selected for processing (2)
  • src/ui/src/builder/settings/BuilderTemplateInput.vue (4 hunks)
  • tests/e2e/tests/stateAutocompletion.spec.ts (4 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (21)
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.12)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.10)
  • GitHub Check: build (3.10)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.12)
  • GitHub Check: tests
  • GitHub Check: build (3.12)
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.10)
  • GitHub Check: tests (webkit)
  • GitHub Check: tests (chromium)
  • GitHub Check: Analyze (javascript-typescript)
  • GitHub Check: Analyze (actions)
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
tests/e2e/tests/stateAutocompletion.spec.ts (1)

58-58: Test expectations correctly updated to reflect new autocomplete ordering.

The test assertions have been properly updated to match the new alphabetically sorted autocomplete suggestions from the recursive traversal implementation. The expected values ["float", "integer", "none", "string"] with types ["number", "number", "null", "string"] align with the refactored autocomplete logic.

Also applies to: 63-63, 126-126, 129-129, 147-147, 150-150, 169-169, 172-172

src/ui/src/builder/settings/BuilderTemplateInput.vue (4)

93-93: Refactoring to dynamic user state looks good.

The transition from useBlueprintUserState to useDynamicUserState with separate blueprintsUserState and bindingsUserState properly supports the new autocomplete functionality that includes binding-derived state.

Also applies to: 132-132


129-130: Good addition of explicit type definition.

Adding the explicit AutocompleteOption type improves code clarity and type safety for the autocomplete functionality.


278-280: Alphabetical sorting improves user experience.

The addition of alphabetical sorting for autocomplete options provides a better, more predictable user experience compared to the previous unordered approach.


234-235: ```shell
#!/bin/bash

Description: Re-run search for blueprint and binding state usages, including .vue files via glob patterns

rg -A 3 -B 3 "blueprintsUserState" -g '.vue' -g '.ts' -g '.js'
rg -A 3 -B 3 "bindingsUserState" -g '
.vue' -g '.ts' -g '.js'


</details>

</blockquote></details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAMxJqAApseABKLjQ8fCZmbkiaSDUMWngMIkhsREp7XGoPKAB1ADEwAFYAFgAmaMgAdzRkBwFmdRp6OTDYD0rq5jQlUtohZAHrOwxHAWqATlaABg0YKcglRAYKeG5xfCxShi9sU/RIAFUbABlIL1KAazD8dBYAZVUKwfCIMb8LAAcXUAAlsAIADSFPCQDAA+Yla4YNC+GgAD1w2D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JLmjxPo0QVlPQJVHgETQCPQIoFwWwhQ+8NGKIp6eMuam8fYtA1Bik0QAA0gYmAJ7plfE9IKKEkxrHQRCWMRJqqJIxqgqPSVyKglhtzk0FvLQDLhvFMF4BGi+eKLXlsRyL4PQ5LHjP7k9UfCZMoRUKGOgyyhFFRTPYI3PZOAXBVJSdfS/cUjIz2GvSJD2EvK45jU1YWYsjnisvzRKhWVssLaXrWYcsdBLedGclAE1M457IqOuaLeXuLScvIDcyWaNGyBNNjHDqgBfXuZeshO+HXiXb+KtXzkBOwCBGgGBPeaEtBI+GoPBK+EhAYHC6eOoHTtyIgHTv4FyKAXQHTmmLjBuIS1uOgK0KdgAOx8JoBoDsutCsudCdAMAABstAnQ7QfCsQnQfCArewrQaA2wAAHGgAAMx7ACLtDSt8IkB7CISGBwutCtD8EkCsutDOisskDtCxB8LbCSuKvitysCCdCKusumvbDtCKuuvbAJCstyuKtyvtDasoRQDEu4Cks5MUsViGS+S0B047jatAA=== -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

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.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=writer/writer-framework&utm_content=950):

- 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.`
  -	`@coderabbitai modularize this function.`
- 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.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### 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 docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/ui/src/builder/useDynamicUserState.ts (1)

34-46: Consider making the placeholder value configurable.

The hardcoded "unknown value" might not be suitable for all contexts. Consider making this configurable or using a more descriptive placeholder that indicates the binding's expected type.

-function getBindingsUserState(wf: Core): UserState {
+function getBindingsUserState(wf: Core, placeholder = "unknown value"): UserState {
 	const state: UserState = {};

 	for (const rootId of COMPONENT_TYPES_ROOT) {
 		for (const component of wf.getComponentsNested(rootId)) {
 			if (component.binding?.stateRef) {
-				set(state, component.binding?.stateRef, "unknown value");
+				set(state, component.binding?.stateRef, placeholder);
 			}
 		}
 	}

 	return state;
 }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 96e8665 and a5ff71a.

📒 Files selected for processing (5)
  • src/ui/src/builder/BuilderTree.vue (1 hunks)
  • src/ui/src/builder/settings/BuilderTemplateInput.vue (4 hunks)
  • src/ui/src/builder/useBlueprintUserState.spec.ts (0 hunks)
  • src/ui/src/builder/useDynamicUserState.spec.ts (1 hunks)
  • src/ui/src/builder/useDynamicUserState.ts (1 hunks)
💤 Files with no reviewable changes (1)
  • src/ui/src/builder/useBlueprintUserState.spec.ts
⏰ Context from checks skipped due to timeout of 90000ms (21)
  • GitHub Check: build (3.12)
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.10)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.10)
  • GitHub Check: tests
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.12)
  • GitHub Check: tests (chromium)
  • GitHub Check: tests (webkit)
  • GitHub Check: tests (firefox)
  • GitHub Check: build (3.13)
  • GitHub Check: build (3.9)
  • GitHub Check: build (3.11)
  • GitHub Check: build (3.12)
  • GitHub Check: build (3.10)
  • GitHub Check: Analyze (python)
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (7)
src/ui/src/builder/BuilderTree.vue (1)

70-70: LGTM! Good cleanup of unused imports.

Removing unused imports improves maintainability and reduces bundle size.

src/ui/src/builder/useDynamicUserState.ts (2)

12-32: LGTM! Well-structured refactoring with proper error handling.

The refactoring successfully splits user state into two distinct sources with proper error isolation. Each computed state has its own try-catch block, ensuring one failure doesn't affect the other.


51-59: Good naming improvement.

Renaming getSetStateNode to getSetStateContent better reflects the function's purpose of yielding content from setstate components.

src/ui/src/builder/useDynamicUserState.spec.ts (1)

1-190: Excellent comprehensive test coverage.

The test suite thoroughly covers:

  • Both binding and blueprint user state scenarios
  • Edge cases like malformed JSON and missing bindings
  • Security concerns (prototype pollution prevention)
  • Complex scenarios like merging and nested keys

The test structure is clean and assertions are precise.

src/ui/src/builder/settings/BuilderTemplateInput.vue (3)

93-93: LGTM! Proper integration with the refactored composable.

The import change correctly adopts the new useDynamicUserState hook.


129-142: Consider the state merge precedence carefully.

The current merge order prioritizes runtime state > blueprints > bindings. Verify this precedence aligns with your intended behavior, as bindings might represent more current user intentions than static blueprints.

The merge order affects which values take precedence when the same keys exist across different state sources. Consider whether bindings should have higher or lower priority than blueprints in your use case.


274-276: Good integration with existing search logic.

The autocomplete computation properly generates options and maintains compatibility with the existing Fuse.js search functionality. The alphabetical sorting ensures consistent user experience.

Comment thread src/ui/src/builder/settings/BuilderTemplateInput.vue

@hackerone-code hackerone-code 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.

🔍 This pull request has been sent to HackerOne's PullRequest review team because our automation detected one or more changes with potential security impact or requires further evaluation. Experts are now being assigned to this review based on relevant expertise and will validate or dismiss any security findings accordingly and post their feedback as comments within this pull request.

⏱️ Latest scan covered changes up to commit a5ff71a (latest)


Check the status or cancel this secure code review here.

@hackerone-code hackerone-code 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.

✅ Graham C reviewed all the included code changes and associated automation findings and determined that there were no immediately actionable security flaws. Note that they will continue to be notified of any new commits or comments and follow up as needed throughout the duration of this pull request's lifecycle.

Image of Graham C Graham C


Reviewed with ❤️ by PullRequest

@madeindjs
madeindjs merged commit 3945ed6 into dev Jun 19, 2025
25 checks passed
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