Skip to content

Update strategy naming to be order#2004

Merged
findolor merged 9 commits intomainfrom
2025-07-17-renaming
Jul 25, 2025
Merged

Update strategy naming to be order#2004
findolor merged 9 commits intomainfrom
2025-07-17-renaming

Conversation

@findolor
Copy link
Copy Markdown
Collaborator

@findolor findolor commented Jul 17, 2025

Caution

Do not merge before rainlanguage/rain.strategies#55

Motivation

See issue: #1372

Solution

Checks

By submitting this for review, I'm confirming I've done the following:

  • made this PR as small as possible
  • unit-tested any new functionality
  • linked any relevant issues or PRs
  • included screenshots (if this involves a front-end change)

fix #1372

Summary by CodeRabbit

  • New Features

    • Introduced new components and test files for handling and displaying invalid and valid orders.
    • Added a new page for viewing individual orders in the deployment flow.
  • Refactor

    • Replaced all user-facing terminology from "strategy" to "order" or "algorithm" across the UI, documentation, and tests.
    • Renamed component props, exported variables, and types to use "order" instead of "strategy".
    • Updated service and validation logic to operate on orders rather than strategies.
  • Bug Fixes

    • Corrected prop and parameter names in tests and components to ensure consistency with new "order" terminology.
  • Documentation

    • Updated all documentation, comments, and example code to reflect the new terminology.
  • Chores

    • Removed obsolete components and tests related to "strategy" and replaced them with "order" equivalents.
  • Tests

    • Added and updated test suites to validate new "order"-based components and logic.

@findolor findolor self-assigned this Jul 17, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jul 17, 2025

Walkthrough

This change refactors the codebase to consistently use "order" instead of "strategy" throughout components, types, tests, documentation, and user-facing text. It renames variables, props, types, exported entities, and updates UI labels and test assertions accordingly. Several new components and tests are added for "order" terminology, while obsolete "strategy" components and tests are removed. No core logic or control flow is altered.

Changes

File(s) / Group Change Summary
.../DeploymentSteps.test.ts, .../InputRegistryUrl.test.ts, .../DeploymentTile.test.ts, ... Updated test props, labels, and assertions from "strategy" to "order"; replaced variable names accordingly.
.../DeploymentsSection.test.ts, .../OrderPage.test.ts, .../registry.test.ts Updated test suites: renamed props, mocks, and assertions from "strategy" to "order".
.../InvalidOrdersSection.test.ts, .../ValidOrdersSection.test.ts Added new test files for InvalidOrdersSection and ValidOrdersSection components.
.../InvalidStrategiesSection.test.ts, .../ValidStrategiesSection.test.ts Removed obsolete test files for InvalidStrategiesSection and ValidStrategiesSection.
.../DeploymentSteps.svelte, .../DeploymentTile.svelte, .../DeploymentsSection.svelte Renamed exported props and internal references from "strategy" to "order".
.../InvalidOrdersSection.svelte, .../ValidOrdersSection.svelte Added/refactored components to use "order" types and props.
.../OrderPage.svelte Refactored component and exported props from "strategy" to "order"; updated function and variable names.
.../DisclaimerModal.svelte, .../Homepage.svelte, .../CustomRegistryWarning.svelte Updated displayed text to use "order" instead of "strategy".
.../InputRegistryUrl.svelte Changed input id and placeholder from "strategy" to "order".
.../DeploymentStepsError.ts Updated enum string value from "No valid strategy..." to "No valid order...".
.../transactions/TransactionManager.ts Updated JSDoc comment to reference "order" instead of "strategy".
.../lib/index.ts Changed exported component/type names and import paths from "strategy" to "order".
.../lib/types/order.ts Renamed type aliases from Valid/InvalidStrategyDetail to Valid/InvalidOrderDetail.
.../lib/services/registry.ts, .../lib/services/index.ts Renamed validation function, types, and variables from "strategy" to "order".
.../lib/mocks/stores.ts, .../test-setup.ts Updated mock property names and mock method names from "strategy" to "order".
.../src/raindex_client/orders.rs, .../src/raindex_client/vaults.rs Updated doc comments to use "algorithm" or "order" instead of "strategy".
.../src/gui/mod.rs, .../src/gui/select_tokens.rs, .../src/gui/state_management.rs Renamed methods, documentation, and test data from "strategy" to "order".
.../src/settings/src/config_source.rs, .../src/settings/src/gui.rs, .../src/settings/src/yaml/... Renamed doc/test method and description from "strategy" to "order".
.../README.md Updated documentation and examples from "strategy" to "order"/"algorithm".
.../test/js_api/gui.test.ts Updated test descriptions, YAML, and assertions from "strategy" to "order".
.../src/lib/constants.ts Updated REGISTRY_URL constant to new commit hash.
.../src/routes/deploy/+layout.ts, .../src/routes/deploy/+page.svelte Refactored all data, types, and UI from "strategy" to "order".
.../src/routes/deploy/[orderName]/+layout.ts, .../src/routes/deploy/[orderName]/layout.test.ts Renamed variables, keys, and test data from "strategy" to "order".
.../src/routes/deploy/[orderName]/+page.svelte Added new page component rendering OrderPage with order props.
.../src/routes/deploy/[orderName]/[deploymentKey]/+page.svelte, .../fullDeployment.test.ts Updated prop names, variables, and test text from "strategy" to "order".
.../src/routes/deploy/[orderName]/[deploymentKey]/layout.test.ts, .../page.test.ts Updated test parameters, props, and URLs from "strategy" to "order".
.../src/routes/deploy/[strategyName]/+page.svelte, .../InvalidStrategiesSection.svelte Deleted obsolete components/pages for "strategy".
.../src/lib/mocks/stores.ts Updated mock property from strategyDetail to orderDetail.
.../tauri-app/src/lib/stores/walletconnect.ts, .../routes/+page.svelte, .../routes/page.test.ts Updated description text and test assertions from "strategy" to "order".

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UIComponent
    participant OrderService
    participant DotrainOrderGui

    User->>UIComponent: Initiate order deployment/view
    UIComponent->>OrderService: validateOrders(registryDotrains)
    OrderService->>DotrainOrderGui: getOrderDetails(dotrain)
    DotrainOrderGui-->>OrderService: order details / error
    OrderService-->>UIComponent: { validOrders, invalidOrders }
    UIComponent->>User: Render order tiles, errors, deployment UI
    User->>UIComponent: Click "Deploy Order"
    UIComponent->>OrderService: Create and deploy order transaction
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

webapp

Suggested reviewers

  • hardyjosh

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-07-25T07_50_15_223Z-debug-0.log

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between d99253f and 6a975ca.

