feat(dashnote): split settings into tab, menu, and focused login modal#80
Conversation
LoginModal stripped to the unauthenticated flow only. Account management moves to a Settings tab (Identity, Contract, Data, Appearance, Danger zone) and an IdentityCard popover (Settings, Switch identity, Log out when authed; one-click login when readonly). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces a Settings feature to the Dashnote example app. A new "settings" tab is added to navigation alongside notes and how-it-works. The SettingsPanel component provides identity display, contract management, local cache clearing, theme toggling, and device memory controls. LoginModal is simplified from dual-mode (login/settings) to login-only, with contract registration moved to SettingsPanel via a new useContractRegistration hook. IdentityCard is refactored to include a dropdown menu with Settings, Switch identity, and Log out actions. Component callbacks are separated: onOpenLogin for authentication flows and onOpenSettings for settings navigation. ChangesSettings Tab and Infrastructure
IdentityCard Menu and Navigation
LoginModal Simplification and App Routing
Component Prop Threading for Login and Settings
Test Coverage for Settings Feature
🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run the 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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (2)
example-apps/dashnote/src/components/NotesWorkspace.tsx (1)
34-40: ⚡ Quick winUse an interface for
NotesWorkspaceprops instead of an inline object type.This changed prop contract is currently defined inline; convert it to an interface to match project TypeScript conventions.
As per coding guidelines "Use interface for defining object shapes in TypeScript".Proposed diff
+interface NotesWorkspaceProps { + onOpenLogin: () => void; + onOpenSettings: () => void; +} + export function NotesWorkspace({ onOpenLogin, onOpenSettings, -}: { - onOpenLogin: () => void; - onOpenSettings: () => void; -}) { +}: NotesWorkspaceProps) {🤖 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 `@example-apps/dashnote/src/components/NotesWorkspace.tsx` around lines 34 - 40, Replace the inline object type for the NotesWorkspace component props with a named interface: create an interface NotesWorkspaceProps that declares onOpenLogin: () => void and onOpenSettings: () => void, then update the NotesWorkspace signature to use NotesWorkspaceProps (e.g., export function NotesWorkspace(props: NotesWorkspaceProps) or export function NotesWorkspace({ onOpenLogin, onOpenSettings }: NotesWorkspaceProps)). Ensure the interface name (NotesWorkspaceProps) is exported if the props type is used elsewhere.example-apps/dashnote/src/components/SettingsPanel.tsx (1)
62-68: ⚡ Quick winUse an interface for
Sectionprops.Replace the inline object shape with an interface to match the project’s TypeScript rule.
As per coding guidelines: `example-apps/dashnote/**/*.{ts,tsx}`: Use interface for defining object shapes in TypeScript.Proposed fix
+interface SectionProps { + title: string; + children: React.ReactNode; +} + function Section({ title, children, -}: { - title: string; - children: React.ReactNode; -}) { +}: SectionProps) {🤖 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 `@example-apps/dashnote/src/components/SettingsPanel.tsx` around lines 62 - 68, The Section component currently declares its props with an inline object type; define a named interface (e.g., SectionProps) that declares title: string and children: React.ReactNode, then update the function signature to use SectionProps (function Section(props: SectionProps) or function Section({ title, children }: SectionProps)). Update any related references to the props type name so the file conforms to the project's rule requiring interfaces for object shapes.
🤖 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 `@example-apps/dashnote/src/hooks/useContractRegistration.ts`:
- Around line 19-37: The register() callback can be called concurrently causing
duplicate contract deployments; add an internal re-entrancy guard (e.g., a
useRef flag like isRegisteringRef) and check it at the top of register() before
proceeding, set the flag true immediately when starting, and clear it in the
finally block to prevent concurrent invocations; keep the existing
setRegistering state updates and error handling but use the ref to short-circuit
early (return null) if an invocation is already in-flight; update the register
callback reference in useCallback so the guard is stable across renders.
---
Nitpick comments:
In `@example-apps/dashnote/src/components/NotesWorkspace.tsx`:
- Around line 34-40: Replace the inline object type for the NotesWorkspace
component props with a named interface: create an interface NotesWorkspaceProps
that declares onOpenLogin: () => void and onOpenSettings: () => void, then
update the NotesWorkspace signature to use NotesWorkspaceProps (e.g., export
function NotesWorkspace(props: NotesWorkspaceProps) or export function
NotesWorkspace({ onOpenLogin, onOpenSettings }: NotesWorkspaceProps)). Ensure
the interface name (NotesWorkspaceProps) is exported if the props type is used
elsewhere.
In `@example-apps/dashnote/src/components/SettingsPanel.tsx`:
- Around line 62-68: The Section component currently declares its props with an
inline object type; define a named interface (e.g., SectionProps) that declares
title: string and children: React.ReactNode, then update the function signature
to use SectionProps (function Section(props: SectionProps) or function Section({
title, children }: SectionProps)). Update any related references to the props
type name so the file conforms to the project's rule requiring interfaces for
object shapes.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: cbeba858-d25b-42da-b23b-71c628946201
📒 Files selected for processing (14)
example-apps/dashnote/src/App.tsxexample-apps/dashnote/src/components/AppShell.tsxexample-apps/dashnote/src/components/IdentityCard.tsxexample-apps/dashnote/src/components/LoginModal.tsxexample-apps/dashnote/src/components/NoteEditor.tsxexample-apps/dashnote/src/components/NotesWorkspace.tsxexample-apps/dashnote/src/components/SettingsPanel.tsxexample-apps/dashnote/src/components/Tabs.tsxexample-apps/dashnote/src/hooks/useContractRegistration.tsexample-apps/dashnote/test/App.test.tsxexample-apps/dashnote/test/IdentityCard.test.tsxexample-apps/dashnote/test/LoginModal.test.tsxexample-apps/dashnote/test/NotesWorkspace.test.tsxexample-apps/dashnote/test/SettingsPanel.test.tsx
The Register button disables once setRegistering(true) commits, but a second click landing in the same task could slip a duplicate publish through. Add a synchronous useRef guard so the second invocation short-circuits before the SDK call. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
LoginModal stripped to the unauthenticated flow only. Account management moves to a Settings tab (Identity, Contract, Data, Appearance, Danger zone) and an IdentityCard popover (Settings, Switch identity, Log out when authed; one-click login when readonly).
Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com
Summary by CodeRabbit
Release Notes