Skip to content

add Euclid 3.0 settings screens, tunnel flow, and audit pipeline skills#1858

Merged
transphorm merged 7 commits intodevfrom
feat/euclid-settings-screens-rd2
Mar 24, 2026
Merged

add Euclid 3.0 settings screens, tunnel flow, and audit pipeline skills#1858
transphorm merged 7 commits intodevfrom
feat/euclid-settings-screens-rd2

Conversation

@transphorm
Copy link
Copy Markdown
Member

@transphorm transphorm commented Mar 24, 2026

Summary

  • Add settings sub-screens (Security, Notifications, Dev Mode) using Euclid 3.0 components
  • Add PoC tunnel flow with tour, country/ID-type selection, KYC mock, proving, and result screens
  • Migrate all euclid imports from @selfxyz/euclid-web to @selfxyz/euclid (v1.2.0)
  • Add 3 Claude Code skills for PR audit pipeline: /pr-audit, /gaps-to-issues, /spec-from-audit
  • Deprecate specs/ folder — specs now live in Linear as documents attached to issues
  • Add merged audit doc with follow-up issues linked

Changes

WebView App

  • Restructured Settings menu into "App settings", "Support & feedback", and "Developer tools" sections
  • Added SecurityScreen, NotificationPreferencesScreen, and DevModeScreen
  • Added tunnel flow screens (TourScreen, KycMockScreen, TunnelCountryPickerScreen, TunnelIDTypeScreen, TunnelProofReceiptScreen, TunnelProvingScreen, TunnelResultScreen)
  • Migrated all imports from @selfxyz/euclid-web to @selfxyz/euclid
  • Fixed remaining euclid-web imports in ProviderLaunchScreen and ProviderResultScreen

Claude Code Skills

  • /pr-audit — multi-agent review (component + integration + routing), produces audit doc
  • /gaps-to-issues — creates Linear issues from audit PR buckets (lightweight bodies, spec is source of truth)
  • /spec-from-audit — generates agent-executable specs as Linear documents, one per issue

Agentic Docs

  • Updated CLAUDE.md: specs live in Linear, specs/ deprecated, added "decisions not options" spec-writing principle
  • Updated app/AGENTS.md and mobile-sdk-alpha/AGENTS.md: point to Linear for specs

Docs

  • Added PR audit doc (docs/reviews/2026-03-23-euclid-settings-tunnel-audit.md)

Linear Issues

Known Gaps (tracked as follow-up issues)

  • SELF-2357 — Euclid migration: validate exports + API compatibility (Urgent)
  • SELF-2358 — Sumsub / WV-05 contract compliance (High)
  • SELF-2359 — Tunnel + proving flow data propagation fixes (High)
  • SELF-2360 — Settings persistence, test coverage, doc cleanup (Medium)

Each issue has a spec attached as a Linear document (source of truth for implementation).

Test Plan

  • cd packages/webview-app && yarn build passes
  • Settings → Security, Notifications, Dev Mode screens render correctly
  • Tunnel flow navigates end-to-end

🤖 Generated with Claude Code

Summary by CodeRabbit

Release Notes

  • New Features

    • Added Security, Notification Preferences, and Developer Mode screens accessible from Settings
    • Reorganized Settings interface with new "App settings," "Support & feedback," and "Developer tools" sections
    • Introduced multi-step identification verification flow with tour, country selection, ID type choice, and result confirmation
  • Documentation

    • Added implementation guides for settings integration and workflow documentation
  • Chores

    • Updated core library dependencies to latest versions

Tranquil-Flow and others added 4 commits March 23, 2026 20:05
Add SecurityScreen, NotificationPreferencesScreen, and DevModeScreen
wrappers that import Euclid 3.0 components and wire them with React
Router navigation and bridge adapters. Update SettingsScreen menu items
to navigate to real routes instead of /coming-soon.

Requires @selfxyz/euclid-web to be published with the new screen exports
(SecurityScreen, NotificationPreferencesScreen, DevModeScreen) before
type-check will pass. See docs/superpowers/plans/ for full context.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 24, 2026

📝 Walkthrough

Walkthrough

Adds Euclid v1.2.0 imports and routes, three new Settings sub-screens (Security, Notifications, Dev Mode), a multi-step tunnel/KYC flow (7 screens), routing updates in App.tsx, numerous import-source migrations from @selfxyz/euclid-web@selfxyz/euclid, and planning/audit docs describing blockers and verification steps.

Changes

