-
Notifications
You must be signed in to change notification settings - Fork 13
Add inactive orders filter in vaults list page #2362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds an end-to-end "hide inactive orders" filter: new boolean fields on public filter structs and stores, UI checkbox component and props, propagation into GraphQL filter construction (or/ordersAsInput_/ordersAsOutput_), and conditional SQL clause substitution in local DB query generation with tests. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant Webapp as Webapp (Svelte)
participant VaultsTable as VaultsListTable
participant Subgraph as SubgraphClient
participant LocalDB as LocalDB/SQL
User->>Webapp: toggle checkbox (hideInactiveOrdersVaults)
Webapp->>VaultsTable: pass writable prop hideInactiveOrdersVaults
VaultsTable->>VaultsTable: include flag in queryKey and request payload
VaultsTable->>Subgraph: vaults_list(onlyActiveOrders = flag)
Subgraph->>Subgraph: build GraphQL filters (or, ordersAsInput_/ordersAsOutput_)
Subgraph->>LocalDB: fetch_vaults(only_active_orders = flag)
LocalDB->>LocalDB: include/omit ONLY_ACTIVE_ORDERS_CLAUSE in SQL
LocalDB-->>Subgraph: return rows
Subgraph-->>VaultsTable: return results
VaultsTable-->>Webapp: render filtered vaults
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes
Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (3)
🧰 Additional context used📓 Path-based instructions (9)packages/webapp/**/*.{svelte,ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
packages/{webapp,ui-components}/**/*.{svelte,ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
packages/**/*.{js,ts,svelte}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.{ts,tsx,svelte}📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.svelte📄 CodeRabbit inference engine (AGENTS.md)
Files:
tauri-app/**📄 CodeRabbit inference engine (AGENTS.md)
Files:
packages/ui-components/**/*.{svelte,ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
packages/ui-components/**/*.{ts,tsx,js,jsx}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/*.{test,spec}.ts📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (19)📓 Common learnings📚 Learning: 2025-07-26T06:56:28.207ZApplied to files:
📚 Learning: 2025-04-11T06:05:46.473ZApplied to files:
📚 Learning: 2025-06-27T17:34:15.825ZApplied to files:
📚 Learning: 2025-07-24T08:16:47.393ZApplied to files:
📚 Learning: 2025-04-09T09:28:05.097ZApplied to files:
📚 Learning: 2025-11-25T16:50:31.752ZApplied to files:
📚 Learning: 2025-04-09T09:59:04.121ZApplied to files:
📚 Learning: 2025-06-11T11:22:24.903ZApplied to files:
📚 Learning: 2025-06-27T18:41:18.194ZApplied to files:
📚 Learning: 2025-06-17T16:25:44.685ZApplied to files:
📚 Learning: 2025-09-02T08:04:44.814ZApplied to files:
📚 Learning: 2025-07-17T10:36:02.846ZApplied to files:
📚 Learning: 2025-07-09T12:35:45.699ZApplied to files:
📚 Learning: 2025-08-15T17:53:36.512ZApplied to files:
📚 Learning: 2025-03-24T12:27:07.862ZApplied to files:
📚 Learning: 2025-04-15T12:35:56.008ZApplied to files:
📚 Learning: 2025-03-26T15:00:17.997ZApplied to files:
📚 Learning: 2025-04-23T12:10:03.847ZApplied to files:
⏰ 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). (18)
🔇 Additional comments (4)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (22)
crates/cli/src/subgraph.rs(1 hunks)crates/common/src/local_db/query/fetch_vaults/mod.rs(5 hunks)crates/common/src/local_db/query/fetch_vaults/query.sql(1 hunks)crates/common/src/raindex_client/local_db/query/fetch_vaults.rs(2 hunks)crates/common/src/raindex_client/local_db/vaults.rs(1 hunks)crates/common/src/raindex_client/vaults.rs(5 hunks)crates/subgraph/src/multi_orderbook_client.rs(1 hunks)crates/subgraph/src/orderbook_client/vault.rs(12 hunks)crates/subgraph/src/types/common.rs(2 hunks)packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.ts(1 hunks)packages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts(4 hunks)packages/ui-components/src/__tests__/VaultsListTable.test.ts(2 hunks)packages/ui-components/src/lib/__mocks__/stores.ts(2 hunks)packages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.svelte(1 hunks)packages/ui-components/src/lib/components/ListViewOrderbookFilters.svelte(2 hunks)packages/ui-components/src/lib/components/tables/VaultsListTable.svelte(3 hunks)packages/ui-components/src/lib/index.ts(1 hunks)packages/ui-components/src/lib/types/appStores.ts(1 hunks)packages/webapp/src/lib/stores/settings.ts(1 hunks)packages/webapp/src/routes/vaults/+page.svelte(2 hunks)tauri-app/src/lib/stores/settings.ts(1 hunks)tauri-app/src/routes/vaults/+page.svelte(2 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
packages/ui-components/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For UI components (
packages/ui-components), run lints and format checks usingnix develop -c npm run svelte-lint-format-check -w @rainlanguage/ui-components
Files:
packages/ui-components/src/lib/types/appStores.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
packages/ui-components/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For UI components (
packages/ui-components), run tests usingnix develop -c npm run test -w @rainlanguage/ui-components
Files:
packages/ui-components/src/lib/types/appStores.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
packages/{webapp,ui-components}/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
If you modify frontend code or functionality affecting the frontend, you MUST provide a screenshot of the built webapp reflecting your change.
Files:
packages/ui-components/src/lib/types/appStores.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/webapp/src/lib/stores/settings.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
packages/**/*.{js,ts,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/Svelte organized as
packages/*including webapp, ui-components, and orderbook (wasm wrapper published to npm)
Files:
packages/ui-components/src/lib/types/appStores.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/webapp/src/lib/stores/settings.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
**/*.{ts,tsx,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,svelte}: TypeScript/Svelte: format withnix develop -c npm run format
TypeScript/Svelte: lint withnix develop -c npm run lint
TypeScript/Svelte: type-check withnix develop -c npm run check
Files:
packages/ui-components/src/lib/types/appStores.tstauri-app/src/lib/stores/settings.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/webapp/src/lib/stores/settings.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tstauri-app/src/routes/vaults/+page.sveltepackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
tauri-app/**
📄 CodeRabbit inference engine (AGENTS.md)
Desktop app located in
tauri-appwith Rust and Svelte; excludesrc-taurifrom Cargo workspace
Files:
tauri-app/src/lib/stores/settings.tstauri-app/src/routes/vaults/+page.svelte
crates/**/*.rs
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
crates/**/*.rs: For Rust crates incrates/*, run lints usingnix develop -c cargo clippy --workspace --all-targets --all-features -D warnings
For Rust crates incrates/*, run tests usingnix develop -c cargo test --workspaceor--package <crate>
Files:
crates/cli/src/subgraph.rscrates/subgraph/src/orderbook_client/vault.rscrates/common/src/local_db/query/fetch_vaults/mod.rscrates/subgraph/src/types/common.rscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
**/crates/**
📄 CodeRabbit inference engine (AGENTS.md)
Rust workspace organized as
crates/*with subdirectories: cli, common, bindings, js_api, quote, subgraph, settings, math, integration_tests
Files:
crates/cli/src/subgraph.rscrates/subgraph/src/orderbook_client/vault.rscrates/common/src/local_db/query/fetch_vaults/mod.rscrates/subgraph/src/types/common.rscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rscrates/common/src/local_db/query/fetch_vaults/query.sqlcrates/common/src/raindex_client/local_db/vaults.rs
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
**/*.rs: Rust: format code withnix develop -c cargo fmt --all
Rust: lint withnix develop -c rainix-rs-static(preconfigured flags included)
Rust: crates and modules usesnake_case; types usePascalCase
Files:
crates/cli/src/subgraph.rscrates/subgraph/src/orderbook_client/vault.rscrates/common/src/local_db/query/fetch_vaults/mod.rscrates/subgraph/src/types/common.rscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
**/*.{test,spec}.ts
📄 CodeRabbit inference engine (AGENTS.md)
TypeScript/Svelte: run tests with
nix develop -c npm run test(Vitest). Name test files*.test.tsor*.spec.ts
Files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
packages/webapp/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For Webapp (
packages/webapp), run lints and format checks usingnix develop -c npm run svelte-lint-format-check -w @rainlanguage/webapp
Files:
packages/webapp/src/lib/stores/settings.tspackages/webapp/src/routes/vaults/+page.svelte
packages/webapp/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For Webapp (
packages/webapp), run tests usingnix develop -c npm run test -w @rainlanguage/webapp
Files:
packages/webapp/src/lib/stores/settings.ts
**/*.svelte
📄 CodeRabbit inference engine (AGENTS.md)
Svelte components should use
PascalCase.sveltenaming convention; other files use kebab or snake case as appropriate
Files:
packages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltetauri-app/src/routes/vaults/+page.sveltepackages/webapp/src/routes/vaults/+page.svelte
🧠 Learnings (58)
📓 Common learnings
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 1957
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:60-60
Timestamp: 2025-06-27T17:34:15.825Z
Learning: In the VaultsListTable.svelte component, the `activeAccounts` store is redundant in query keys when the `owners` variable (derived from `activeAccountsItems`) is already included, as `owners` is what's actually used in the query function while `activeAccounts` is just a transformed version of the same data.
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: packages/ui-components/src/lib/components/ListViewVaultFilters.svelte:33-52
Timestamp: 2025-08-19T04:15:33.633Z
Learning: In the ListViewVaultFilters.svelte component, the "Show my items only" filter is intentionally destructive for the owners field. When toggled, it should replace any existing owner filters (including those from URL parameters) rather than being additive. This is by design because the UI doesn't provide capability to filter by other owner addresses or remove specific owners from a list. The toggle serves as both a filter and a way for users to clear URL-based owner filters and switch to filtering by their own address only.
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: crates/js_api/src/filters/raindex_filter_store.rs:319-336
Timestamp: 2025-08-01T07:44:53.910Z
Learning: In the rainlanguage/rain.orderbook project's RaindexFilterStore (crates/js_api/src/filters/raindex_filter_store.rs), the team chose a simplified monolithic approach with hard-coded keys and default auto-save behavior over configurable stores. The update_vaults method intentionally auto-saves to both localStorage and URL after each update as the default behavior, following a design evolution from a previous configurable approach.
📚 Learning: 2025-07-17T10:36:02.846Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1996
File: packages/ui-components/src/__tests__/VaultIdInformation.test.ts:6-6
Timestamp: 2025-07-17T10:36:02.846Z
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.
Applied to files:
packages/ui-components/src/lib/types/appStores.tspackages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.sveltepackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tstauri-app/src/routes/vaults/+page.sveltepackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-06-11T11:41:09.591Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1917
File: packages/webapp/src/lib/stores/settings.ts:30-40
Timestamp: 2025-06-11T11:41:09.591Z
Learning: In the webapp, the `settings` cachedWritableStore (packages/webapp/src/lib/stores/settings.ts) is loaded from localStorage once on page load and is not written back thereafter, so deserialization fallbacks do not overwrite the persisted user data.
Applied to files:
tauri-app/src/lib/stores/settings.tspackages/webapp/src/lib/stores/settings.ts
📚 Learning: 2025-06-11T11:22:24.903Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1917
File: tauri-app/src/routes/orders/[network]-[orderHash]/+page.svelte:26-37
Timestamp: 2025-06-11T11:22:24.903Z
Learning: In the tauri-app codebase, the `settings` Svelte store is always initialized with a complete `Config` object whose `orderbook` field (and nested maps such as `orderbooks`, `subgraphs`, and `networks`) is guaranteed to exist, so optional chaining on those paths is unnecessary.
Applied to files:
tauri-app/src/lib/stores/settings.tspackages/webapp/src/lib/stores/settings.tspackages/ui-components/src/__tests__/VaultsListTable.test.ts
📚 Learning: 2025-08-01T07:44:53.910Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: crates/js_api/src/filters/raindex_filter_store.rs:319-336
Timestamp: 2025-08-01T07:44:53.910Z
Learning: In the rainlanguage/rain.orderbook project's RaindexFilterStore (crates/js_api/src/filters/raindex_filter_store.rs), the team chose a simplified monolithic approach with hard-coded keys and default auto-save behavior over configurable stores. The update_vaults method intentionally auto-saves to both localStorage and URL after each update as the default behavior, following a design evolution from a previous configurable approach.
Applied to files:
tauri-app/src/lib/stores/settings.tspackages/webapp/src/lib/stores/settings.tspackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltecrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
📚 Learning: 2025-06-11T11:27:14.391Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1917
File: tauri-app/src/lib/stores/order.ts:10-15
Timestamp: 2025-06-11T11:27:14.391Z
Learning: In this codebase, Svelte writable/derived stores (e.g., `subgraph` in `tauri-app/src/lib/stores/settings.ts`) expose a custom asynchronous `.load()` helper that retrieves the current value, so calls like `await subgraph.load()` are valid.
Applied to files:
tauri-app/src/lib/stores/settings.tspackages/webapp/src/lib/stores/settings.ts
📚 Learning: 2025-09-02T08:04:44.814Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2117
File: packages/ui-components/src/__tests__/VaultIdInformation.test.ts:9-13
Timestamp: 2025-09-02T08:04:44.814Z
Learning: In packages/ui-components/src/__tests__/VaultIdInformation.test.ts and similar test files in the rain.orderbook project, the passthrough vi.mock('rainlanguage/orderbook', async (importOriginal) => { return { ...(await importOriginal()) }; }); block is required for tests to run properly, even when not overriding any exports. This is needed due to the specific Vitest configuration or test environment setup in the project.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/index.tspackages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-07-09T12:35:45.699Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-08-15T17:53:36.512Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2083
File: packages/ui-components/src/__tests__/VaultsListTable.test.ts:0-0
Timestamp: 2025-08-15T17:53:36.512Z
Learning: In test files, avoid testing HTML/browser primitives (like whether a disabled checkbox can be clicked). Tests should focus on component logic and behavior rather than browser functionality. For example, test that the component correctly applies the disabled attribute based on business rules, not that disabled checkboxes can't be toggled.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-11-25T16:50:31.752Z
Learnt from: CR
Repo: rainlanguage/rain.orderbook PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T16:50:31.752Z
Learning: Applies to **/*.{test,spec}.ts : TypeScript/Svelte: run tests with `nix develop -c npm run test` (Vitest). Name test files `*.test.ts` or `*.spec.ts`
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.ts
📚 Learning: 2025-03-24T12:27:07.862Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1494
File: packages/ui-components/src/__tests__/WalletProvider.test.ts:18-28
Timestamp: 2025-03-24T12:27:07.862Z
Learning: In the WalletProvider tests, verifying that setAccountContext is called with the correct store is sufficient. Additional testing of Svelte's store implementation (like subscribing to verify the store value) is unnecessary as it would just be testing the framework itself.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.tspackages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-04-15T12:35:56.008Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1669
File: packages/webapp/src/routes/+layout.ts:82-261
Timestamp: 2025-04-15T12:35:56.008Z
Learning: When testing Svelte applications, focus on application logic rather than testing Svelte's built-in reactive store system. Testing framework functionality (like Svelte's store reactivity) is generally unnecessary in application tests.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.ts
📚 Learning: 2025-03-26T15:00:17.997Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1516
File: packages/webapp/src/routes/deploy/[strategyName]/layout.test.ts:0-0
Timestamp: 2025-03-26T15:00:17.997Z
Learning: For Rain Orderbook projects, there's a preference not to include tests for SvelteKit methods (like parent function rejections) in test files, as these are considered framework responsibilities rather than application code that needs testing.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.ts
📚 Learning: 2025-04-23T12:10:03.847Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1688
File: packages/webapp/src/routes/layout.test.ts:1-139
Timestamp: 2025-04-23T12:10:03.847Z
Learning: When writing unit tests for UI components, focus on testing functional behavior rather than styling or CSS class names. Testing that UI frameworks like Tailwind work correctly is unnecessary and outside the scope of component unit tests.
Applied to files:
packages/ui-components/src/__tests__/CheckboxInactiveOrdersVault.test.ts
📚 Learning: 2025-05-19T12:09:10.694Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1858
File: crates/subgraph/src/orderbook_client/vault.rs:81-92
Timestamp: 2025-05-19T12:09:10.694Z
Learning: The `vault_balance_changes_list` function in OrderbookSubgraphClient uses a different pagination approach compared to other list methods. It uses hard-coded GraphQL query parameters (first=200, skip=0) while still accepting pagination arguments, and the pagination is handled by special logic inside the `query_paginated` method that properly processes these values.
Applied to files:
crates/subgraph/src/orderbook_client/vault.rs
📚 Learning: 2025-06-24T08:46:03.368Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1947
File: crates/common/src/raindex_client/orders.rs:98-125
Timestamp: 2025-06-24T08:46:03.368Z
Learning: In the vault merging logic in crates/common/src/raindex_client/orders.rs, optimization isn't necessary because the maximum list items are usually around 5 items. For such small datasets, the simple three-loop approach is preferred over HashMap-based optimization due to clarity and minimal performance impact.
Applied to files:
crates/subgraph/src/orderbook_client/vault.rscrates/common/src/local_db/query/fetch_vaults/mod.rscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
📚 Learning: 2025-06-17T16:21:24.384Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
crates/subgraph/src/orderbook_client/vault.rs
📚 Learning: 2025-08-02T02:34:32.237Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: crates/js_api/src/filters/raindex_filter_store.rs:446-533
Timestamp: 2025-08-02T02:34:32.237Z
Learning: In the rainlanguage/rain.orderbook project's RaindexFilterStore WASM tests (crates/js_api/src/filters/raindex_filter_store.rs), brusherru decided to focus on testing only methods without side effects (that don't use web_sys) due to difficulties with mocking localStorage and window APIs in the WASM test environment. This pragmatic approach tests pure logic separately from browser integration.
Applied to files:
crates/subgraph/src/orderbook_client/vault.rspackages/ui-components/src/__tests__/VaultsListTable.test.tscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/common/src/raindex_client/vaults.rspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-05-17T15:32:28.733Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.orderbook PR: 1790
File: tauri-app/src-tauri/src/commands/vault.rs:67-67
Timestamp: 2025-05-17T15:32:28.733Z
Learning: For the PR focused on testing Tauri commands::order module, the generic type parameter R: Runtime was selectively added where needed for the PR scope, applying the changes primarily to order.rs and related files while leaving other modules like vault.rs for potential future refactoring.
Applied to files:
crates/common/src/local_db/query/fetch_vaults/mod.rscrates/subgraph/src/types/common.rscrates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rstauri-app/src/routes/vaults/+page.svelte
📚 Learning: 2025-08-14T14:16:34.044Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2083
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:205-205
Timestamp: 2025-08-14T14:16:34.044Z
Learning: In the VaultsListTable component, the `matchesAccount` function from the wallet provider may not properly update on wallet connect/disconnect events, making direct comparison with the reactive `$account` variable more reliable for UI visibility checks. The `matchesAccount` function needs future refactoring to handle wallet state changes properly.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltetauri-app/src/routes/vaults/+page.sveltepackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-08-14T18:29:32.933Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2083
File: packages/ui-components/src/__tests__/VaultsListTable.test.ts:16-19
Timestamp: 2025-08-14T18:29:32.933Z
Learning: In the rain.orderbook project's UI components tests, mocking hooks like useToasts is often required as infrastructure even when not directly asserting on their calls, because components internally depend on these hooks. Removing such mocks would break component rendering in tests and require more complex test setup with providers.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-06-27T17:34:15.825Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 1957
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:60-60
Timestamp: 2025-06-27T17:34:15.825Z
Learning: In the VaultsListTable.svelte component, the `activeAccounts` store is redundant in query keys when the `owners` variable (derived from `activeAccountsItems`) is already included, as `owners` is what's actually used in the query function while `activeAccounts` is just a transformed version of the same data.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tscrates/common/src/local_db/query/fetch_vaults/query.sqltauri-app/src/routes/vaults/+page.sveltepackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-04-04T11:25:21.518Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1559
File: packages/ui-components/src/__tests__/OrderOrVaultHash.test.ts:94-94
Timestamp: 2025-04-04T11:25:21.518Z
Learning: In the rain.orderbook project, minimal test fixtures are preferred over complete mocks that implement the entire interface. Type casting (e.g., `as unknown as SgVault`) is an acceptable approach to maintain both minimal fixtures and TypeScript type compatibility.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-04-07T08:18:36.473Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/routes/deploy/layout.test.ts:12-29
Timestamp: 2025-04-07T08:18:36.473Z
Learning: In test files for this project, hardingjam prefers to use custom mocks (such as for localStorage) rather than relying on environment-provided implementations, as this allows for spying on individual methods and having precise control over implementation details for more robust testing.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-06-08T18:43:51.842Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1891
File: packages/webapp/src/routes/deploy/[strategyName]/[deploymentKey]/page.test.ts:66-80
Timestamp: 2025-06-08T18:43:51.842Z
Learning: In the rain.orderbook webapp test files, when mocking objects like the transaction manager, it's acceptable to use simple empty objects with ts-expect-error comments rather than providing complete mock implementations with all properties and methods.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-06-10T12:04:54.107Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1916
File: packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json:182-195
Timestamp: 2025-06-10T12:04:54.107Z
Learning: In test fixture files like `packages/ui-components/src/lib/__fixtures__/settings-12-11-24.json`, network configuration inconsistencies (such as matchain using Polygon's RPC, chainId, and currency while having its own network key) are acceptable since they are used for testing purposes only.
Applied to files:
packages/ui-components/src/__tests__/VaultsListTable.test.tspackages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-03-28T10:22:11.771Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
packages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.svelte
📚 Learning: 2025-08-19T04:15:33.633Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: packages/ui-components/src/lib/components/ListViewVaultFilters.svelte:33-52
Timestamp: 2025-08-19T04:15:33.633Z
Learning: In the ListViewVaultFilters.svelte component, the "Show my items only" filter is intentionally destructive for the owners field. When toggled, it should replace any existing owner filters (including those from URL parameters) rather than being additive. This is by design because the UI doesn't provide capability to filter by other owner addresses or remove specific owners from a list. The toggle serves as both a filter and a way for users to clear URL-based owner filters and switch to filtering by their own address only.
Applied to files:
packages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltetauri-app/src/routes/vaults/+page.sveltepackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.tspackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-07-26T06:56:28.207Z
Learnt from: hardyjosh
Repo: rainlanguage/rain.orderbook PR: 2035
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:167-174
Timestamp: 2025-07-26T06:56:28.207Z
Learning: In OrdersListTable.svelte, maintainer hardyjosh considers keyed each-blocks unnecessary for item.inputs and item.outputs arrays because the entire query result updates at once during refresh, making DOM diffing optimizations negligible when the whole dataset is replaced rather than individual items being modified.
Applied to files:
packages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tstauri-app/src/routes/vaults/+page.sveltepackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-12-11T07:46:32.817Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2358
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:82-85
Timestamp: 2025-12-11T07:46:32.817Z
Learning: In packages/ui-components/src/lib/components/tables/OrdersListTable.svelte, the token filter intentionally sets both inputs and outputs to the same selectedTokens array (lines 82-85) to achieve OR filtering behavior. This is by design: the single UI token filter should match orders containing the selected token(s) in either inputs OR outputs, not pair-specific filtering. Even though the API supports more granular directional filtering, the UI uses the same tokens in both fields for broader matching.
Applied to files:
packages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.ts
📚 Learning: 2025-07-24T19:31:29.248Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2002
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:63-68
Timestamp: 2025-07-24T19:31:29.248Z
Learning: In Svelte components, functions that depend on reactive state and are used in template rendering (like `isVaultDisabled` in VaultsListTable.svelte) should remain as reactive statements ($:) rather than regular functions, because regular functions won't trigger UI updates when their dependencies change. This is especially important for UI state like disabled/enabled status that needs to update across multiple rendered items when selection state changes.
Applied to files:
packages/ui-components/src/lib/components/ListViewOrderbookFilters.sveltepackages/ui-components/src/lib/components/tables/VaultsListTable.sveltepackages/ui-components/src/lib/index.tspackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-06-27T18:41:18.194Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 1957
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:86-94
Timestamp: 2025-06-27T18:41:18.194Z
Learning: In the rain.orderbook UI components, the tokensQuery should use `enabled: true` rather than `Object.keys($activeSubgraphs).length > 0` because tokens are needed for filtering functionality even when no specific subgraphs are selected. The multiSubgraphArgs falls back to default subgraphs from settings, so disabling the query when no subgraphs are active would break the token filtering feature.
Applied to files:
crates/subgraph/src/types/common.rspackages/ui-components/src/lib/components/tables/VaultsListTable.svelte
📚 Learning: 2025-07-16T05:52:05.576Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1994
File: crates/common/src/raindex_client/vaults.rs:59-59
Timestamp: 2025-07-16T05:52:05.576Z
Learning: User findolor prefers to handle documentation updates for getter methods in batch via dedicated PRs rather than addressing them individually during feature development, as mentioned for the formatted amount string fields in crates/common/src/raindex_client/vaults.rs.
Applied to files:
crates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
📚 Learning: 2025-07-16T10:40:05.717Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2000
File: crates/common/src/raindex_client/vaults.rs:183-183
Timestamp: 2025-07-16T10:40:05.717Z
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.
Applied to files:
crates/common/src/raindex_client/local_db/query/fetch_vaults.rscrates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rscrates/common/src/raindex_client/local_db/vaults.rs
📚 Learning: 2025-08-02T03:55:25.215Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: packages/orderbook/test/js_api/filters.test.ts:19-36
Timestamp: 2025-08-02T03:55:25.215Z
Learning: In the rainlanguage/rain.orderbook project's WASM tests, the pattern of chaining `.value!` calls on WASM result types (like from VaultsFilterBuilder methods) is the established and preferred approach for handling WASM results, and should not be refactored into intermediate variables as it would add unnecessary verbosity without improving the code.
Applied to files:
crates/common/src/raindex_client/local_db/query/fetch_vaults.rs
📚 Learning: 2025-10-18T10:38:41.273Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2237
File: crates/common/src/raindex_client/local_db/sync.rs:79-89
Timestamp: 2025-10-18T10:38:41.273Z
Learning: In `crates/common/src/raindex_client/local_db/sync.rs`, the sync_database method currently only supports indexing a single orderbook per chain ID, which is why `.first()` is used to select the orderbook configuration. Multi-orderbook support per chain ID is planned for future PRs.
Applied to files:
crates/subgraph/src/multi_orderbook_client.rscrates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-07-21T16:34:31.193Z
Learnt from: 0xgleb
Repo: rainlanguage/rain.orderbook PR: 1911
File: crates/subgraph/src/types/impls.rs:7-15
Timestamp: 2025-07-21T16:34:31.193Z
Learning: In the rainlanguage/rain.orderbook codebase, user 0xgleb considers breaking changes that remove unsafe default behaviors to be intentional and acceptable. Specifically, the get_decimals() method in crates/subgraph/src/types/impls.rs was intentionally changed to return MissingDecimals error instead of defaulting to 18 decimals, as defaulting to 18 is considered unsafe and should never have been done.
Applied to files:
crates/subgraph/src/multi_orderbook_client.rs
📚 Learning: 2025-04-10T16:32:51.198Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1651
File: packages/ui-components/src/lib/components/TanstackAppTable.svelte:13-13
Timestamp: 2025-04-10T16:32:51.198Z
Learning: In the TanstackAppTable.svelte component, the queryKey prop should be required (type: string) rather than optional (string | undefined) to ensure proper query invalidation.
Applied to files:
packages/ui-components/src/lib/components/tables/VaultsListTable.svelte
📚 Learning: 2025-04-11T06:05:46.473Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1599
File: tauri-app/src/routes/orders/add/+page.svelte:287-287
Timestamp: 2025-04-11T06:05:46.473Z
Learning: The ScenarioDebugTable component in tauri-app/src/routes/orders/add/+page.svelte has been designed to manage its own data fetching internally without requiring a chartData prop.
Applied to files:
packages/ui-components/src/lib/components/tables/VaultsListTable.sveltetauri-app/src/routes/vaults/+page.svelte
📚 Learning: 2025-11-25T16:50:31.752Z
Learnt from: CR
Repo: rainlanguage/rain.orderbook PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T16:50:31.752Z
Learning: Applies to packages/**/*.{js,ts,svelte} : JavaScript/Svelte organized as `packages/*` including webapp, ui-components, and orderbook (wasm wrapper published to npm)
Applied to files:
packages/ui-components/src/lib/index.tspackages/webapp/src/routes/vaults/+page.svelte
📚 Learning: 2025-10-06T14:13:18.531Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2155
File: crates/common/src/raindex_client/trades.rs:133-152
Timestamp: 2025-10-06T14:13:18.531Z
Learning: In the rain.orderbook codebase, the `page` parameter in `RaindexOrder::get_trades_list` method (in crates/common/src/raindex_client/trades.rs) is kept for backwards compatibility with subgraph logic, but the LocalDb fast-path intentionally returns all trades without implementing pagination.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-06-24T13:36:28.797Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1950
File: crates/common/src/raindex_client/orders.rs:301-301
Timestamp: 2025-06-24T13:36:28.797Z
Learning: In the RaindexClient codebase, when Arc::new(RwLock::new(self.clone())) is used (e.g., in get_orders and get_order_by_hash methods), this creates new Arc/RwLock wrappers around a cloned RaindexClient, but the underlying client data is functionally the same. This pattern is used to provide the correct Arc<RwLock<RaindexClient>> type expected by RaindexOrder::try_from_sg_order() method.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-10-06T11:28:30.692Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2145
File: crates/common/src/raindex_client/local_db/query/fetch_orders/query.sql:6-7
Timestamp: 2025-10-06T11:28:30.692Z
Learning: In `crates/common/src/raindex_client/local_db/query/fetch_orders/query.sql`, the orderbook_address is currently hardcoded to '0x2f209e5b67A33B8fE96E28f24628dF6Da301c8eB' because the system only supports a single orderbook at the moment. Multiorderbook logic is not yet implemented and will be added in the future.
Applied to files:
crates/common/src/raindex_client/vaults.rscrates/common/src/local_db/query/fetch_vaults/query.sql
📚 Learning: 2025-08-26T14:52:37.000Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2099
File: crates/common/src/hyper_rpc.rs:3-7
Timestamp: 2025-08-26T14:52:37.000Z
Learning: In the rain.orderbook codebase, creating new reqwest::Client instances per request in HyperRpcClient is not considered an issue by the maintainers, despite potential performance benefits of client reuse.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-10-02T19:17:20.332Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2163
File: crates/common/src/raindex_client/orders.rs:738-741
Timestamp: 2025-10-02T19:17:20.332Z
Learning: In crates/common/src/raindex_client/orders.rs, fetch_dotrain_source() is intentionally called in try_from_sg_order for every order conversion because the dotrain source information is needed immediately. A future optimization with local DB logic is planned to eliminate the network round-trip concern.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-06-17T16:32:04.554Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1903
File: crates/js_api/src/gui/order_operations.rs:124-134
Timestamp: 2025-06-17T16:32:04.554Z
Learning: In the rain.orderbook codebase, RPC lists are typically small (2 items maximum), so performance optimizations around cloning and converting small Vec<Url> collections are generally unnecessary.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-07-15T08:01:38.534Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1994
File: crates/common/src/raindex_client/vaults.rs:282-292
Timestamp: 2025-07-15T08:01:38.534Z
Learning: In the rainlanguage/rain.orderbook codebase, findolor prefers to avoid concurrency optimizations like using `futures::future::try_join_all` for parallel processing of balance changes, considering such optimizations "not that critical at the moment" when the performance impact is minimal.
Applied to files:
crates/common/src/raindex_client/vaults.rs
📚 Learning: 2025-06-04T10:21:01.388Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.tspackages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-04-08T09:18:46.653Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1597
File: packages/ui-components/src/__tests__/OrderDetail.test.ts:120-120
Timestamp: 2025-04-08T09:18:46.653Z
Learning: In test files for the Rain Orderbook project, it's acceptable to bypass TypeScript's strict typing using constructs like `as unknown as [Type]` to create simplified mock objects that don't need to implement the entire interface.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-04-09T09:40:03.131Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1565
File: packages/webapp/src/__tests__/registryManager.test.ts:20-21
Timestamp: 2025-04-09T09:40:03.131Z
Learning: When mocking browser APIs like localStorage for tests, it's not always necessary to fully implement all interface properties/methods with dynamic behavior. A hardcoded value (like setting length: 0) can be sufficient when the tests don't rely on that specific property.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-07-04T09:14:35.748Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-04-28T10:58:15.675Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1700
File: tauri-app/src/lib/mocks/mockConfigSource.ts:17-20
Timestamp: 2025-04-28T10:58:15.675Z
Learning: In mock configuration files for testing purposes, such as mockConfigSource.ts, inconsistencies between referenced subgraphs and defined subgraphs may be intentional and acceptable for specific test scenarios.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-07-31T19:34:11.716Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2044
File: crates/common/src/raindex_client/vaults_list.rs:363-423
Timestamp: 2025-07-31T19:34:11.716Z
Learning: In the rainlanguage/rain.orderbook project, for WASM-exposed functionality like VaultsList, the team prefers to keep comprehensive tests in the non-WASM environment due to the complexity of recreating objects like RaindexVaults in WASM. WASM tests focus on basic functionality and error cases since the WASM code reuses the already-tested non-WASM implementation.
Applied to files:
packages/ui-components/src/lib/__mocks__/stores.ts
📚 Learning: 2025-10-06T11:44:07.888Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2145
File: crates/common/src/raindex_client/local_db/query/create_tables/query.sql:71-72
Timestamp: 2025-10-06T11:44:07.888Z
Learning: The local DB feature in the rain.orderbook codebase is not live yet (as of PR #2145), so schema migrations for existing databases are not required when modifying table structures in `crates/common/src/raindex_client/local_db/query/create_tables/query.sql`.
Applied to files:
crates/common/src/local_db/query/fetch_vaults/query.sql
📚 Learning: 2025-04-08T16:35:15.127Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
tauri-app/src/routes/vaults/+page.svelte
📚 Learning: 2025-04-08T12:56:03.272Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 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.
Applied to files:
packages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-04-08T12:53:12.526Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1588
File: packages/orderbook/test/js_api/gui.test.ts:2037-2057
Timestamp: 2025-04-08T12:53:12.526Z
Learning: In the remote network test for gui.test.ts, asserting that getCurrentDeployment() succeeds is sufficient validation that remote networks were properly fetched, as this operation would fail if the networks weren't correctly processed.
Applied to files:
packages/ui-components/src/__tests__/ListViewOrderbookFilters.test.ts
📚 Learning: 2025-11-25T16:50:11.197Z
Learnt from: CR
Repo: rainlanguage/rain.orderbook PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-25T16:50:11.197Z
Learning: Applies to packages/{webapp,ui-components}/**/*.{svelte,ts,tsx,js,jsx} : If you modify frontend code or functionality affecting the frontend, you MUST provide a screenshot of the built webapp reflecting your change.
Applied to files:
packages/webapp/src/routes/vaults/+page.svelte
⏰ 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). (18)
- GitHub Check: test
- GitHub Check: git-clean
- GitHub Check: test
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
- GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-browser-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
- GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
- GitHub Check: test
- GitHub Check: Deploy-Preview-Push
- GitHub Check: Deploy-Docs-Preview
- GitHub Check: build-tauri (ubuntu-22.04, true)
| owners: vec![Address::from_str(owner_kept).unwrap()], | ||
| hide_zero_balance: true, | ||
| tokens: Some(vec![Address::from_str(token_kept).unwrap()]), | ||
| only_active_orders: false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial
Consider adding a test case with only_active_orders: true.
The existing tests initialize only_active_orders to false (the default). While this ensures backward compatibility, it would be valuable to have at least one test that exercises the filtering behavior with only_active_orders: true to verify the field is properly propagated through the query pipeline.
This could be addressed in a follow-up if query-level or integration tests already cover this scenario.
Also applies to: 2996-2996, 3052-3052
packages/ui-components/src/lib/components/CheckboxInactiveOrdersVault.svelte
Show resolved
Hide resolved
Change label from "Hide inactive orders vaults" to "Hide vaults without active orders" for better clarity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte(2 hunks)packages/webapp/src/routes/+layout.ts(1 hunks)
🧰 Additional context used
📓 Path-based instructions (7)
packages/webapp/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For Webapp (
packages/webapp), run lints and format checks usingnix develop -c npm run svelte-lint-format-check -w @rainlanguage/webapp
Files:
packages/webapp/src/routes/+layout.ts
packages/webapp/**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For Webapp (
packages/webapp), run tests usingnix develop -c npm run test -w @rainlanguage/webapp
Files:
packages/webapp/src/routes/+layout.ts
packages/{webapp,ui-components}/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
If you modify frontend code or functionality affecting the frontend, you MUST provide a screenshot of the built webapp reflecting your change.
Files:
packages/webapp/src/routes/+layout.tspackages/ui-components/src/lib/components/tables/OrdersListTable.svelte
packages/**/*.{js,ts,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
JavaScript/Svelte organized as
packages/*including webapp, ui-components, and orderbook (wasm wrapper published to npm)
Files:
packages/webapp/src/routes/+layout.tspackages/ui-components/src/lib/components/tables/OrdersListTable.svelte
**/*.{ts,tsx,svelte}
📄 CodeRabbit inference engine (AGENTS.md)
**/*.{ts,tsx,svelte}: TypeScript/Svelte: format withnix develop -c npm run format
TypeScript/Svelte: lint withnix develop -c npm run lint
TypeScript/Svelte: type-check withnix develop -c npm run check
Files:
packages/webapp/src/routes/+layout.tspackages/ui-components/src/lib/components/tables/OrdersListTable.svelte
packages/ui-components/**/*.{svelte,ts,tsx,js,jsx}
📄 CodeRabbit inference engine (.github/copilot-instructions.md)
For UI components (
packages/ui-components), run lints and format checks usingnix develop -c npm run svelte-lint-format-check -w @rainlanguage/ui-components
Files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
**/*.svelte
📄 CodeRabbit inference engine (AGENTS.md)
Svelte components should use
PascalCase.sveltenaming convention; other files use kebab or snake case as appropriate
Files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
🧠 Learnings (11)
📚 Learning: 2025-05-19T10:39:19.157Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1831
File: packages/ui-components/src/lib/types/transaction.ts:71-77
Timestamp: 2025-05-19T10:39:19.157Z
Learning: In the Rain Orderbook project, `orderHash` is intentionally typed as `string` (not `Hex`) in the `InternalTransactionArgs` interface because it matches the return type of the `getRemoveOrderCalldata` WASM function which returns `Promise<string>`. String operations like `.slice()` are performed on `orderHash` in the code. Meanwhile, `txHash` is typed as `Hex` for blockchain transaction hashes.
Applied to files:
packages/webapp/src/routes/+layout.ts
📚 Learning: 2025-05-19T10:39:19.157Z
Learnt from: hardingjam
Repo: rainlanguage/rain.orderbook PR: 1831
File: packages/ui-components/src/lib/types/transaction.ts:71-77
Timestamp: 2025-05-19T10:39:19.157Z
Learning: In the Rain Orderbook project, `orderHash` is typed as `string` (not `Hex`) in the `InternalTransactionArgs` interface because it comes from the WASM function `getRemoveOrderCalldata` which returns a string value. Meanwhile, `txHash` is typed as `Hex` since it represents an actual blockchain transaction hash that requires the stricter type.
Applied to files:
packages/webapp/src/routes/+layout.ts
📚 Learning: 2025-07-26T06:56:28.207Z
Learnt from: hardyjosh
Repo: rainlanguage/rain.orderbook PR: 2035
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:167-174
Timestamp: 2025-07-26T06:56:28.207Z
Learning: In OrdersListTable.svelte, maintainer hardyjosh considers keyed each-blocks unnecessary for item.inputs and item.outputs arrays because the entire query result updates at once during refresh, making DOM diffing optimizations negligible when the whole dataset is replaced rather than individual items being modified.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-06-27T17:34:15.825Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 1957
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:60-60
Timestamp: 2025-06-27T17:34:15.825Z
Learning: In the VaultsListTable.svelte component, the `activeAccounts` store is redundant in query keys when the `owners` variable (derived from `activeAccountsItems`) is already included, as `owners` is what's actually used in the query function while `activeAccounts` is just a transformed version of the same data.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-12-11T07:46:29.747Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 2358
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:82-85
Timestamp: 2025-12-11T07:46:29.747Z
Learning: In OrdersListTable.svelte, when implementing the token filter, intentionally set both inputs and outputs to the same selectedTokens array to achieve OR filtering across inputs or outputs. This design ensures the single UI token filter matches orders containing the selected token(s) in either inputs OR outputs, rather than applying a pair-specific filter. Note: the API may support more granular directional filtering, but the UI should use the same tokens for both fields to provide broader matching. This is a file-specific behavior to preserve: (a) UX consistency, and (b) avoid misalignment between UI selection and backend filtering.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-08-19T04:15:33.633Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2036
File: packages/ui-components/src/lib/components/ListViewVaultFilters.svelte:33-52
Timestamp: 2025-08-19T04:15:33.633Z
Learning: In the ListViewVaultFilters.svelte component, the "Show my items only" filter is intentionally destructive for the owners field. When toggled, it should replace any existing owner filters (including those from URL parameters) rather than being additive. This is by design because the UI doesn't provide capability to filter by other owner addresses or remove specific owners from a list. The toggle serves as both a filter and a way for users to clear URL-based owner filters and switch to filtering by their own address only.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-04-11T06:05:46.473Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1599
File: tauri-app/src/routes/orders/add/+page.svelte:287-287
Timestamp: 2025-04-11T06:05:46.473Z
Learning: The ScenarioDebugTable component in tauri-app/src/routes/orders/add/+page.svelte has been designed to manage its own data fetching internally without requiring a chartData prop.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-08-14T14:16:34.044Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2083
File: packages/ui-components/src/lib/components/tables/VaultsListTable.svelte:205-205
Timestamp: 2025-08-14T14:16:34.044Z
Learning: In the VaultsListTable component, the `matchesAccount` function from the wallet provider may not properly update on wallet connect/disconnect events, making direct comparison with the reactive `$account` variable more reliable for UI visibility checks. The `matchesAccount` function needs future refactoring to handle wallet state changes properly.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-07-17T10:36:02.846Z
Learnt from: findolor
Repo: rainlanguage/rain.orderbook PR: 1996
File: packages/ui-components/src/__tests__/VaultIdInformation.test.ts:6-6
Timestamp: 2025-07-17T10:36:02.846Z
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.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-07-24T08:16:47.393Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 2002
File: tauri-app/src/lib/components/ModalMultipleVaultsWithdraw.svelte:20-25
Timestamp: 2025-07-24T08:16:47.393Z
Learning: In the Rain OrderBook Tauri app, modal components directly mutate the `open` prop (setting `open = false`) as a consistent pattern across the codebase. This approach is maintained for consistency even though it violates typical Svelte one-way data flow, with plans to refactor all modals together in the future rather than making isolated changes.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
📚 Learning: 2025-06-27T18:41:18.194Z
Learnt from: brusherru
Repo: rainlanguage/rain.orderbook PR: 1957
File: packages/ui-components/src/lib/components/tables/OrdersListTable.svelte:86-94
Timestamp: 2025-06-27T18:41:18.194Z
Learning: In the rain.orderbook UI components, the tokensQuery should use `enabled: true` rather than `Object.keys($activeSubgraphs).length > 0` because tokens are needed for filtering functionality even when no specific subgraphs are selected. The multiSubgraphArgs falls back to default subgraphs from settings, so disabling the query when no subgraphs are active would break the token filtering feature.
Applied to files:
packages/ui-components/src/lib/components/tables/OrdersListTable.svelte
⏰ 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). (18)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-static)
- GitHub Check: standard-tests (ubuntu-latest, test-js-bindings)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-rs-artifacts, true)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-static)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, ob-rs-test, true)
- GitHub Check: test
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-artifacts)
- GitHub Check: standard-tests (ubuntu-latest, rainix-wasm-browser-test)
- GitHub Check: standard-tests (ubuntu-latest, rainix-sol-legal)
- GitHub Check: git-clean
- GitHub Check: test
- GitHub Check: test
- GitHub Check: Deploy-Docs-Preview
- GitHub Check: build-tauri (ubuntu-22.04, true)
- GitHub Check: Deploy-Preview-Push
🔇 Additional comments (3)
packages/webapp/src/routes/+layout.ts (1)
102-102: LGTM! Clean implementation following existing patterns.The new
hideInactiveOrdersVaultsstore is correctly initialized and follows the same pattern as other boolean filter stores in the layout. The default value offalseis appropriate, ensuring all vaults are shown by default.For consistency with line 97-98's comment on
showInactiveOrders, you could consider adding a brief comment explaining the default behavior, though this is entirely optional.packages/ui-components/src/lib/components/tables/OrdersListTable.svelte (2)
101-112: The vault-specific filter is already properly handled with conditional rendering.CheckboxInactiveOrdersVaultonly displays whenisVaultsPageis true (line 59), meaning it never appears in the orders context. The prop pass-through pattern is correct by design—ListViewOrderbookFiltersis a shared component that conditionally shows different filters based on page context.Likely an incorrect or invalid review comment.
38-38: Ensure coding guidelines are followed for UI changes.Per the coding guidelines, "If you modify frontend code or functionality affecting the frontend, you MUST provide a screenshot of the built webapp reflecting your change." The PR objectives note that screenshots were not provided, but since this change adds a new filter UI component, screenshots are required.
Please provide screenshots showing:
- The OrdersListTable with the new filter (if visible in this context)
- The behavior when the
hideInactiveOrdersVaultsfilter is toggled (if applicable here)Additionally, ensure linting and formatting checks pass:
#!/bin/bash # Description: Run lints and format checks for UI components nix develop -c npm run svelte-lint-format-check -w @rainlanguage/ui-componentsAs per coding guidelines for
packages/ui-components/**/*.{svelte,ts,tsx,js,jsx}.Also applies to: 101-112
Motivation
In the vaults list page we needed a way to filter out the vaults that only has inactive orders. This PR implements that filtering for both subgraph and local db.
Solution
Results without the filter
Results with the filter
Checks
By submitting this for review, I'm confirming I've done the following:
Summary by CodeRabbit
New Features
Tests
✏️ Tip: You can customize this high-level summary in your review settings.