Skip to content

feat: add Custom RPC settings UI - #299

Open
nicoletting wants to merge 4 commits into
mainfrom
feat/custom-rpc-ui
Open

feat: add Custom RPC settings UI#299
nicoletting wants to merge 4 commits into
mainfrom
feat/custom-rpc-ui

Conversation

@nicoletting

@nicoletting nicoletting commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

What changed

Popup UI for the Custom RPC node feature — settings entry, node list with select/delete, and add-node flow.

ui/general/ (new shared components)

  • Button — variant (primary/secondary) × size (md 46px / lg 62px), disabled + loading states
  • ActionSheet — generic bottom-sheet overlay shell
  • SegmentedControl — generic pill tab switcher (e.g. Mainnet/Testnet)
  • PageHeader — extended with an optional right-side action icon (e.g. edit pencil)

ui/popup/custom-rpc/

  • CustomRpcPage — node list screen: network tabs, node rows, edit mode (delete, default node excluded), opens the add-node sheet
  • NodeListItem — node row (icon, name, Default tag, url, select/remove)
  • AddCustomNodeForm — add-node form (Node Name + RPC URL, error/loading states) rendered inside ActionSheet

ui/popup/settings/

  • CustomRpcSettingsSection — Network + Custom RPC rows (for the existing Settings screen, not yet rebuilt in ui/)
  • SettingRow — generic settings row (label · value · chevron)