Cohort / File(s) Summary
Documentation & Planning
docs/superpowers/plans/2026-03-22-settings-handover.md, docs/superpowers/plans/2026-03-22-settings-screen-integration.md, docs/reviews/2026-03-23-euclid-settings-tunnel-audit.md, CLAUDE.md, .claude/skills/*
New handover/implementation plan and audit docs; added Claude skill specs and updated spec/workflow guidance. Documents list a blocker: published Euclid exports mismatch and validation commands to run after dependency update.
Dependency Updates
packages/webview-app/package.json
Switched dependency from @selfxyz/euclid-web@^1.0.2 to @selfxyz/euclid@^1.2.0; bumped @selfxyz/euclid-core to ^1.2.0.
App Routing
packages/webview-app/src/App.tsx
Added routes for settings sub-screens and tunnel flow (including /settings/security, /settings/notifications, /settings/dev-mode, /tunnel/tour/:step, /tunnel/kyc, registration/id-type, proof steps).
Settings Sub-Screens
packages/webview-app/src/screens/account/SecurityScreen.tsx, packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx, packages/webview-app/src/screens/account/DevModeScreen.tsx
New wrapper screens mapping Euclid components to app navigation/handlers: local state (toggles, dialog visibility, mock values), haptics, analytics events, and navigation callbacks. Some actions remain stubs routing to /coming-soon or are local-only.
Settings Menu Update
packages/webview-app/src/screens/account/SettingsScreen.tsx
Menu content and icons updated: section renames, removed Cloud backup, added Notifications and Developer tools (Dev mode, Tunnel flow). Several items now navigate to the new settings routes.
Tunnel KYC Flow Screens
packages/webview-app/src/screens/tunnel/TourScreen.tsx, .../KycMockScreen.tsx, .../TunnelCountryPickerScreen.tsx, .../TunnelIDTypeScreen.tsx, .../TunnelProofReceiptScreen.tsx, .../TunnelProvingScreen.tsx, .../TunnelResultScreen.tsx
Seven new screens implementing a sequential tour/KYC/proof flow with mocked data, route-state passing, timed transitions, and navigation between steps.
Import Source Migrations
packages/webview-app/src/screens/... (ComingSoonScreen, HomeScreen, multiple onboarding/proving/verification screens)
Systematic import updates from @selfxyz/euclid-web@selfxyz/euclid; minor prop rename (onSignUpPressonNotifyPress) and a new hardcoded documentType prop in ProvingScreen.
Small UI/Additions
packages/webview-app/src/screens/tunnel/*, packages/webview-app/src/screens/account/*
Added small helper screens/components (KYC mock, country/id pickers) and UI wiring; several handlers use analytics and haptic feedback.

Sequence Diagram(s)

sequenceDiagram
    participant User as "User"
    participant Router as "React Router"
    participant EuclidUI as "Euclid UI\n(`@selfxyz/euclid`)"
    participant AppLogic as "App Logic\n(state, analytics, haptics)"

    User->>EuclidUI: Tap "Start tour" (/tunnel/tour/1)
    EuclidUI->>Router: navigate('/tunnel/tour/1')
    Router->>TourScreen: render step 1
    User->>TourScreen: Next
    TourScreen->>Router: navigate('/tunnel/tour/2')
    Router->>TourScreen: render step 2
    User->>Router: select country (TunnelCountryPicker)
    TunnelCountryPicker->>AppLogic: set location.state {countryCode, documentTypes}
    AppLogic->>Router: navigate('/tunnel/registration/id-type', state)
    Router->>TunnelIDTypeScreen: render with state
    User->>TunnelIDTypeScreen: choose id type
    TunnelIDTypeScreen->>Router: navigate('/tunnel/proof/receipt')
    Router->>TunnelProofReceiptScreen: render receipt
    User->>TunnelProofReceiptScreen: confirm
    TunnelProofReceiptScreen->>Router: navigate('/tunnel/proof/generating')
    Router->>TunnelProvingScreen: render generating
    TunnelProvingScreen->>AppLogic: start timeout -> navigate('/tunnel/proof/result')
    Router->>TunnelResultScreen: render success
    User->>TunnelResultScreen: Continue -> Router: navigate('/')
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

codex

Suggested reviewers

  • remicolin

Poem

🎯 From euclid-web to euclid's light,
New settings screens and tunnels take flight,
Security, toggles, dev mode play,
KYC steps guide the user’s way.
Docs and plans mark the flight tonight. ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely describes the main deliverables: Euclid 3.0 settings screens, tunnel flow implementation, and the new audit pipeline skills.
Description check ✅ Passed The PR description comprehensively covers all major changes, provides clear organization with sections for WebView App, Claude Code Skills, and Agentic Docs, and includes linked Linear issues and a defined test plan.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ 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/euclid-settings-screens-rd2

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 and usage tips.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b547a3152

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/webview-app/package.json
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

🧹 Nitpick comments (11)
packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx (1)

36-45: Consider memoizing toggle handlers.

The toggles array and its onToggleChange handlers are recreated on every render. For a small list this is acceptable, but wrapping in useMemo with toggleValues as a dependency would be cleaner.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx`
around lines 36 - 45, The toggles array and its onToggleChange handlers are
recreated every render; wrap the creation of toggles in a useMemo to memoize
them — compute toggles with useMemo(() => defaultToggles.map(t => ({ label:
t.label, description: t.description, value: toggleValues[t.key] ?? false,
onToggleChange: (value: boolean) => { haptic.trigger('selection');
analytics.trackEvent('notification_toggle_changed', { key: t.key, value });
setToggleValues(prev => ({ ...prev, [t.key]: value })); }, })), [defaultToggles,
toggleValues]) so that toggles, onToggleChange, and their closures only update
when defaultToggles or toggleValues change; keep references to haptic,
analytics, and setToggleValues as-is.
packages/webview-app/src/screens/tunnel/TunnelProvingScreen.tsx (1)

9-13: Mock timer in production-accessible route.

This screen uses a hardcoded 3-second delay with mock data instead of actual proof generation. Per the routing in App.tsx, /tunnel/proof/generating is publicly accessible without feature flags or dev-mode guards.

Consider either:

  1. Gating the tunnel routes behind a dev-mode or feature flag check
  2. Adding a TODO/comment clarifying this is PoC code pending real integration

Also applies to: 18-23

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/screens/tunnel/TunnelProvingScreen.tsx` around lines
9 - 13, The TunnelProvingScreen currently uses a hardcoded MOCK_ID_CARD and a
3-second mock timer in the proof generation flow (see MOCK_ID_CARD and the timer
logic creating the artificial delay), which is exposed on the publicly
accessible tunnel/proof/generating route; either gate the tunnel routes behind a
dev-mode or feature-flag check (wrap route rendering or navigation to
TunnelProvingScreen with an isDevMode/isFeatureEnabled guard) or add a clear
TODO comment inside TunnelProvingScreen near MOCK_ID_CARD and the mock timer
logic indicating this is PoC/test-only code pending real proof generation
integration and must not be used in production, and repeat the same change for
the duplicate mock usage around the other mock block referenced in the comment
(lines 18–23).
packages/webview-app/src/App.tsx (2)

61-67: Tunnel routes are publicly accessible.

The tunnel flow routes (/tunnel/*) including the mock KYC and proof screens are accessible without any authentication or feature flag guards. If this is intentional for PoC/demo purposes, consider adding a comment. Otherwise, consider gating these behind a dev-mode check.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/App.tsx` around lines 61 - 67, The tunnel routes
(Route elements mounting TourScreen, KycMockScreen, TunnelCountryPickerScreen,
TunnelIDTypeScreen, TunnelProofReceiptScreen, TunnelProvingScreen,
TunnelResultScreen in App.tsx) are currently public; either add a clear comment
that these are intentionally exposed for demo/PoC, or gate them behind a
dev/feature check (e.g., wrap the <Route path="/tunnel/*" .../> entries in a
conditional using a dev flag or feature flag like isDevMode or
enableTunnelRoutes from your config/env) so they are only registered when the
flag is true; ensure the check is performed where routes are defined and that
the flag name matches your existing config/util (or add a one-line comment above
the block if exposure is intentional).

18-28: Consider lazy loading for new screens.

Per coding guidelines, screens should use React.lazy() for bundle size optimization. These 11 new screen imports are loaded eagerly, which increases initial bundle size.

♻️ Example lazy loading pattern
const SecurityScreen = React.lazy(() => 
  import('./screens/account/SecurityScreen').then(m => ({ default: m.SecurityScreen }))
);
const NotificationPreferencesScreen = React.lazy(() => 
  import('./screens/account/NotificationPreferencesScreen').then(m => ({ default: m.NotificationPreferencesScreen }))
);
// ... similar for other screens

You'd also need a <React.Suspense fallback={<LoadingSpinner />}> wrapper around <Routes>.

As per coding guidelines: "Implement lazy loading for screens using React.lazy()."

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/App.tsx` around lines 18 - 28, Replace the 11 eager
imports (SecurityScreen, NotificationPreferencesScreen, DevModeScreen,
ComingSoonScreen, TourScreen, KycMockScreen, TunnelCountryPickerScreen,
TunnelIDTypeScreen, TunnelProofReceiptScreen, TunnelProvingScreen,
TunnelResultScreen) with React.lazy imports using the pattern React.lazy(() =>
import('...').then(m => ({ default: m.<ComponentName> }))). Ensure React is
imported to use lazy/Suspense, remove the old named imports, and wrap the
<Routes> rendering with <React.Suspense fallback={<LoadingSpinner />}> (or your
app's loading component) so lazy-loaded screens render correctly.
docs/superpowers/plans/2026-03-22-settings-screen-integration.md (3)

12-24: Add language specifier to fenced code block.

Per markdownlint (MD040), fenced code blocks should have a language specified for proper syntax highlighting.

📝 Suggested fix
-```
+```tsx
 // webview-app wrapper screen pattern:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md` around
lines 12 - 24, Add a language specifier to the fenced code block containing the
WrapperScreen example so markdownlint MD040 is satisfied: update the opening
triple-backticks to include "tsx" (the block that shows the EuclidScreen /
WrapperScreen / wiredProps example) so the code is treated as TypeScript/JSX for
proper syntax highlighting.

598-615: Add language specifier to navigation flow diagram.

The navigation flow diagram should use a language specifier (e.g., text or plaintext) for consistency with markdownlint rules.

📝 Suggested fix
-```
+```text
 /settings (SettingsViewScreen)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md` around
lines 598 - 615, Add a language specifier to the markdown code block that
contains the navigation flow diagram (the fenced block starting with the line
"/settings (SettingsViewScreen)"); change the opening triple-backtick fence to
include a specifier like "text" or "plaintext" so the block becomes ```text,
ensuring markdownlint compliance and consistent rendering of the diagram.

7-9: Documentation references outdated package name @selfxyz/euclid-web.

The plan consistently references @selfxyz/euclid-web, but the actual implementation migrated to @selfxyz/euclid. This creates confusion for anyone reading this plan later. Consider updating references to match the current implementation:

  • Line 7: @selfxyz/euclid-web@selfxyz/euclid
  • Line 9: Tech stack reference
  • Lines 14, 62, 172, 255, 435: Import statements in code samples
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md` around
lines 7 - 9, The documentation erroneously references the old package name
'@selfxyz/euclid-web'; update all occurrences to the current package
'@selfxyz/euclid' including the architecture paragraph and Tech Stack line, and
fix the import examples that reference '@selfxyz/euclid-web' (search for
examples around the wrappers like CountryPickerScreen.tsx, ComingSoonScreen.tsx
and the App.tsx route samples) so code samples and text consistently use
'@selfxyz/euclid'.
docs/superpowers/plans/2026-03-22-settings-handover.md (2)

37-40: Add language specifier to fenced code block.

📝 Suggested fix
-```
+```diff
 - import { ... } from '@selfxyz/euclid-web';
 + import { ... } from '@selfxyz/euclid';
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-handover.md` around lines 37 - 40,
The fenced code block showing the import change should include a language
specifier so syntax highlighting works; update the block that currently starts
with ``` to include the appropriate language (e.g., ```js or ```typescript) and
ensure the import line shown (the change from "import { ... } from
'@selfxyz/euclid-web';" to "import { ... } from '@selfxyz/euclid';") remains
inside that language-marked fence.

67-84: Add language specifier to navigation flow diagram.

📝 Suggested fix
-```
+```text
 /settings (SettingsViewScreen)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-handover.md` around lines 67 - 84,
The navigation flow diagram at the top lacks a language specifier; update the
header line for the diagram (currently "/settings (SettingsViewScreen)") to
include the language marker for a code block (e.g., add "```text" before the
diagram and closing "```" after) so the diagram renders as plain-text code;
locate the diagram block containing "/settings (SettingsViewScreen)" and wrap it
with the appropriate fenced code block markers.
packages/webview-app/src/screens/account/SettingsScreen.tsx (2)

52-70: Menu item handlers lack haptic feedback and analytics tracking.

The onBack and onDismiss callbacks properly trigger haptic feedback and track analytics, but the menu item onPress handlers (Lines 57, 63, 69) navigate directly without these side effects. This creates an inconsistent UX—users get haptic feedback when going back but not when navigating forward.

The integration plan document shows the intended pattern with haptic.trigger('selection') and analytics.trackEvent(...) in each handler.

♻️ Suggested pattern for menu items
 {
   icon: LockIcon,
   label: 'Security',
   description: 'Recovery phrase, passport data',
-  onPress: () => navigate('/settings/security'),
+  onPress: () => {
+    haptic.trigger('selection');
+    analytics.trackEvent('settings_security_pressed');
+    navigate('/settings/security');
+  },
 },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/screens/account/SettingsScreen.tsx` around lines 52
- 70, The menu item onPress handlers in SettingsScreen.tsx (the items array
entries: the Manage Documents, Security, and Notifications items) currently call
navigate(...) directly and must also trigger haptic feedback and analytics;
update each onPress to first call haptic.trigger('selection') and then
analytics.trackEvent(...) with a descriptive event name (e.g.,
'settings_manage_documents_clicked', 'settings_security_clicked',
'settings_notifications_clicked') before calling navigate('/coming-soon' |
'/settings/security' | '/settings/notifications') so the UX matches the existing
onBack/onDismiss pattern.

90-106: Developer tools section is always visible.

The "Developer tools" section with "Dev mode" and "Tunnel flow" is shown to all users. Consider conditionally rendering this section based on a dev mode flag or environment variable to avoid exposing internal tooling to end users.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@packages/webview-app/src/screens/account/SettingsScreen.tsx` around lines 90
- 106, The "Developer tools" section (the object with title 'Developer tools'
containing items with icons CodeIcon and handlers navigate('/settings/dev-mode')
and navigate('/tunnel/tour/1')) is unconditionally rendered; change
SettingsScreen.tsx to only include this section when a dev flag is true (e.g.,
process.env.NODE_ENV === 'development' or a runtime feature flag like isDevMode
from config/context). Wrap or gate the entire section object creation/render
with that condition (so the list excludes the section for production users) and
ensure the navigate handlers and icons remain unchanged when enabled.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@packages/webview-app/package.json`:
- Around line 13-14: Update the imports that still reference the removed package
to import from the new package: replace imports of StatusState, CheckCircleIcon,
WarningOctagonIcon, and colors in ProviderResultScreen with imports from
"@selfxyz/euclid", and replace BodyText, Button, Title, Description, colors, and
spacing in ProviderLaunchScreen with imports from "@selfxyz/euclid"; ensure
import specifiers exactly match the exported names used in the files and then
rebuild/tsc to verify TS2307 is resolved.

In `@packages/webview-app/src/screens/account/DevModeScreen.tsx`:
- Around line 49-59: onGenerateMockDocument currently only triggers haptics,
logs analytics and navigates away without creating or persisting a mock
document; either implement the missing creation/persistence or clearly mark it
as a placeholder. Update onGenerateMockDocument to call the mock document
creator (or dispatch/save it) with the selected params (documentType,
nationality, ageOptions[ageIndex], expiryOptions[expiryIndex], ofacCheck) and
then navigate, or if you intend it as a stub add a TODO comment and surface a
user-facing notification (toast/alert) indicating "Mock document generation not
yet implemented" so users aren't misled; reference the onGenerateMockDocument
function and related variables (documentType, nationality, ageIndex,
expiryIndex, ageOptions, expiryOptions, ofacCheck, analytics, navigate, haptic)
when making the change.

In `@packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx`:
- Around line 24-29: NotificationPreferencesScreen currently keeps toggle state
only in local state (toggleValues/setToggleValues) which isn't persisted; use
the storage adapter from useSelfClient() to save preferences on every toggle
change and to load them on mount. In component initialization call
useSelfClient(), read existing saved preferences from storage (fallback to the
current default object with keys self, nova, points, id_status) and
setToggleValues with that value, and in the toggle handler update
setToggleValues and also write the updated map to storage via storage.setItem
(or the wrapper used by useSelfClient()). Ensure you reference and update the
same keys (self, nova, points, id_status) and handle missing/invalid stored
values by merging with defaults.

In `@packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx`:
- Line 7: Update the import in ProviderLaunchScreen.tsx to import from
"@selfxyz/euclid" instead of "@selfxyz/euclid-web" and remove the unused
BodyText symbol from the import list so only used exports (Button, Title,
Description, colors, spacing) are imported; locate the import statement that
currently references BodyText and change its module path and bindings
accordingly.

In `@packages/webview-app/src/screens/tunnel/TunnelIDTypeScreen.tsx`:
- Around line 37-42: The onIDTypeSelect handler in TunnelIDTypeScreen currently
ignores its parameter; update onIDTypeSelect to accept the selected idType
(remove the underscore) and forward it when navigating to the receipt screen so
the next route receives which document type was chosen (e.g., include idType in
the navigate call via route state or a route/query param) so the receipt screen
can read the selected idType.

In `@packages/webview-app/src/screens/tunnel/TunnelProofReceiptScreen.tsx`:
- Around line 36-38: TunnelProofReceiptScreen currently hardcodes
documentType="passport" and never reads the user's selection; update
TunnelProofReceiptScreen to read the selected document type from route state
(useLocation and extract documentType with a fallback of 'passport') and change
TunnelIDTypeScreen's onIDTypeSelect to pass the selection when navigating (call
navigate('/tunnel/proof/receipt', { state: { documentType: idType.id } }) so the
selected idType arrives). Ensure the prop/variable names match (documentType,
onIDTypeSelect, idType) and preserve the default 'passport' when state is
missing.

---

Nitpick comments:
In `@docs/superpowers/plans/2026-03-22-settings-handover.md`:
- Around line 37-40: The fenced code block showing the import change should
include a language specifier so syntax highlighting works; update the block that
currently starts with ``` to include the appropriate language (e.g., ```js or
```typescript) and ensure the import line shown (the change from "import { ... }
from '@selfxyz/euclid-web';" to "import { ... } from '@selfxyz/euclid';")
remains inside that language-marked fence.
- Around line 67-84: The navigation flow diagram at the top lacks a language
specifier; update the header line for the diagram (currently "/settings
(SettingsViewScreen)") to include the language marker for a code block (e.g.,
add "```text" before the diagram and closing "```" after) so the diagram renders
as plain-text code; locate the diagram block containing "/settings
(SettingsViewScreen)" and wrap it with the appropriate fenced code block
markers.

In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md`:
- Around line 12-24: Add a language specifier to the fenced code block
containing the WrapperScreen example so markdownlint MD040 is satisfied: update
the opening triple-backticks to include "tsx" (the block that shows the
EuclidScreen / WrapperScreen / wiredProps example) so the code is treated as
TypeScript/JSX for proper syntax highlighting.
- Around line 598-615: Add a language specifier to the markdown code block that
contains the navigation flow diagram (the fenced block starting with the line
"/settings (SettingsViewScreen)"); change the opening triple-backtick fence to
include a specifier like "text" or "plaintext" so the block becomes ```text,
ensuring markdownlint compliance and consistent rendering of the diagram.
- Around line 7-9: The documentation erroneously references the old package name
'@selfxyz/euclid-web'; update all occurrences to the current package
'@selfxyz/euclid' including the architecture paragraph and Tech Stack line, and
fix the import examples that reference '@selfxyz/euclid-web' (search for
examples around the wrappers like CountryPickerScreen.tsx, ComingSoonScreen.tsx
and the App.tsx route samples) so code samples and text consistently use
'@selfxyz/euclid'.

In `@packages/webview-app/src/App.tsx`:
- Around line 61-67: The tunnel routes (Route elements mounting TourScreen,
KycMockScreen, TunnelCountryPickerScreen, TunnelIDTypeScreen,
TunnelProofReceiptScreen, TunnelProvingScreen, TunnelResultScreen in App.tsx)
are currently public; either add a clear comment that these are intentionally
exposed for demo/PoC, or gate them behind a dev/feature check (e.g., wrap the
<Route path="/tunnel/*" .../> entries in a conditional using a dev flag or
feature flag like isDevMode or enableTunnelRoutes from your config/env) so they
are only registered when the flag is true; ensure the check is performed where
routes are defined and that the flag name matches your existing config/util (or
add a one-line comment above the block if exposure is intentional).
- Around line 18-28: Replace the 11 eager imports (SecurityScreen,
NotificationPreferencesScreen, DevModeScreen, ComingSoonScreen, TourScreen,
KycMockScreen, TunnelCountryPickerScreen, TunnelIDTypeScreen,
TunnelProofReceiptScreen, TunnelProvingScreen, TunnelResultScreen) with
React.lazy imports using the pattern React.lazy(() => import('...').then(m => ({
default: m.<ComponentName> }))). Ensure React is imported to use lazy/Suspense,
remove the old named imports, and wrap the <Routes> rendering with
<React.Suspense fallback={<LoadingSpinner />}> (or your app's loading component)
so lazy-loaded screens render correctly.

In `@packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx`:
- Around line 36-45: The toggles array and its onToggleChange handlers are
recreated every render; wrap the creation of toggles in a useMemo to memoize
them — compute toggles with useMemo(() => defaultToggles.map(t => ({ label:
t.label, description: t.description, value: toggleValues[t.key] ?? false,
onToggleChange: (value: boolean) => { haptic.trigger('selection');
analytics.trackEvent('notification_toggle_changed', { key: t.key, value });
setToggleValues(prev => ({ ...prev, [t.key]: value })); }, })), [defaultToggles,
toggleValues]) so that toggles, onToggleChange, and their closures only update
when defaultToggles or toggleValues change; keep references to haptic,
analytics, and setToggleValues as-is.

In `@packages/webview-app/src/screens/account/SettingsScreen.tsx`:
- Around line 52-70: The menu item onPress handlers in SettingsScreen.tsx (the
items array entries: the Manage Documents, Security, and Notifications items)
currently call navigate(...) directly and must also trigger haptic feedback and
analytics; update each onPress to first call haptic.trigger('selection') and
then analytics.trackEvent(...) with a descriptive event name (e.g.,
'settings_manage_documents_clicked', 'settings_security_clicked',
'settings_notifications_clicked') before calling navigate('/coming-soon' |
'/settings/security' | '/settings/notifications') so the UX matches the existing
onBack/onDismiss pattern.
- Around line 90-106: The "Developer tools" section (the object with title
'Developer tools' containing items with icons CodeIcon and handlers
navigate('/settings/dev-mode') and navigate('/tunnel/tour/1')) is
unconditionally rendered; change SettingsScreen.tsx to only include this section
when a dev flag is true (e.g., process.env.NODE_ENV === 'development' or a
runtime feature flag like isDevMode from config/context). Wrap or gate the
entire section object creation/render with that condition (so the list excludes
the section for production users) and ensure the navigate handlers and icons
remain unchanged when enabled.

In `@packages/webview-app/src/screens/tunnel/TunnelProvingScreen.tsx`:
- Around line 9-13: The TunnelProvingScreen currently uses a hardcoded
MOCK_ID_CARD and a 3-second mock timer in the proof generation flow (see
MOCK_ID_CARD and the timer logic creating the artificial delay), which is
exposed on the publicly accessible tunnel/proof/generating route; either gate
the tunnel routes behind a dev-mode or feature-flag check (wrap route rendering
or navigation to TunnelProvingScreen with an isDevMode/isFeatureEnabled guard)
or add a clear TODO comment inside TunnelProvingScreen near MOCK_ID_CARD and the
mock timer logic indicating this is PoC/test-only code pending real proof
generation integration and must not be used in production, and repeat the same
change for the duplicate mock usage around the other mock block referenced in
the comment (lines 18–23).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: dded97fd-3e34-4fb8-b062-75ec65355bce

📥 Commits

Reviewing files that changed from the base of the PR and between 17232e7 and 6b547a3.

⛔ Files ignored due to path filters (1)
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (23)
  • docs/superpowers/plans/2026-03-22-settings-handover.md
  • docs/superpowers/plans/2026-03-22-settings-screen-integration.md
  • packages/webview-app/package.json
  • packages/webview-app/src/App.tsx
  • packages/webview-app/src/screens/ComingSoonScreen.tsx
  • packages/webview-app/src/screens/account/DevModeScreen.tsx
  • packages/webview-app/src/screens/account/NotificationPreferencesScreen.tsx
  • packages/webview-app/src/screens/account/SecurityScreen.tsx
  • packages/webview-app/src/screens/account/SettingsScreen.tsx
  • packages/webview-app/src/screens/home/HomeScreen.tsx
  • packages/webview-app/src/screens/onboarding/ConfirmIdentificationScreen.tsx
  • packages/webview-app/src/screens/onboarding/CountryPickerScreen.tsx
  • packages/webview-app/src/screens/onboarding/IDSelectionScreen.tsx
  • packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx
  • packages/webview-app/src/screens/proving/ProvingScreen.tsx
  • packages/webview-app/src/screens/proving/VerificationResultScreen.tsx
  • packages/webview-app/src/screens/tunnel/KycMockScreen.tsx
  • packages/webview-app/src/screens/tunnel/TourScreen.tsx
  • packages/webview-app/src/screens/tunnel/TunnelCountryPickerScreen.tsx
  • packages/webview-app/src/screens/tunnel/TunnelIDTypeScreen.tsx
  • packages/webview-app/src/screens/tunnel/TunnelProofReceiptScreen.tsx
  • packages/webview-app/src/screens/tunnel/TunnelProvingScreen.tsx
  • packages/webview-app/src/screens/tunnel/TunnelResultScreen.tsx

Comment thread packages/webview-app/package.json
Comment thread packages/webview-app/src/screens/account/DevModeScreen.tsx
Comment thread packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx Outdated
Comment thread packages/webview-app/src/screens/tunnel/TunnelIDTypeScreen.tsx
@transphorm
Copy link
Copy Markdown
Member Author

@shazarre created this branch because the other branch is forked off of main

@transphorm transphorm changed the title Feat/euclid settings screens rd2 add Euclid 3.0 settings sub-screens and tunnel flow Mar 24, 2026
@transphorm transphorm changed the title add Euclid 3.0 settings sub-screens and tunnel flow add Euclid 3.0 settings screens, tunnel flow, and audit pipeline skills Mar 24, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
CLAUDE.md (1)

33-33: ⚠️ Potential issue | 🟠 Major

Stale reference contradicts the Linear-first model.

Line 33 still references the deprecated specs/ folder structure (specs/projects/sdk/paused/<scope>/), but lines 49-56 explicitly deprecate specs/ in favor of Linear-hosted specs. This creates conflicting agent guidance within the same file.

Additionally, based on learnings, AGENTS.md should be updated when CLAUDE.md's spec model changes, but the relevant code snippet shows AGENTS.md:207-233 still promotes the old specs/ structure. Agents will receive contradictory instructions.

🔧 Recommended fix

Either remove line 33 entirely (if the two-layer model no longer applies), or update it to reference the Linear-first workflow:

-- **Use the two-layer spec model.** `INDEX.md` and `OVERVIEW.md` are stable project context. Each workstream `SPEC.md` is durable context plus backlog. PR execution lives in `workstreams/<scope>/plans/<BACKLOG-ID>-<slug>.md`. Paused workstreams live under `specs/projects/sdk/paused/<scope>/` with the same structure.
+- **Specs live in Linear.** Architecture context remains in `specs/projects/sdk/OVERVIEW.md` (read-only reference). All implementation specs are Linear documents attached to issues, not files in `specs/`.

And ensure AGENTS.md is updated in the same PR or a follow-up to remove references to specs/projects/sdk/workstreams/*/SPEC.md as the primary documentation source.

