Skip to content

feat(widget): add configurable dashboard yield category tab order#544

Merged
petar-omni merged 1 commit into
mainfrom
feat/dashboard-yield-category-ordering
Jun 24, 2026
Merged

feat(widget): add configurable dashboard yield category tab order#544
petar-omni merged 1 commit into
mainfrom
feat/dashboard-yield-category-ordering

Conversation

@petar-omni

@petar-omni petar-omni commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Allow integrators to reorder RWA, DeFi, and Stake category tabs via dashboardYieldCategoryOrder. Manage and Activity tabs remain fixed. Export DashboardYieldCategory constants and normalize partial or invalid orders to the full category set.

Summary by CodeRabbit

  • New Features

    • Added a configurable dashboard category tab order, letting dashboard tabs appear in a custom sequence.
    • Exposed the category type for easier app configuration and integration.
  • Documentation

    • Updated the README with the new dashboard ordering option and usage examples.
    • Clarified guidance for agent memoization recommendations.
  • Bug Fixes

    • Improved dashboard grouping and category probing so they follow the configured order consistently.
  • Tests

    • Added coverage for category order normalization and dashboard tab ordering.

Allow integrators to reorder RWA, DeFi, and Stake category tabs via
dashboardYieldCategoryOrder. Manage and Activity tabs remain fixed.
Export DashboardYieldCategory constants and normalize partial or invalid
orders to the full category set.
@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e94323e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fa874291-fc00-4648-a19c-d3faf3bfe3fb

📥 Commits

Reviewing files that changed from the base of the PR and between 660ad89 and e94323e.

📒 Files selected for processing (11)
  • AGENTS.md
  • README.md
  • packages/widget/src/domain/types/yields.ts
  • packages/widget/src/hooks/api/use-dashboard-yield-catalog.ts
  • packages/widget/src/index.bundle.ts
  • packages/widget/src/index.package.ts
  • packages/widget/src/pages-dashboard/overview/positions/hooks/use-grouped-positions.ts
  • packages/widget/src/providers/settings/index.tsx
  • packages/widget/src/providers/settings/types.ts
  • packages/widget/tests/domain/dashboard-yield-category-types.test.ts
  • packages/widget/tests/use-cases/renders-initial-page.test.tsx

📝 Walkthrough

Walkthrough

Introduces a dashboardYieldCategoryOrder configurable prop that controls the display order of RWA, DeFi, and Stake tabs in the dashboard variant. Refactors DashboardYieldCategory to an as const object, adds a normalizeDashboardYieldCategoryOrder helper, wires the setting through the settings provider and context, updates consumer hooks, exports the type publicly, and documents the new option.

Changes

Configurable Dashboard Category Tab Order

Layer / File(s) Summary
DashboardYieldCategory type and normalization helper
packages/widget/src/domain/types/yields.ts
Refactors the type from a string-literal union to an as const object, derives DashboardYieldCategory from it, updates dashboardYieldCategories, and adds the exported normalizeDashboardYieldCategoryOrder helper that validates, deduplicates, and fills missing categories.
Settings types contract and provider wiring
packages/widget/src/providers/settings/types.ts, packages/widget/src/providers/settings/index.tsx
Adds optional dashboardYieldCategoryOrder to SettingsProps, makes it required in ResolvedSettingsProps, and wires normalizeDashboardYieldCategoryOrder into SettingsContextProvider so the computed value flows through context.
Consumer hooks updated to settings-driven order
packages/widget/src/hooks/api/use-dashboard-yield-catalog.ts, packages/widget/src/pages-dashboard/overview/positions/hooks/use-grouped-positions.ts
useDashboardYieldCatalog reads dashboardYieldCategoryOrder from useSettings to build probe queries and seed initial selection; useGroupedPositions iterates dashboardYieldCategoryOrder from settings instead of the static array.
Public exports and documentation
packages/widget/src/index.bundle.ts, packages/widget/src/index.package.ts, README.md, AGENTS.md
Re-exports DashboardYieldCategory from both entry points; README gains a new dashboardYieldCategoryOrder prop entry and "Dashboard category tab order" subsection with a usage example; AGENTS.md simplifies React Compiler guidance.
Unit and integration tests
packages/widget/tests/domain/dashboard-yield-category-types.test.ts, packages/widget/tests/use-cases/renders-initial-page.test.tsx
New normalizeDashboardYieldCategoryOrder test suite covers default, custom, deduplication, and invalid-input cases; new integration test renders dashboard with a custom category order and asserts tab presence and ordering.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • stakekit/widget#527: Introduced the category-scoped probing hook useDashboardYieldCatalog, which this PR modifies to drive its probe and initial-selection order from dashboardYieldCategoryOrder.
  • stakekit/widget#539: Added yieldGrouping-based conditional grouping to useGroupedPositions, the same hook this PR updates to switch its category iteration to dashboardYieldCategoryOrder.

Suggested reviewers

  • jdomingos
  • Philippoes
  • dnehl

Poem

🐇 Hippity-hop through the yield tabs we go,
RWA, DeFi, Stake — ordered just so!
A const object blooms where string literals stood,
Normalize, deduplicate — all working as it should.
The rabbit rearranges with one tidy prop,
Dashboard tabs dance now — and won't ever stop! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is missing the required Added and Changed sections from the template and doesn't separate new vs modified behavior. Rewrite it with both ## Added and ## Changed sections, summarizing the new tab-order option, exported constants, and normalization behavior.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: configurable dashboard yield category tab order.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashboard-yield-category-ordering

Comment @coderabbitai help to get the list of available commands.

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-544.df4xyoi0xyeak.amplifyapp.com

@aws-amplify-eu-central-1

Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-544.d2ribjy8evqo6h.amplifyapp.com

@jdomingos jdomingos left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@dnehl dnehl left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

nothing else spotted

@petar-omni petar-omni merged commit 9cb3e95 into main Jun 24, 2026
8 checks passed
@petar-omni petar-omni deleted the feat/dashboard-yield-category-ordering branch June 24, 2026 11:31
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.

3 participants