📒 Files selected for processing (2)
  • packages/orderbook/test/js_api/gui.test.ts (4 hunks)
  • packages/ui-components/src/__tests__/OrderPage.test.ts (7 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Deploy-Preview
  • GitHub Check: test
  • GitHub Check: test
  • GitHub Check: git-clean
🔇 Additional comments (10)
packages/ui-components/src/__tests__/OrderPage.test.ts (6)

2-2: LGTM! Consistent renaming from strategy to order terminology.

The import statement and test suite naming have been properly updated to reflect the component refactoring.

Also applies to: 15-15


21-42: LGTM! Test case properly updated and previous naming issue resolved.

The test case has been consistently updated to use "order" terminology. The camelCase naming issue mentioned in the previous review (mockorderDetailsmockOrderDetails) has been properly addressed.


44-71: LGTM! Consistent refactoring with proper prop naming.

The test case has been properly updated with consistent "order" terminology. The prop name change from strategyName to orderName maintains logical consistency with the component refactoring.


73-98: LGTM! Error handling test properly updated.

The error handling scenario has been consistently updated to use "order" terminology, including the error message text and method calls.


100-122: LGTM! Markdown fetch failure test consistently updated.

The test case maintains the same logic while properly using the updated "order" terminology throughout.


124-185: LGTM! Final test cases consistently updated.

Both markdown-related test cases have been properly updated to use "order" terminology while maintaining their original test logic and coverage.

packages/orderbook/test/js_api/gui.test.ts (4)

24-27: Duplicate word removed – YAML description now reads correctly

The earlier “order order” typo is gone, keeping the description concise and preventing downstream string-comparison failures.


345-348: Consistent fix in remote-GUI fixture

The same duplicated word was excised here, ensuring parity between local and remote fixtures and avoiding brittle remote-network tests.


502-505: Assertion updated to match corrected description

The test now expects exactly “Fixed limit order”, so it will no longer be coupled to the former typo.


521-527: New “order details” test aligns with API rename

Renaming the test case and using getOrderDetails reflects the codebase-wide terminology change. Assertions cover name, description, and short-description – good coverage.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch 2025-07-17-renaming

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
🪧 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.
    • @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 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 for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for 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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Comment on lines 15 to +17
<div data-testid="description" class="mt-4 text-center text-2xl">
Raindex allows anyone to write, deploy and manage token trading strategies, written in Rainlang,
on any EVM network.
Raindex allows anyone to write, deploy and manage token trading orders, written in Rainlang, on
any EVM network.
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jul 17, 2025

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Terminology updated but constant still duplicated across files
Both this component and the test hard-code the full marketing sentence. Consider extracting the string into a shared constant (e.g. APP_DESCRIPTION) to prevent the two drifting apart again.

-  <div data-testid="description" class="mt-4 text-center text-2xl">
-    Raindex allows anyone to write, deploy and manage token trading orders, written in Rainlang, on
-    any EVM network.
+  <div data-testid="description" class="mt-4 text-center text-2xl">
+    {APP_DESCRIPTION}
   </div>

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In tauri-app/src/routes/+page.svelte around lines 15 to 17, the marketing
description string is hard-coded and duplicated in both the component and its
test. To fix this, extract the description string into a shared constant (e.g.,
APP_DESCRIPTION) in a common module or file, then import and use that constant
in both the component and the test to ensure consistency and prevent divergence.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is fine

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.

@findolor Understood! I'll accept your decision on this one.


🧠 Learnings used
Learnt from: findolor
PR: rainlanguage/rain.orderbook#1872
File: packages/webapp/src/lib/services/handleVaultWithdraw.ts:50-54
Timestamp: 2025-06-07T05:19:04.767Z
Learning: In the rainlanguage/rain.orderbook codebase, the team prefers pragmatic code approaches over strict TypeScript patterns when the current implementation is sufficient for their use case, such as using `if (result.error)` instead of `if ('error' in result)` for discriminated union type checking.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1469
File: packages/ui-components/src/__tests__/CodeMirrorDotrain.test.ts:75-98
Timestamp: 2025-03-31T10:16:53.544Z
Learning: In the rainlanguage/rain.orderbook project, direct manipulation of Svelte's internal state (component.$$.ctx) in tests is an acceptable approach for testing component behavior, as demonstrated in the CodeMirrorDotrain tests.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1566
File: packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/+page.svelte:26-31
Timestamp: 2025-04-02T08:11:19.742Z
Learning: In the Rain Orderbook deployment page component, the conditional check `if (dotrain && deployment)` inside `onMount` is necessary to prevent GUI initialization with null values, even though there's already a redirect logic outside the function and conditional rendering for the UI message. These serve different purposes in the component's error handling strategy.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1565
File: packages/webapp/src/routes/deploy/+layout.svelte:12-16
Timestamp: 2025-04-09T09:59:04.121Z
Learning: In the Rain Orderbook application, a full page reload (window.location.reload()) is needed when changing the registry URL to ensure proper state reinitialization, rather than using SvelteKit's soft navigation methods.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1504
File: tauri-app/src/routes/orders/[network]-[orderHash]/+page.svelte:33-37
Timestamp: 2025-04-08T16:35:15.127Z
Learning: In the Rain OrderBook project, the onDeposit and onWithdraw functions in page components are kept simple (just calling modal handlers and revalidating queries) because error handling for deposit and withdraw actions (including user cancellations and failed transactions) is handled within the modal components themselves.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1883
File: packages/webapp/src/lib/services/handleDeploy.ts:6-16
Timestamp: 2025-05-27T09:47:45.608Z
Learning: In the rain.orderbook webapp, error handling for modal operations like handleDeployModal and handleDisclaimerModal is handled elsewhere in the codebase, not at the individual function level in handleDeploy-type functions.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1504
File: packages/webapp/src/routes/orders/[network]-[orderHash]/+page.svelte:50-74
Timestamp: 2025-04-03T11:29:00.839Z
Learning: In the Rain OrderBook app, error handling for deposit and withdraw actions (including user cancellations and failed transactions) is implemented in the transaction modal component, not in the page-level action handlers.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1724
File: packages/ui-components/src/__tests__/ButtonDarkMode.test.ts:1-54
Timestamp: 2025-05-03T10:29:04.009Z
Learning: JSDoc comments are not considered necessary for test files in the rainlanguage/rain.orderbook repository. Test descriptions and assertions are sufficient documentation.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any additional text or formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:46:08.530Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report should be the only content in the comment - no text before it, no text after it, no formatting blocks, just the raw report in the exact format: "TOTAL=number\nADDITIONS=number\nDELETIONS=number". The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:26:31.566Z
Learning: For PR #1884 and future PRs in rainlanguage/rain.orderbook repository, provide PR size reports in a separate comment with ONLY the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number", without any additional text or explanation. Reports should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1996
File: packages/ui-components/src/__tests__/VaultIdInformation.test.ts:6-6
Timestamp: 2025-07-17T10:36:02.814Z
Learning: In packages/ui-components/src/__tests__/VaultIdInformation.test.ts, findolor prefers to keep exported type aliases like `VaultIdInformationComponentProps` in test files, even when static analysis tools flag this as discouraged practice.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:24:53.708Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, provide a separate comment after each review with PR size statistics in the format: `TOTAL=number ADDITIONS=number DELETIONS=number`, excluding lock files like package-lock.json and cargo.lock.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#2000
File: crates/common/src/raindex_client/vaults.rs:183-183
Timestamp: 2025-07-16T10:40:05.656Z
Learning: In the rainlanguage/rain.orderbook codebase, user findolor considers breaking changes from Option<U256> to U256 for required fields like decimals in RaindexVaultToken to be acceptable and safe, even when they affect multiple usage sites across the codebase.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1956
File: crates/common/src/fuzz/mod.rs:64-64
Timestamp: 2025-07-04T09:02:57.301Z
Learning: In rainlanguage/rain.orderbook, user findolor prefers to limit type consistency changes to only the parts directly related to the current work scope. For example, when updating chain_id fields from u64 to u32 in fuzz-related code, unrelated files like tauri-app wallet commands can remain as u64 if they serve different purposes and aren't part of the current changes.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T23:34:42.328Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must use the format:
TOTAL:number
ADDITIONS:number
DELETIONS:number
with no extra text, formatting blocks, or explanations, and must still exclude lock files and reassess after each new commit.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:47:21.927Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very beginning of any comment, before any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:47:21.927Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very beginning of any comment, before any learning used section or other content.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1925
File: crates/settings/src/remote_tokens.rs:44-62
Timestamp: 2025-07-11T08:45:43.961Z
Learning: findolor prefers to avoid performance micro-optimizations like changing `.values()` to `.into_values()` in HashMap iterations in the rainlanguage/rain.orderbook codebase, even when they would eliminate unnecessary cloning.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1903
File: crates/js_api/src/subgraph/vault.rs:129-138
Timestamp: 2025-06-17T16:33:58.549Z
Learning: findolor prefers downstream error handling over early validation checks for empty RPC lists in vault functions, allowing errors to bubble up from provider creation logic naturally.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1916
File: packages/webapp/src/routes/+layout.ts:26-26
Timestamp: 2025-06-10T12:01:07.418Z
Learning: The user findolor prefers to keep string concatenation using the plus operator over template literals in the rainlanguage/rain.orderbook project, even when static analysis tools suggest the change.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1975
File: crates/js_api/src/config.rs:44-45
Timestamp: 2025-07-09T07:42:48.458Z
Learning: User findolor prefers to defer code improvements and refactoring suggestions to future PRs when they are not directly related to the current PR's scope, even when the suggestions are valid improvements.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1947
File: crates/common/src/raindex_client/orders.rs:462-1643
Timestamp: 2025-06-24T08:45:10.971Z
Learning: User findolor prefers to keep tests simple and avoid refactoring for maintainability when the code is stable and viewed as "one time thing" that won't require frequent changes.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#2001
File: crates/common/src/raindex_client/order_quotes.rs:62-69
Timestamp: 2025-07-16T14:33:13.409Z
Learning: In the rainlanguage/rain.orderbook codebase, findolor considers hardcoded decimal values (18 and 36) in order quote formatting logic to be acceptable for their use case, even when dynamic token decimals could theoretically provide more accurate formatting for different tokens.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:35:26.448Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very last part of any comment, after any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:35:26.448Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very last part of any comment, after any learning used section or other content.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1938
File: crates/js_api/src/raindex/mod.rs:102-118
Timestamp: 2025-06-18T12:56:44.290Z
Learning: In the rainlanguage/rain.orderbook codebase, it's acceptable to scaffold unused enum variants in initial implementation PRs when they will be implemented in future PRs, as confirmed by findolor.

Comment thread packages/ui-components/src/lib/errors/DeploymentStepsError.ts
Comment on lines +23 to 24
You are using a <span class="font-medium">custom orders registry. </span>
<a
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.

🧹 Nitpick (assertive)

Prefer singular “order registry” for smoother copy

“custom orders registry” sounds slightly awkward; the usual phrasing is “custom order registry.”
If you agree, a one-word tweak keeps the sentence flowing without altering meaning.

🤖 Prompt for AI Agents
In packages/webapp/src/lib/components/CustomRegistryWarning.svelte around lines
23 to 24, change the phrase "custom orders registry" to "custom order registry"
to improve the sentence flow and maintain clarity. This involves replacing the
plural "orders" with the singular "order" in the text content.

Comment thread packages/ui-components/src/lib/components/input/InputRegistryUrl.svelte Outdated
Comment on lines 10 to 12
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">Invalid orders in registry</h2>
<div class="flex flex-col gap-2">
{#each strategiesWithErrors as strategy}
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot Jul 17, 2025

Choose a reason for hiding this comment

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

🧹 Nitpick (assertive)

Heading updated, but test-ID and prop names still use “strategy”

The visible text now says “Invalid orders”, yet
data-testid="invalid-strategies" and the component props (strategiesWithErrors) keep the old wording.
If the wider rename eventually covers identifiers, consider updating these too to avoid mixed terminology.

🤖 Prompt for AI Agents
In
packages/ui-components/src/lib/components/deployment/InvalidStrategiesSection.svelte
around lines 10 to 12, the heading text was changed to "Invalid orders in
registry" but the test ID and prop names still use "strategy" terminology. To
maintain consistent naming, rename the test ID from "invalid-strategies" to
"invalid-orders" and update the prop name from "strategiesWithErrors" to
"ordersWithErrors" or a similar term reflecting "orders". Make sure to update
all references to these identifiers within the component to avoid mixed
terminology.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is fine

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.

@findolor, understood! I'll note your preference for keeping the internal identifiers as-is while updating the user-facing text.


✏️ Learnings added
Learnt from: findolor
PR: rainlanguage/rain.orderbook#2004
File: packages/ui-components/src/lib/components/deployment/InvalidStrategiesSection.svelte:10-12
Timestamp: 2025-07-17T13:33:08.743Z
Learning: In packages/ui-components/src/lib/components/deployment/InvalidStrategiesSection.svelte, maintainer findolor is comfortable with mixed terminology during the strategy-to-order rename, where user-facing text is updated to "orders" but internal identifiers like test IDs ("invalid-strategies") and prop names ("strategiesWithErrors") can remain using "strategy" terminology.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: findolor
PR: rainlanguage/rain.orderbook#1925
File: packages/ui-components/src/lib/errors/DeploymentStepsError.ts:16-16
Timestamp: 2025-07-10T12:52:47.468Z
Learning: In packages/ui-components/src/lib/errors/DeploymentStepsError.ts, the error codes NO_SELECT_TOKENS ('Error loading tokens') and NO_AVAILABLE_TOKENS ('Error loading available tokens') represent different failure scenarios in the token loading workflow and should remain as separate error codes.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1493
File: packages/ui-components/src/lib/utils/handleDeployment.ts:10-43
Timestamp: 2025-04-04T09:56:04.949Z
Learning: In the rain.orderbook project, errors from the handleDeployment utility function are thrown to DeploymentSteps.svelte, which handles displaying the errors to the user through the DeploymentStepsError utility.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1493
File: packages/ui-components/src/lib/components/deployment/DeployButton.svelte:0-0
Timestamp: 2025-03-31T14:01:19.067Z
Learning: The DeployButton component in packages/ui-components/src/lib/components/deployment/DeployButton.svelte is designed to be generic, dispatching clickDeploy events to be handled at the page level, where validation of event details (result, networkKey, subgraphUrl) occurs.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1493
File: packages/ui-components/src/__tests__/DeployButton.test.ts:36-40
Timestamp: 2025-03-28T10:22:11.771Z
Learning: The DeployButton component in packages/ui-components/src/lib/components/deployment/DeployButton.svelte doesn't have an explicit disabled prop. Instead, its disabled state is internally controlled by the checkingDeployment variable, which is set to true during deployment checks.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1493
File: packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/+page.svelte:33-49
Timestamp: 2025-03-28T10:35:36.699Z
Learning: The DeployButton component in the Rain Orderbook UI handles error validation before dispatching events, ensuring that event handlers like handleClickDeploy only receive valid event details with result, subgraphUrl, and networkKey properties.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1974
File: packages/ui-components/src/__tests__/DeploymentSteps.test.ts:123-126
Timestamp: 2025-07-09T12:35:45.699Z
Learning: In packages/ui-components/src/__tests__/DeploymentSteps.test.ts, findolor prefers to keep mock initializations (like setSelectToken) in individual test cases rather than consolidating them into shared beforeEach blocks, even when it results in duplication.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1720
File: packages/ui-components/src/lib/components/License.svelte:16-18
Timestamp: 2025-05-07T18:05:21.557Z
Learning: In the License.svelte component, error handling is intentionally kept minimal with a single error message "Failed to fetch license" in the catch block, without specific handling for different HTTP status codes.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1996
File: packages/ui-components/src/__tests__/VaultIdInformation.test.ts:6-6
Timestamp: 2025-07-17T10:36:02.814Z
Learning: In packages/ui-components/src/__tests__/VaultIdInformation.test.ts, findolor prefers to keep exported type aliases like `VaultIdInformationComponentProps` in test files, even when static analysis tools flag this as discouraged practice.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1925
File: packages/ui-components/src/__tests__/DeploymentSteps.test.ts:519-554
Timestamp: 2025-07-11T08:46:07.606Z
Learning: In packages/ui-components/src/__tests__/DeploymentSteps.test.ts, findolor prefers to keep hardcoded timeout values (like 50ms and 100ms) inline in test cases rather than extracting them to named constants, viewing such refactoring as unnecessary for test maintainability.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1903
File: crates/settings/src/yaml/orderbook.rs:371-377
Timestamp: 2025-06-17T16:21:24.384Z
Learning: In crates/settings/src/yaml/orderbook.rs tests, the user findolor considers RPC ordering in Vec<Url> assertions to be intentional and not a test brittleness issue. The ordering of RPCs in tests should be preserved as specified.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1996
File: packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/fullDeployment.test.ts:303-303
Timestamp: 2025-07-17T10:35:09.319Z
Learning: In packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/fullDeployment.test.ts, findolor is fine with hardcoded 2-second delays using setTimeout in test cases for waiting after token selection, preferring this approach over deterministic waiting patterns.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1512
File: packages/ui-components/src/__tests__/OrderDetail.test.ts:125-143
Timestamp: 2025-04-08T12:56:03.272Z
Learning: The OrderDetail component in the Rain orderbook UI doesn't currently have error handling tests, but issue #1605 has been created to address this in the future.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1956
File: packages/ui-components/src/__tests__/VaultDetail.test.ts:177-181
Timestamp: 2025-07-04T09:14:35.748Z
Learning: In the rain.orderbook project, maintainer findolor is fine with mutating mock data directly in test files using @ts-expect-error comments, preferring this pragmatic approach over immutable patterns like spread operators for test data updates.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1883
File: packages/ui-components/src/lib/components/deployment/DepositInput.svelte:102-102
Timestamp: 2025-05-27T09:47:28.310Z
Learning: In the rain.orderbook codebase, preset values should not be sanitized when used in test IDs (dataTestId attributes). The user prefers to keep the original preset values as-is in test identifiers.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1996
File: packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/fullDeployment.test.ts:172-172
Timestamp: 2025-07-17T10:35:53.174Z
Learning: In packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/fullDeployment.test.ts, findolor is comfortable with hardcoded 2-second delays using setTimeout after token selection elements appear, preferring this approach over deterministic waiting patterns with waitFor.

Learnt from: hardingjam
PR: rainlanguage/rain.orderbook#1512
File: packages/ui-components/src/__tests__/OrderDetail.test.ts:0-0
Timestamp: 2025-04-09T09:28:05.097Z
Learning: The OrderDetail component has been refactored to use an `onRemove` callback approach instead of the previous `handleOrderRemoveModal` pattern for order removal functionality, as part of PR #1512.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1907
File: packages/orderbook/test/common/test.test.ts:75-77
Timestamp: 2025-06-04T10:21:01.388Z
Learning: The DotrainOrder.create API in packages/orderbook/test/common/test.test.ts is internal and not used directly in consumer applications, so API changes here don't require external breaking change documentation.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1925
File: crates/settings/src/remote_tokens.rs:44-62
Timestamp: 2025-07-11T08:45:43.961Z
Learning: findolor prefers to avoid performance micro-optimizations like changing `.values()` to `.into_values()` in HashMap iterations in the rainlanguage/rain.orderbook codebase, even when they would eliminate unnecessary cloning.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1903
File: crates/js_api/src/subgraph/vault.rs:129-138
Timestamp: 2025-06-17T16:33:58.549Z
Learning: findolor prefers downstream error handling over early validation checks for empty RPC lists in vault functions, allowing errors to bubble up from provider creation logic naturally.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1916
File: packages/webapp/src/routes/+layout.ts:26-26
Timestamp: 2025-06-10T12:01:07.418Z
Learning: The user findolor prefers to keep string concatenation using the plus operator over template literals in the rainlanguage/rain.orderbook project, even when static analysis tools suggest the change.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1975
File: crates/js_api/src/config.rs:44-45
Timestamp: 2025-07-09T07:42:48.458Z
Learning: User findolor prefers to defer code improvements and refactoring suggestions to future PRs when they are not directly related to the current PR's scope, even when the suggestions are valid improvements.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1947
File: crates/common/src/raindex_client/orders.rs:462-1643
Timestamp: 2025-06-24T08:45:10.971Z
Learning: User findolor prefers to keep tests simple and avoid refactoring for maintainability when the code is stable and viewed as "one time thing" that won't require frequent changes.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#2001
File: crates/common/src/raindex_client/order_quotes.rs:62-69
Timestamp: 2025-07-16T14:33:13.409Z
Learning: In the rainlanguage/rain.orderbook codebase, findolor considers hardcoded decimal values (18 and 36) in order quote formatting logic to be acceptable for their use case, even when dynamic token decimals could theoretically provide more accurate formatting for different tokens.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:47:21.927Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very beginning of any comment, before any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:47:21.927Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very beginning of any comment, before any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T21:26:31.566Z
Learning: For PR #1884 and future PRs in rainlanguage/rain.orderbook repository, provide PR size reports in a separate comment with ONLY the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number", without any additional text or explanation. Reports should exclude irrelevant files such as lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock).

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T23:34:42.328Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must use the format:
TOTAL:number
ADDITIONS:number
DELETIONS:number
with no extra text, formatting blocks, or explanations, and must still exclude lock files and reassess after each new commit.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:35:26.448Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very last part of any comment, after any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:35:26.448Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, the PR size report must always be placed at the very last part of any comment, after any learning used section or other content.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any additional text or formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: rouzwelt
PR: rainlanguage/rain.orderbook#0
File: :0-0
Timestamp: 2025-05-21T22:14:22.646Z
Learning: For PR #1884 in rainlanguage/rain.orderbook, I must consistently report the PR size after EVERY new commit in the exact format "TOTAL=number\nADDITIONS=number\nDELETIONS=number" without any formatting blocks. The report must exclude lock files (package-lock.json, yarn.lock, pnpm-lock.yaml, cargo.lock) and can be included either as part of the review or as a separate comment.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1956
File: crates/common/src/fuzz/mod.rs:64-64
Timestamp: 2025-07-04T09:02:57.301Z
Learning: In rainlanguage/rain.orderbook, user findolor prefers to limit type consistency changes to only the parts directly related to the current work scope. For example, when updating chain_id fields from u64 to u32 in fuzz-related code, unrelated files like tauri-app wallet commands can remain as u64 if they serve different purposes and aren't part of the current changes.

Learnt from: findolor
PR: rainlanguage/rain.orderbook#1938
File: crates/js_api/src/raindex/mod.rs:102-118
Timestamp: 2025-06-18T12:56:44.290Z
Learning: In the rainlanguage/rain.orderbook codebase, it's acceptable to scaffold unused enum variants in initial implementation PRs when they will be implemented in future PRs, as confirmed by findolor.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@findolor probably best to update for consistency / to not make future maintenance confusing

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.

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!


// Click the "Deploy Strategy" button
const deployButton = screen.getByText('Deploy Strategy');
const deployButton = screen.getByText('Deploy Order');
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.

🧹 Nitpick (assertive)

LGTM! Test assertions updated to match UI terminology changes.

The button text expectations have been correctly updated from "Deploy Strategy" to "Deploy Order" to align with the UI component changes.

However, consider updating the comments above these assertions (lines 200, 356, 503) to maintain consistency:

-			// Click the "Deploy Strategy" button
+			// Click the "Deploy Order" button

Also applies to: 357-357, 504-504

🤖 Prompt for AI Agents
In
packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/fullDeployment.test.ts
at lines 200, 356, and 503, update the comments above the test assertions to
reflect the new button text "Deploy Order" instead of the old "Deploy Strategy"
terminology. Also, make the same comment updates at lines 357 and 504 to
maintain consistency with the UI changes.

Comment on lines 10 to 12
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">Invalid orders in registry</h2>
<div class="flex flex-col gap-2">
{#each strategiesWithErrors as strategy}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

@findolor probably best to update for consistency / to not make future maintenance confusing

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

strategy/order stuff in components and variables should probably also be updated for the aforementioned reason

@findolor findolor requested a review from 0xgleb July 25, 2025 05:21
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 7

🔭 Outside diff range comments (1)
packages/ui-components/src/lib/services/registry.ts (1)

47-47: Fix inconsistent terminology and typo in error message.

The error message still uses the old "strategy" terminology (with a typo "stategy") and should be updated to align with the refactoring effort.

Apply this diff to fix the terminology and typo:

-			throw new Error('Invalid stategy registry.');
+			throw new Error('Invalid order registry.');
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 0513801 and d99253f.

📒 Files selected for processing (47)
  • crates/common/src/raindex_client/orders.rs (1 hunks)
  • crates/common/src/raindex_client/vaults.rs (1 hunks)
  • crates/js_api/src/gui/mod.rs (15 hunks)
  • crates/js_api/src/gui/select_tokens.rs (2 hunks)
  • crates/js_api/src/gui/state_management.rs (1 hunks)
  • crates/settings/src/config_source.rs (2 hunks)
  • crates/settings/src/gui.rs (1 hunks)
  • crates/settings/src/yaml/dotrain.rs (1 hunks)
  • packages/orderbook/README.md (3 hunks)
  • packages/orderbook/test/js_api/gui.test.ts (4 hunks)
  • packages/ui-components/src/__tests__/DeploymentSteps.test.ts (3 hunks)
  • packages/ui-components/src/__tests__/DeploymentTile.test.ts (1 hunks)
  • packages/ui-components/src/__tests__/DeploymentsSection.test.ts (3 hunks)
  • packages/ui-components/src/__tests__/InvalidOrdersSection.test.ts (1 hunks)
  • packages/ui-components/src/__tests__/InvalidStrategiesSection.test.ts (0 hunks)
  • packages/ui-components/src/__tests__/OrderPage.test.ts (7 hunks)
  • packages/ui-components/src/__tests__/ValidOrdersSection.test.ts (1 hunks)
  • packages/ui-components/src/__tests__/ValidStrategiesSection.test.ts (0 hunks)
  • packages/ui-components/src/__tests__/registry.test.ts (5 hunks)
  • packages/ui-components/src/lib/__mocks__/stores.ts (1 hunks)
  • packages/ui-components/src/lib/components/deployment/DeploymentSteps.svelte (3 hunks)
  • packages/ui-components/src/lib/components/deployment/DeploymentTile.svelte (2 hunks)
  • packages/ui-components/src/lib/components/deployment/DeploymentsSection.svelte (2 hunks)
  • packages/ui-components/src/lib/components/deployment/InvalidOrdersSection.svelte (1 hunks)
  • packages/ui-components/src/lib/components/deployment/InvalidStrategiesSection.svelte (0 hunks)
  • packages/ui-components/src/lib/components/deployment/OrderPage.svelte (3 hunks)
  • packages/ui-components/src/lib/components/deployment/ValidOrdersSection.svelte (2 hunks)
  • packages/ui-components/src/lib/components/input/InputRegistryUrl.svelte (1 hunks)
  • packages/ui-components/src/lib/index.ts (2 hunks)
  • packages/ui-components/src/lib/providers/transactions/TransactionManager.ts (1 hunks)
  • packages/ui-components/src/lib/services/index.ts (1 hunks)
  • packages/ui-components/src/lib/services/registry.ts (4 hunks)
  • packages/ui-components/src/lib/types/order.ts (1 hunks)
  • packages/ui-components/test-setup.ts (1 hunks)
  • packages/webapp/src/lib/__mocks__/stores.ts (1 hunks)
  • packages/webapp/src/lib/constants.ts (1 hunks)
  • packages/webapp/src/routes/deploy/+layout.ts (3 hunks)
  • packages/webapp/src/routes/deploy/+page.svelte (1 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/+layout.ts (1 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/+page.svelte (1 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/+page.svelte (2 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/fullDeployment.test.ts (15 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/layout.test.ts (1 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/page.test.ts (7 hunks)
  • packages/webapp/src/routes/deploy/[orderName]/layout.test.ts (3 hunks)
  • packages/webapp/src/routes/deploy/[strategyName]/+page.svelte (0 hunks)
  • packages/webapp/src/routes/deploy/page.test.ts (10 hunks)
💤 Files with no reviewable changes (4)
  • packages/ui-components/src/lib/components/deployment/InvalidStrategiesSection.svelte
  • packages/webapp/src/routes/deploy/[strategyName]/+page.svelte
  • packages/ui-components/src/tests/ValidStrategiesSection.test.ts
  • packages/ui-components/src/tests/InvalidStrategiesSection.test.ts
🧰 Additional context used
🧬 Code Graph Analysis (8)
crates/settings/src/yaml/dotrain.rs (1)
crates/settings/src/gui.rs (1)
  • parse_order_details (393-429)
packages/ui-components/src/lib/types/order.ts (1)
packages/ui-components/src/lib/index.ts (2)
  • ValidOrderDetail (88-88)
  • InvalidOrderDetail (88-88)
packages/ui-components/src/__tests__/InvalidOrdersSection.test.ts (1)
packages/ui-components/src/lib/types/order.ts (1)
  • InvalidOrderDetail (9-12)
packages/webapp/src/routes/deploy/[orderName]/layout.test.ts (2)
packages/webapp/src/routes/deploy/+layout.ts (1)
  • load (19-43)
packages/webapp/src/routes/deploy/[orderName]/+layout.ts (1)
  • load (4-32)
packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/fullDeployment.test.ts (2)
packages/ui-components/src/lib/__mocks__/stores.ts (2)
  • mockPageStore (150-160)
  • mockSettingsStore (58-62)
packages/webapp/src/lib/__mocks__/stores.ts (1)
  • mockPageStore (61-71)
packages/ui-components/src/__tests__/ValidOrdersSection.test.ts (1)
packages/ui-components/src/lib/types/order.ts (1)
  • ValidOrderDetail (3-7)
packages/ui-components/src/lib/services/registry.ts (1)
packages/ui-components/src/lib/types/order.ts (2)
  • ValidOrderDetail (3-7)
  • InvalidOrderDetail (9-12)
packages/webapp/src/routes/deploy/+layout.ts (2)
packages/ui-components/src/lib/types/order.ts (2)
  • ValidOrderDetail (3-7)
  • InvalidOrderDetail (9-12)
packages/ui-components/src/lib/services/registry.ts (1)
  • validateOrders (78-118)
🪛 LanguageTool
packages/orderbook/README.md

[grammar] ~7-~7: There might be a mistake here.
Context: ...at is Raindex? Raindex is an onchain orderbook contract that enables users to deploy...

(QB_NEW_EN_OTHER)

🔇 Additional comments (73)
crates/common/src/raindex_client/orders.rs (1)

299-299: LGTM! Documentation terminology update aligns with PR objectives.

The change from "trading strategy" to "trading algorithm" improves technical accuracy and consistency with the broader terminology shift from "strategy" to "order" throughout the codebase.

crates/common/src/raindex_client/vaults.rs (1)

47-47: Documentation terminology update looks good.

The change from "trading strategy" to "trading algorithm" aligns well with the broader terminology shift and maintains technical accuracy in describing how vaults serve different roles in order execution.

packages/webapp/src/lib/constants.ts (1)

2-2: Confirm registry commit includes "order" terminology
The registry file at commit 2a82d8f65144508aa803a1b738cec18365ca5f24 shows no occurrences of “order”. Please manually verify that PR 55 in rain.strategies has updated the registry (renaming “strategy” to “order”) and that this URL points to the correct commit containing those changes.

• File: packages/webapp/src/lib/constants.ts, line 2 (REGISTRY_URL)

packages/ui-components/src/lib/__mocks__/stores.ts (1)

29-29: Mock data update aligns with terminology refactor.

The change from strategyDetail to orderDetail in the mock page state is consistent with the broader strategy-to-order refactor and ensures test compatibility with updated component props.

packages/ui-components/src/lib/components/input/InputRegistryUrl.svelte (1)

29-31: UI terminology updates complete the strategy-to-order transition.

Both the input id attribute and placeholder text have been updated from "strategy" to "order" terminology, providing a consistent user experience that aligns with the broader codebase refactor.

packages/ui-components/src/__tests__/DeploymentTile.test.ts (1)

12-12: LGTM! Test props updated to match component interface.

The mock props correctly reflect the renamed orderName export in the DeploymentTile component, maintaining test consistency with the terminology refactor.

crates/js_api/src/gui/state_management.rs (1)

416-416: LGTM! Serialized state updated to reflect new terminology.

The updated SERIALIZED_STATE constant ensures test data consistency with the "strategy" to "order" terminology refactor across the codebase.

crates/settings/src/config_source.rs (2)

606-606: LGTM! Description updated to remove "strategy" terminology.

The GUI description change from "Fixed limit order strategy" to "Fixed limit order" aligns with the broader terminology refactor.


755-755: LGTM! Test assertion updated to match description change.

The test assertion correctly reflects the updated GUI description, maintaining test consistency.

packages/ui-components/src/lib/components/deployment/DeploymentTile.svelte (2)

5-5: LGTM! Component prop renamed to match new terminology.

The export prop correctly changes from strategyName to orderName, updating the component's public interface to align with the terminology refactor.


21-21: LGTM! URL construction updated to use new prop name.

The href construction correctly uses orderName instead of strategyName, maintaining consistent internal usage of the renamed prop.

packages/ui-components/src/lib/components/deployment/DeploymentsSection.svelte (2)

5-5: LGTM! Component export updated for terminology consistency.

The exported prop name correctly changes from strategyName to orderName, maintaining consistency with the broader terminology refactor.


21-21: LGTM! Prop passing updated to match child component interface.

The prop passed to DeploymentTile correctly uses {orderName} to match the child component's updated interface, ensuring proper component communication.

packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/layout.test.ts (1)

32-32: LGTM! Parameter name updated correctly for the terminology refactor.

The test parameter has been correctly updated from strategyName to orderName, aligning with the broader codebase refactor from "strategy" to "order" terminology.

packages/ui-components/src/lib/services/index.ts (1)

1-1: LGTM! Export correctly updated for the terminology refactor.

The export statement has been properly updated from validateStrategies to validateOrders, maintaining consistency with the renamed function in the registry module.

packages/ui-components/test-setup.ts (2)

59-59: LGTM! Static method mock correctly updated.

The static method mock has been properly renamed from getStrategyDetails to getOrderDetails to match the API refactor.


63-63: LGTM! Instance method mock correctly updated.

The instance method mock has been properly renamed from getStrategyDetails to getOrderDetails to maintain consistency with the API changes.

packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/+page.svelte (2)

19-19: LGTM! Data destructuring correctly updated.

The destructuring has been properly updated from strategyDetail to orderDetail to align with the new terminology.


70-70: LGTM! Component prop correctly updated.

The prop passed to the DeploymentSteps component has been correctly renamed from strategyDetail to orderDetail, maintaining consistency with the API changes.

crates/settings/src/yaml/dotrain.rs (1)

563-563: LGTM! Test method call correctly updated.

The test has been properly updated to call GuiCfg::parse_order_details instead of GuiCfg::parse_strategy_details, aligning with the method rename in the implementation. The test logic and assertions remain unchanged, ensuring continued validation of the parsing functionality.

packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/page.test.ts (2)

101-101: LGTM! Consistent terminology update in test mocks.

The renaming of strategyDetail to orderDetail in all test mock data is consistent with the broader refactor from "strategy" to "order" terminology across the codebase.

Also applies to: 123-123, 141-141, 161-161, 187-187, 213-213, 241-241


163-163: LGTM! URL path updated to reflect new terminology.

The URL change from /deploy/strategy/key to /deploy/order/key correctly aligns with the route naming changes in the refactor.

packages/webapp/src/lib/__mocks__/stores.ts (1)

11-11: LGTM! Mock store updated consistently with terminology refactor.

The change from strategyDetail to orderDetail in the initial page state mock aligns perfectly with the broader codebase refactor from "strategy" to "order" terminology.

crates/js_api/src/gui/select_tokens.rs (2)

16-17: LGTM! Documentation updated to reflect new terminology.

The comment update from "generic strategies" to "generic orders" correctly aligns with the codebase refactor and accurately describes the functionality.


590-590: LGTM! Test data description updated consistently.

The YAML description change from "Fixed limit order strategy" to "Fixed limit order" removes redundant terminology while maintaining clarity, consistent with the broader refactor.

packages/ui-components/src/__tests__/DeploymentsSection.test.ts (1)

25-25: LGTM! Component prop names updated consistently.

The renaming of strategyName to orderName across all test cases is consistent with the component API changes and maintains the same test values and logic.

Also applies to: 44-44, 56-56, 62-62

packages/ui-components/src/lib/providers/transactions/TransactionManager.ts (1)

298-298: LGTM! JSDoc comment corrected to match method purpose.

The documentation update from "deploying a strategy" to "deploying an order" correctly aligns the comment with the method name createAddOrderTransaction and the broader terminology refactor.

packages/webapp/src/routes/deploy/[orderName]/+page.svelte (1)

1-8: LGTM! Clean and consistent implementation.

The component correctly follows SvelteKit conventions and consistently uses the new "order" terminology. The implementation is minimal and appropriate for a route page that delegates to the OrderPage component.

packages/ui-components/src/__tests__/DeploymentSteps.test.ts (2)

87-87: Correct prop name update.

The test correctly updates the prop name from strategyDetail to orderDetail to match the component interface changes.


282-282: UI text expectations properly updated.

The test assertions correctly expect "Deploy Order" instead of "Deploy Strategy" to match the updated button text in the component.

Also applies to: 422-422

packages/ui-components/src/lib/components/deployment/InvalidOrdersSection.svelte (1)

1-20: Well-implemented component with good practices.

The InvalidOrdersSection component correctly replaces the strategy equivalent with proper:

  • TypeScript typing for InvalidOrderDetail[]
  • Accessibility attributes (data-testid)
  • Dark mode support
  • Clear error styling and layout

The implementation is clean and follows established patterns.

packages/ui-components/src/lib/components/deployment/DeploymentSteps.svelte (3)

41-41: Prop name correctly updated.

The exported prop is properly renamed from strategyDetail to orderDetail to align with the terminology change.


206-206: Property access updated consistently.

The component correctly uses orderDetail.name to match the renamed prop.


275-275: Button text updated appropriately.

The deploy button text is correctly updated from "Deploy Strategy" to "Deploy Order" to match the new terminology.

packages/webapp/src/routes/deploy/[orderName]/layout.test.ts (3)

10-16: Mock variables correctly renamed.

The test variables are properly updated from strategy terminology to order terminology (mockorderName, mockorderDetail) with appropriate test data.


24-38: Mock parent data structure updated consistently.

The mock data correctly uses:

  • orderName instead of strategyName
  • validOrders instead of validStrategies
  • Order-focused descriptions in test data

41-55: Test cases properly updated with new terminology.

All test descriptions and assertions are correctly updated to use "order" terminology while maintaining the same test logic and coverage:

  • Loading order details successfully
  • Redirecting when order name is not found
  • Redirecting when order details are missing

Also applies to: 57-67, 69-87

packages/ui-components/src/lib/components/deployment/ValidOrdersSection.svelte (1)

1-32: LGTM! Clean and consistent terminology refactor.

The component has been properly updated from "strategy" to "order" terminology with all related changes consistently applied:

  • Type imports updated to use ValidOrderDetail
  • Component prop renamed appropriately
  • Template variables and test IDs updated consistently
  • Functionality preserved while adopting new domain terminology
packages/webapp/src/routes/deploy/[orderName]/+layout.ts (1)

4-31: Verified: Parent layout provides validOrders

The parent layout at packages/webapp/src/routes/deploy/+layout.ts now correctly destructures { validOrders, invalidOrders }, matching the child loader’s expectations. No further action required—LGTM!

packages/ui-components/src/lib/types/order.ts (1)

3-12: No remaining references to old type names – rename is complete

All imports and usages of ValidOrderDetail and InvalidOrderDetail have been updated consistently across the codebase. There are no lingering references to ValidStrategyDetail or InvalidStrategyDetail.

packages/ui-components/src/__tests__/OrderPage.test.ts (1)

15-186: LGTM! Comprehensive test updates with consistent terminology.

The test suite has been thoroughly updated from "strategy" to "order" terminology:

  • All test descriptions properly updated
  • Mock data and API calls consistently renamed
  • Component props updated to match new interface
  • Error handling tests properly maintained

The test coverage remains comprehensive and all functionality is preserved.

packages/ui-components/src/__tests__/ValidOrdersSection.test.ts (1)

1-32: LGTM! Well-structured test for the ValidOrdersSection component.

The test implementation is clean and follows good testing practices:

  • Proper mock data structure matching the ValidOrderDetail type
  • Clear test case that verifies the component renders the expected number of order tiles
  • Appropriate use of data-testid for reliable element selection
crates/settings/src/gui.rs (1)

393-393: LGTM! Method renamed to align with terminology refactor.

The method rename from parse_strategy_details to parse_order_details is consistent with the broader codebase refactoring from "strategy" to "order" terminology. The functionality remains unchanged.

packages/orderbook/README.md (2)

7-7: LGTM! Documentation updated to reflect terminology change.

The change from "strategies" to "algorithms" aligns with the broader refactoring effort across the codebase. The term "algorithms" is more accurate for describing the dynamic order logic.


304-349: LGTM! Example code updated consistently with new terminology.

The GUI configuration example has been properly updated:

  • Comments reference "order" instead of "strategy"
  • GUI name changed from "DCA Strategy" to "DCA Order"
  • Description updated to use "order" terminology
  • Placeholder comments updated accordingly

These changes maintain consistency with the codebase refactor while preserving the functionality and clarity of the documentation.

packages/webapp/src/routes/deploy/page.test.ts (1)

1-187: LGTM! Test file comprehensively updated for terminology refactor.

The test file has been systematically updated to reflect the "strategy" to "order" terminology change:

  • Import types updated: ValidStrategyDetailValidOrderDetail, InvalidStrategyDetailInvalidOrderDetail
  • Mock data renamed: mockValidStrategy1mockValidOrder1, etc.
  • Test descriptions and assertions updated to reference "orders"
  • Variable names in test data updated: validStrategiesvalidOrders, invalidStrategiesinvalidOrders

The test logic, structure, and coverage remain unchanged, which is appropriate for a terminology refactor. All test cases continue to verify the same functionality with the updated naming conventions.

packages/ui-components/src/__tests__/registry.test.ts (1)

1-253: LGTM! Registry test file updated consistently for terminology refactor.

The test file has been thoroughly updated to reflect the "strategy" to "order" terminology change:

  • Import updated: validateStrategiesvalidateOrders
  • Mock method updated: getStrategyDetailsgetOrderDetails
  • Test descriptions systematically updated to reference "orders"
  • Variable names and expected result properties updated throughout
  • Mock return values adjusted to match new terminology

The test logic, coverage, and structure remain unchanged, which is appropriate for a terminology refactor. All test scenarios continue to verify the same validation behavior with the updated naming conventions.

packages/orderbook/test/js_api/gui.test.ts (1)

521-527: Rename reflects new API but check for upstream implementation

The test switched from getStrategyDetails to getOrderDetails. Ensure the Rust/wasm layer actually exposes getOrderDetails; otherwise the tests will fail at runtime.

If the rename is intentional and implemented, no action needed.

packages/webapp/src/routes/deploy/[orderName]/[deploymentKey]/fullDeployment.test.ts (9)

58-60: Variable renaming looks good.

The strategy-to-order terminology change is applied consistently across all three order type variables.


73-73: Function renaming is consistent with terminology update.

The function logic remains unchanged, only the name has been updated to reflect "order" terminology.


99-104: beforeAll setup correctly updated.

The variable assignments and assertion messages have been properly updated to use "order" terminology while preserving the original logic.


132-132: Test setup properly updated with order terminology.

The test description, dotrain property, and orderDetail property have been consistently updated.

Also applies to: 137-137, 141-141


201-201: UI interactions and API calls correctly updated.

The button text, DotrainOrderGui API call, and error logging all use the new "order" terminology consistently.

Also applies to: 213-213, 228-228


259-259: Auction test setup correctly updated.

Consistent application of order terminology in test description, dotrain assignment, and orderDetail property.

Also applies to: 264-264, 268-268


357-357: Auction test interactions properly updated.

Button interaction, API call, and error logging consistently use "order" terminology.

Also applies to: 369-369, 389-389


420-420: Dynamic spread test setup correctly updated.

Consistent terminology update applied to test description, dotrain property, and orderDetail property.

Also applies to: 425-425, 429-429


504-504: Dynamic spread test interactions properly updated.

Final test case correctly implements the order terminology in button text, API calls, and logging.

Also applies to: 516-516, 535-535

packages/ui-components/src/lib/components/deployment/OrderPage.svelte (3)

7-7: Export property correctly renamed.

The component prop has been properly updated from strategyName to orderName while maintaining the same type and default value.


27-42: Function and API calls correctly updated.

The async function has been properly renamed and the DotrainOrderGui API call has been updated to use getOrderDetails. Variable naming and error messages are consistent with the new terminology.


45-45: Template bindings correctly updated.

The Svelte template properly uses the renamed function, orderDetails variable references, and orderName prop binding. All changes are consistent with the component refactor.

Also applies to: 50-50, 65-65, 72-72

packages/ui-components/src/lib/index.ts (2)

60-60: Component exports correctly updated.

The exports have been properly renamed to reflect the new "order" terminology and align with the renamed component files.

Also applies to: 65-66


88-88: Type exports correctly updated.

The type exports have been properly renamed from Strategy to Order terminology and the import path has been updated to match the new types file location.

packages/webapp/src/routes/deploy/+layout.ts (3)

3-4: Import statements correctly updated.

The imported types and service function have been properly renamed to use "order" terminology.


14-15: LoadResult type properly updated.

The type definition correctly uses the new order-related field names while maintaining the same structure.


25-25: Load function correctly updated.

The service call, destructuring, return object, and error handling have all been consistently updated to use "order" terminology while preserving the original logic.

Also applies to: 30-31, 38-39

crates/js_api/src/gui/mod.rs (5)

80-84: Documentation examples correctly updated.

The YAML examples and code comments have been consistently updated to use "order" terminology, maintaining alignment between documentation and implementation.

Also applies to: 124-124, 134-135


400-408: Core API method correctly renamed.

The primary getOrderDetails method has been properly updated with consistent naming in the WASM export, documentation, and internal implementation.


376-376: Method documentation correctly updated.

Comments and descriptions have been consistently updated to use "order" terminology while maintaining clear explanations of the API functionality.

Also applies to: 382-382, 385-385, 391-391, 402-402


797-797: Test data and assertions correctly updated.

Test YAML content and assertions have been updated to use "order" terminology consistently.

Also applies to: 1036-1036


1250-1255: Test functions properly renamed.

All test functions have been consistently updated to use the new get_order_details API method while preserving the original test logic and assertions.

Also applies to: 1276-1276, 1307-1307, 1339-1339

packages/ui-components/src/lib/services/registry.ts (3)

1-1: LGTM! Import statement correctly updated for order terminology.

The import statement has been properly updated to use the new order-related types, aligning with the broader refactoring effort.


14-17: LGTM! Interface properly refactored to use order terminology.

The interface has been correctly renamed and its properties updated to use order-related terminology while maintaining the same type structure.


78-118: LGTM! Comprehensive and systematic refactoring to order terminology.

The function has been thoroughly updated with:

  • Proper function name change from validateStrategies to validateOrders
  • Consistent variable naming throughout (ordersPromises, ordersResults, validOrders, invalidOrders)
  • Updated API call to DotrainOrderGui.getOrderDetails
  • Correct return type matching the updated interface

The logic and control flow remain unchanged, ensuring functionality is preserved while adopting the new terminology.

Comment thread packages/orderbook/test/js_api/gui.test.ts
Comment thread packages/orderbook/test/js_api/gui.test.ts
Comment thread packages/orderbook/test/js_api/gui.test.ts
Comment thread packages/ui-components/src/__tests__/InvalidOrdersSection.test.ts
Comment thread packages/ui-components/src/__tests__/OrderPage.test.ts Outdated
Comment thread packages/webapp/src/routes/deploy/+page.svelte
Comment thread packages/webapp/src/routes/deploy/+page.svelte
@findolor findolor merged commit ffad428 into main Jul 25, 2025
18 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.

inconsistent naming convention "strategy" vs. "order"

3 participants