Based on learnings, when renaming/moving spec files, update all references in specs/, AGENTS.md, and CLAUDE.md in the same change.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@CLAUDE.md` at line 33, Update CLAUDE.md to remove the stale reference to the
deprecated specs/ folder ("specs/projects/sdk/paused/<scope>/") and either
delete the sentence about the two-layer spec model or rewrite it to reference
the Linear-first workflow and Linear-hosted spec locations (replace mentions of
SPEC.md under specs/ with the new Linear-hosted paths). Also update AGENTS.md to
remove or replace any guidance that points agents to
"specs/projects/sdk/workstreams/*/SPEC.md" (the snippet currently around the
AGENTS.md reference) so both docs are consistent; make these edits together in
the same PR (or a clearly linked follow-up) so no agent guidance remains
pointing to the old specs/ structure.
🧹 Nitpick comments (1)
docs/superpowers/plans/2026-03-22-settings-screen-integration.md (1)

1-667: Plan doc is stale and contradicts actual implementation.

The audit document (docs/reviews/2026-03-23-euclid-settings-tunnel-audit.md:124-126) flags this file as stale:

  • References @selfxyz/euclid-web imports (lines 15, 64, 175, 278, 477), but the actual PR migrated to @selfxyz/euclid
  • Scoped to settings only, but the branch includes tunnel flow, provider screens, and package migration
  • Line 667 marks the euclid-web → euclid migration as "Out of Scope," but it was completed in this PR
📝 Suggested fix

Since this is a pre-implementation plan that's now superseded by the actual PR, consider one of:

  1. Archive it — move to docs/superpowers/plans/archive/ or add a header noting it's historical
  2. Update it — correct import paths and scope to match what was actually shipped
  3. Delete it — if the handover doc and audit doc provide sufficient context

The audit doc already serves as the source of truth for what shipped, so retaining stale planning docs may cause confusion for future agents.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md` around
lines 1 - 667, The plan document is stale: it still references the old import
identifier '@selfxyz/euclid-web' and declares the euclid-web → euclid migration
"Out of Scope" even though the PR migrated to '@selfxyz/euclid' and included
tunnel/provider screens; fix by either (A) archiving the plan (move to
docs/superpowers/plans/archive or add a clear "historical" header) or (B)
updating the plan to match reality—replace all occurrences of
'@selfxyz/euclid-web' with '@selfxyz/euclid', remove or update the "Out of
Scope" section about migration, and correct the scope/summary to reflect that
tunnel flow and provider screens were included in the branch (ensure references
to SettingsScreen, SecurityScreen, NotificationPreferencesScreen, DevModeScreen
and App route additions match the shipped implementation); pick one option and
commit the cleaned/archived version.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@CLAUDE.md`:
- Line 33: Update CLAUDE.md to remove the stale reference to the deprecated
specs/ folder ("specs/projects/sdk/paused/<scope>/") and either delete the
sentence about the two-layer spec model or rewrite it to reference the
Linear-first workflow and Linear-hosted spec locations (replace mentions of
SPEC.md under specs/ with the new Linear-hosted paths). Also update AGENTS.md to
remove or replace any guidance that points agents to
"specs/projects/sdk/workstreams/*/SPEC.md" (the snippet currently around the
AGENTS.md reference) so both docs are consistent; make these edits together in
the same PR (or a clearly linked follow-up) so no agent guidance remains
pointing to the old specs/ structure.

---

Nitpick comments:
In `@docs/superpowers/plans/2026-03-22-settings-screen-integration.md`:
- Around line 1-667: The plan document is stale: it still references the old
import identifier '@selfxyz/euclid-web' and declares the euclid-web → euclid
migration "Out of Scope" even though the PR migrated to '@selfxyz/euclid' and
included tunnel/provider screens; fix by either (A) archiving the plan (move to
docs/superpowers/plans/archive or add a clear "historical" header) or (B)
updating the plan to match reality—replace all occurrences of
'@selfxyz/euclid-web' with '@selfxyz/euclid', remove or update the "Out of
Scope" section about migration, and correct the scope/summary to reflect that
tunnel flow and provider screens were included in the branch (ensure references
to SettingsScreen, SecurityScreen, NotificationPreferencesScreen, DevModeScreen
and App route additions match the shipped implementation); pick one option and
commit the cleaned/archived version.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: fdc92d3c-028e-414e-86e8-a68522bd8295

📥 Commits

Reviewing files that changed from the base of the PR and between 6b547a3 and 0d274cc.

📒 Files selected for processing (16)
  • .claude/skills/gaps-to-issues/SKILL.md
  • .claude/skills/pr-audit/SKILL.md
  • .claude/skills/spec-from-audit/SKILL.md
  • CLAUDE.md
  • app/AGENTS.md
  • docs/reviews/2026-03-23-euclid-settings-tunnel-audit.md
  • docs/superpowers/plans/2026-03-22-settings-handover.md
  • docs/superpowers/plans/2026-03-22-settings-screen-integration.md
  • packages/mobile-sdk-alpha/AGENTS.md
  • packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx
  • packages/webview-app/src/screens/onboarding/ProviderResultScreen.tsx
  • specs/projects/sdk/INDEX.md
  • specs/projects/sdk/OVERVIEW.md
  • specs/projects/sdk/workstreams/build-pipeline/SPEC.md
  • specs/projects/sdk/workstreams/native-shells-lite/SPEC.md
  • specs/projects/sdk/workstreams/webview/SPEC.md
✅ Files skipped from review due to trivial changes (7)
  • app/AGENTS.md
  • specs/projects/sdk/INDEX.md
  • specs/projects/sdk/workstreams/webview/SPEC.md
  • specs/projects/sdk/OVERVIEW.md
  • specs/projects/sdk/workstreams/build-pipeline/SPEC.md
  • specs/projects/sdk/workstreams/native-shells-lite/SPEC.md
  • packages/mobile-sdk-alpha/AGENTS.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/webview-app/src/screens/onboarding/ProviderLaunchScreen.tsx

@transphorm transphorm merged commit bd2e3c6 into dev Mar 24, 2026
32 of 33 checks passed
@transphorm transphorm deleted the feat/euclid-settings-screens-rd2 branch March 24, 2026 06:55
@transphorm transphorm mentioned this pull request Mar 25, 2026
10 tasks
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