Fix: icy-blue-200 was truncated to 5 hex digits in tailwind.config.js (#a2f5f, invalid) — corrected to #a2f5ff per Figma, and Button's loading spinner now uses the token instead of a raw hex.

Design reference

Figma: Kastle Extension → Setting page → "custom rpc" section (node 12703:143874).

Storybook

All states covered — Popup/CustomRpc/{Components,Screens}, Popup/Settings/Components, General/{Button,ActionSheet,SegmentedControl,PageHeader}. Run npm run storybook.

Notes for Dev

  • Pure UI only — no data/routing wiring yet (Custom RPC node list/selection/network switching all take props; DataFlow integration is a separate step).
  • PR is on the large side (component-first build for a new feature area) but is one cohesive unit — happy to split into smaller PRs if you'd prefer smaller review chunks.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Introduced custom RPC UI for managing mainnet/testnet nodes, including selecting, editing, removing, and adding custom nodes.
    • Added new reusable UI components: ActionSheet, Button (with loading/disabled states), SegmentedControl, and Settings row; enhanced Page Header with configurable right-side action.
    • Added Storybook coverage for the new and updated components, including interactive scenarios.
  • Bug Fixes
    • Corrected the icy-blue Tailwind palette value to restore consistent color rendering.

nicoletting and others added 2 commits July 14, 2026 23:08
Popup pages + reusable components for the Custom RPC node list, edit/delete flow, and add-node action sheet. Extends PageHeader with an optional right-side action icon; adds Button, SegmentedControl, and ActionSheet to ui/general/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
tailwind.config.js had icy-blue-200 truncated to 5 hex digits (#a2f5f), making the token invalid. Fixed to #a2f5ff per Figma, and swapped Button's spinner from a raw hex to the token now that it resolves correctly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@nicoletting, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 54 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 088d4691-fa85-4a3f-8c70-a38814b8b7cd

📥 Commits

Reviewing files that changed from the base of the PR and between 985db41 and 3da281a.

📒 Files selected for processing (5)
  • ui/general/ActionSheet.tsx
  • ui/popup/custom-rpc/AddCustomNodeForm.tsx
  • ui/popup/custom-rpc/CustomRpcPage.stories.tsx
  • ui/popup/custom-rpc/NodeListItem.tsx
  • ui/popup/settings/SettingRow.tsx

Note

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized keys: "labels", "include_paths", "exclude_paths", "filters", "review", "pull_request", "limits", "commands", "messages"
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • 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
📝 Walkthrough

Walkthrough

Adds reusable UI primitives, Custom RPC settings and management components, PageHeader right-action support, Storybook stories for new states and flows, a Lucide dependency, Storybook launch configuration, and a Tailwind color correction.

Changes

Custom RPC UI

Layer / File(s) Summary
General UI primitives and development setup
.claude/launch.json, package.json, tailwind.config.js, ui/general/*
Adds Button, ActionSheet, and SegmentedControl components, extends PageHeader with a right-side action, and adds their Storybook configurations and stories.
Custom RPC settings rows
ui/popup/settings/*
Adds SettingRow and CustomRpcSettingsSection components with Storybook states for values, actions, chevrons, and long labels.
RPC node and add-node controls
ui/popup/custom-rpc/AddCustomNodeForm.*, ui/popup/custom-rpc/NodeListItem.*
Adds controlled RPC node forms and node rows supporting validation, submission, selection, edit-mode removal, and corresponding stories.
Custom RPC page orchestration
ui/popup/custom-rpc/CustomRpcPage.*
Adds network selection, node management, edit-mode controls, add-node sheet integration, and interactive page stories.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant CustomRpcPage
  participant SegmentedControl
  participant NodeListItem
  participant ActionSheet
  participant AddCustomNodeForm

  User->>SegmentedControl: choose network
  SegmentedControl->>CustomRpcPage: report network change
  User->>NodeListItem: select or remove node
  NodeListItem->>CustomRpcPage: report node action
  User->>CustomRpcPage: open add-node flow
  CustomRpcPage->>ActionSheet: render add-node sheet
  ActionSheet->>AddCustomNodeForm: provide controlled form
  AddCustomNodeForm->>CustomRpcPage: submit node data
Loading

Possibly related PRs

  • forbole/kastle#292: Adds the PageHeader component that this PR extends with right-side action support.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 9.09% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding the Custom RPC settings UI.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/custom-rpc-ui

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

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@ui/general/Button.stories.tsx`:
- Line 2: Replace the relative imports with the configured `@/` aliases in
ui/general/Button.stories.tsx lines 2-2, ui/general/ActionSheet.stories.tsx
lines 3-4, and ui/general/SegmentedControl.stories.tsx lines 3-3; target the
Button, ActionSheet, AddCustomNodeForm, and SegmentedControl imports
respectively, with no other changes.

In `@ui/popup/custom-rpc/AddCustomNodeForm.tsx`:
- Around line 34-44: Associate both form labels with their inputs in
AddCustomNodeForm: set the “Node Name” label’s htmlFor to a unique matching
input id such as node-name, and set the “RPC URL” label’s htmlFor to a matching
id such as rpc-url on the corresponding input.

In `@ui/popup/custom-rpc/NodeListItem.tsx`:
- Around line 27-31: Update the selectable item div in NodeListItem to include
tabIndex={0} and an onKeyDown handler that invokes onSelect for Enter and Space
keys, while preserving the existing canSelect guard and click behavior.

In `@ui/popup/settings/SettingRow.tsx`:
- Around line 23-29: Update the label and value elements in SettingRow to
truncate overflowing text with an ellipsis, and apply appropriate
flex-shrink/min-width behavior to the text and its containing flex items.
Preserve the chevron’s visibility and ensure long LongNodeName-style content
remains within the fixed-width popup.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

Run ID: 0980129d-2a79-474b-9606-a492e59560f3

📥 Commits

Reviewing files that changed from the base of the PR and between d8fcfbf and 413ee29.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (21)
  • .claude/launch.json
  • package.json
  • tailwind.config.js
  • ui/general/ActionSheet.stories.tsx
  • ui/general/ActionSheet.tsx
  • ui/general/Button.stories.tsx
  • ui/general/Button.tsx
  • ui/general/PageHeader.stories.tsx
  • ui/general/PageHeader.tsx
  • ui/general/SegmentedControl.stories.tsx
  • ui/general/SegmentedControl.tsx
  • ui/popup/custom-rpc/AddCustomNodeForm.stories.tsx
  • ui/popup/custom-rpc/AddCustomNodeForm.tsx
  • ui/popup/custom-rpc/CustomRpcPage.stories.tsx
  • ui/popup/custom-rpc/CustomRpcPage.tsx
  • ui/popup/custom-rpc/NodeListItem.stories.tsx
  • ui/popup/custom-rpc/NodeListItem.tsx
  • ui/popup/settings/CustomRpcSettingsSection.stories.tsx
  • ui/popup/settings/CustomRpcSettingsSection.tsx
  • ui/popup/settings/SettingRow.stories.tsx
  • ui/popup/settings/SettingRow.tsx

@@ -0,0 +1,62 @@
import type { Meta, StoryObj } from "@storybook/react";
import Button from "./Button";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win

Use absolute path aliases for imports.

As per coding guidelines, use @/ path aliases for absolute imports instead of relative paths.

  • ui/general/Button.stories.tsx#L2-L2: Update the import to use import Button from "@/ui/general/Button";
  • ui/general/ActionSheet.stories.tsx#L3-L4: Update the imports to use @/ui/general/ActionSheet and @/ui/popup/custom-rpc/AddCustomNodeForm.
  • ui/general/SegmentedControl.stories.tsx#L3-L3: Update the import to use import SegmentedControl from "@/ui/general/SegmentedControl";
📍 Affects 3 files
  • ui/general/Button.stories.tsx#L2-L2 (this comment)
  • ui/general/ActionSheet.stories.tsx#L3-L4
  • ui/general/SegmentedControl.stories.tsx#L3-L3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@ui/general/Button.stories.tsx` at line 2, Replace the relative imports with
the configured `@/` aliases in ui/general/Button.stories.tsx lines 2-2,
ui/general/ActionSheet.stories.tsx lines 3-4, and
ui/general/SegmentedControl.stories.tsx lines 3-3; target the Button,
ActionSheet, AddCustomNodeForm, and SegmentedControl imports respectively, with
no other changes.

Source: Coding guidelines

Comment thread ui/popup/custom-rpc/AddCustomNodeForm.tsx
Comment thread ui/popup/custom-rpc/NodeListItem.tsx
Comment thread ui/popup/settings/SettingRow.tsx Outdated
nicoletting and others added 2 commits July 15, 2026 13:13
- Use @/ path aliases instead of relative imports (matches existing ui/ convention)
- AddCustomNodeForm: associate labels with inputs via htmlFor/id
- NodeListItem: add tabIndex + onKeyDown (Enter/Space) for keyboard nav on the role="button" row
- SettingRow: truncate long label/value text instead of overflowing the fixed-width popup

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Fixes the CI "submit" check that was failing on formatting.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@nicoletting
nicoletting requested a review from leobragaz July 28, 2026 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant