Skip to content

Port OpenRig-inspired UI surfaces to native app#41

Merged
TraderSamwise merged 9 commits into
masterfrom
phase/openrig-native-ui-port
May 27, 2026
Merged

Port OpenRig-inspired UI surfaces to native app#41
TraderSamwise merged 9 commits into
masterfrom
phase/openrig-native-ui-port

Conversation

@TraderSamwise

@TraderSamwise TraderSamwise commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • add native Topology, Project, Library, and For You/attention surfaces
  • add shared detail panel and runtime identity badges
  • add metadata library endpoint and parallel dev UI boot fixes

Verification

  • yarn verify
  • app yarn typecheck
  • focused app unit tests
  • Chrome MCP smoke checks on /, /topology, /project, /library, /notifications

Summary by CodeRabbit

  • New Features

    • Added Topology, Project, and Library tabs; new Library, Project, and Topology screens (map/tree/table views, project details, document browser).
    • Redesigned inbox as a unified "For You" attention feed with categorized lenses and interactive chips.
    • New UI components: Detail panel and runtime badge for richer detail and branding.
  • Tests

    • Added tests for feed logic, topology, project observability, and runtime-branding.
  • Chores

    • Expanded dev CORS origins and added a /library server endpoint.

Review Change Stack

@TraderSamwise

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c1d45b42-091b-4749-8775-bafa0b2f76bb

📥 Commits

Reviewing files that changed from the base of the PR and between a96c057 and 1324d83.

📒 Files selected for processing (4)
  • app/app/(main)/(tabs)/(inbox)/notifications.tsx
  • app/app/(main)/(tabs)/library.tsx
  • app/app/(main)/(tabs)/project.tsx
  • src/metadata-server.ts
🚧 Files skipped from review as they are similar to previous changes (2)
  • src/metadata-server.ts
  • app/app/(main)/(tabs)/project.tsx

📝 Walkthrough

Walkthrough

This PR introduces three new project exploration tabs (topology, project, library) to the mobile and desktop navigation, refactors the notifications screen to render a unified "For You" feed built from security events and notifications, and adds supporting domain models for topology visualization, project observability, and runtime branding. The feed classifies notifications into actionable kinds and merges them with agent/service attention states. Library documents are served from the metadata server and browsable in the library screen.

Changes

New tabs, refactored feed, and supporting infrastructure

Layer / File(s) Summary
Tab navigation infrastructure
app/lib/main-tabs.ts, app/app/(main)/(tabs)/_layout.tsx, app/app/index.tsx, app/components/MobileTabBar.tsx, app/components/ProjectSidebar.tsx
The app's tab system expands from 4 to 7 tabs by adding topology, project, and library; routes and screen definitions are updated, and mobile and desktop navigation components are wired to show the new tabs.
For You feed and runtime brand models
app/lib/for-you-feed.ts, app/lib/for-you-feed.test.ts, app/lib/runtime-brand.ts, app/lib/runtime-brand.test.ts
A new feed system classifies notifications into five kinds (action-required, approval, shipped, progress, observation) and merges notifications, security events, and desktop agent/service attention into a sorted, counted feed. Runtime branding maps command/kind to display metadata (label, color, background) for claude, codex, shell, and service runtimes.
Reusable detail and badge UI components
app/components/DetailPanel.tsx, app/components/RuntimeBadge.tsx
DetailPanel provides a scrollable card layout with optional icon, title/meta, and close button; DetailEmptyState renders centered empty state cards. RuntimeBadge displays a runtime brand with color and label, supporting compact mode.
Topology model and visualization screen
app/lib/openrig-topology.ts, app/lib/openrig-topology.test.ts, app/app/(main)/(tabs)/topology.tsx
Topology types and logic model worktrees, agents, and services as nodes with edges; health is mapped from status and pending actions (active, attention, idle, offline). The topology screen renders three interactive views: an SVG relationship map, a worktree tree hierarchy, and a flat node table; node selection navigates to agent/service screens.
Project observability model and project screen
app/lib/project-observability.ts, app/lib/project-observability.test.ts, app/app/(main)/(tabs)/project.tsx
Project observability computes summary counts, partitions tasks into open/completed, and derives story items (notifications, tasks, artifact hints) from notifications and task metadata. The project screen fetches tasks on mount and on-demand, computes observability and topology, and renders six tabs (story, progress, artifacts, tests, queue, topology) with conditional content based on project/endpoint availability.
Library documents API and library screen
app/lib/api.ts, src/metadata-server.ts, app/app/(main)/(tabs)/library.tsx
The API adds LibraryDocument and LibraryResponse types; metadata-server defines an allowlist of project documents (README, guides, etc.), reads them on GET /library, and truncates large content. The library screen fetches documents, renders a scrollable list with selection, and displays the selected document's title and content in a detail panel.
Notifications screen refactor to use For You feed
app/app/(main)/(tabs)/(inbox)/notifications.tsx
The notifications screen is refactored to replace the previous inbox-style UI with unified feed-based card rendering. It derives cards from the feed, supports lens filtering, and wires read/clear/open actions through the new card model (e.g., notificationId, sessionId, serviceId). Header and button labels are updated to reflect the attention-feed terminology.
Daemon CORS and server updates
src/daemon.ts, src/daemon.test.ts, src/metadata-server.ts
CORS allowed origins are expanded to include the dev web port 8091 (http://localhost:8091 and http://127.0.0.1:8091); a test verifies preflight requests from the new origin are accepted. The metadata server exposes GET /library to return allowlisted documents.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • TraderSamwise/aimux#17: Prior changes to notifications and security-event wiring; related to the feed's security handling.
  • TraderSamwise/aimux#16: Earlier inbox UI changes that this PR replaces with the new buildForYouFeed model.

Poem

🐰 Three new tabs hop into view,
Cards align in a For You queue,
Topology maps and stories blend,
Library pages to explore and send,
A tiny hop — the app extends!

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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 'Port OpenRig-inspired UI surfaces to native app' directly and clearly summarizes the main objective of the PR, which is to add native Topology, Project, Library, and For You/attention surfaces based on OpenRig design patterns.
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 phase/openrig-native-ui-port

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

app/app/(main)/(tabs)/(inbox)/notifications.tsx

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

app/app/(main)/(tabs)/library.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.

app/app/(main)/(tabs)/project.tsx

ESLint skipped: the ESLint configuration for this file references a package that is not available in the sandbox.


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

@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: 6

🤖 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 `@app/app/`(main)/(tabs)/(inbox)/notifications.tsx:
- Around line 475-486: The UI currently gates rendering of locally-derived
attention cards on the notifications fetch (checks endpoint/feed before
visibleCards), causing securityEvents/desktopState cards built by
buildForYouFeed(...) to disappear when notifications are offline; change the
conditional order in the render so that if visibleCards.length > 0 you render
those cards immediately (use visibleCards and the buildForYouFeed output), and
only show the "Project host offline" / "Loading feed..." Card in the branch that
specifically represents the notifications-backed portion (i.e. when endpoint or
feed are missing but visibleCards is empty); update the JSX conditionals that
reference endpoint, feed, and visibleCards accordingly so local data
(securityEvents, desktopState) is not hidden while notifications are
unavailable.
- Around line 216-235: Replace the hard-coded icon color "`#fafafa`" with a
theme-aware value so outline buttons match the button text color: remove
color="`#fafafa`" from the icon usages and either add className="text-foreground"
to the icon components (ExternalLink, Check, etc.) or pass color="currentColor"
so they inherit the button text color; update the instances in notifications.tsx
where ExternalLink and Check are used for the Open and onRead buttons (and the
similar occurrences around the other noted blocks).

In `@app/app/`(main)/(tabs)/library.tsx:
- Around line 71-80: The current fetch path (around the block using setLoading,
getToken, listProjectLibrary, setDocuments, setSelectedId) can show stale
documents from the previous project until the new response arrives; before
initiating the async request, clear the UI state by calling setDocuments([]) and
setSelectedId(null) (or an appropriate empty state) so the library list is
emptied while loading, then proceed with getToken/listProjectLibrary and
repopulate on success; apply the same change to the other fetch block referenced
(around lines 142-173) to prevent cross-project stale content on refresh or
project switch.

In `@app/app/`(main)/(tabs)/project.tsx:
- Around line 173-175: When handling fetch failures in project.tsx, the catch
blocks currently call setTaskError but leave previous tasks intact, causing
stale Queue data to show; update those catch blocks (the ones calling
setTaskError) to also clear the queued tasks state (call setTasks([]) or the
equivalent task-reset setter) so the UI doesn't display stale items; apply the
same change to the second catch block referenced around the setTaskError usage
at the other occurrence (lines ~263-270) so both refresh failure paths reset
tasks as well.

In `@src/metadata-server.ts`:
- Around line 87-93: LIBRARY_DOC_ALLOWLIST currently includes
".aimux/config.json", which can leak sensitive local config; remove that entry
from the LIBRARY_DOC_ALLOWLIST constant and add a defensive server-side
exclusion in the /library response code (the route handler that reads
LIBRARY_DOC_ALLOWLIST) to skip any paths that start with ".aimux/" or match
"*config.json"; update any other places that reference LIBRARY_DOC_ALLOWLIST
(the other occurrence flagged in the review) to ensure they also do not expose
config files.
- Around line 95-114: The listLibraryDocuments function currently calls statSync
and readFileSync directly for each entry from LIBRARY_DOC_ALLOWLIST which can
throw and break the entire response; wrap the per-entry filesystem work
(existsSync/statSync/readFileSync and content slicing) in a try/catch inside the
flatMap callback (or extract to a helper like readLibraryEntry) so any exception
for a single file is caught, logged or ignored, and that entry is skipped
(return [] for that entry) instead of propagating the error; reference the
symbols listLibraryDocuments, LIBRARY_DOC_ALLOWLIST, statSync, readFileSync and
ensure truncated/size/updatedAt logic remains inside the guarded block.
🪄 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 Plus

Run ID: 9c27f722-7653-4b81-849b-54c7b79a10e5

📥 Commits

Reviewing files that changed from the base of the PR and between e01ce27 and a96c057.

📒 Files selected for processing (23)
  • app/app/(main)/(tabs)/(inbox)/notifications.tsx
  • app/app/(main)/(tabs)/_layout.tsx
  • app/app/(main)/(tabs)/library.tsx
  • app/app/(main)/(tabs)/project.tsx
  • app/app/(main)/(tabs)/topology.tsx
  • app/app/index.tsx
  • app/components/DetailPanel.tsx
  • app/components/MobileTabBar.tsx
  • app/components/ProjectSidebar.tsx
  • app/components/RuntimeBadge.tsx
  • app/lib/api.ts
  • app/lib/for-you-feed.test.ts
  • app/lib/for-you-feed.ts
  • app/lib/main-tabs.ts
  • app/lib/openrig-topology.test.ts
  • app/lib/openrig-topology.ts
  • app/lib/project-observability.test.ts
  • app/lib/project-observability.ts
  • app/lib/runtime-brand.test.ts
  • app/lib/runtime-brand.ts
  • src/daemon.test.ts
  • src/daemon.ts
  • src/metadata-server.ts

Comment thread app/app/(main)/(tabs)/(inbox)/notifications.tsx Outdated
Comment thread app/app/(main)/(tabs)/(inbox)/notifications.tsx Outdated
Comment thread app/app/(main)/(tabs)/library.tsx
Comment thread app/app/(main)/(tabs)/project.tsx
Comment thread src/metadata-server.ts
Comment thread src/metadata-server.ts
@TraderSamwise
TraderSamwise merged commit 4f878ab into master May 27, 2026
1 check passed
@TraderSamwise
TraderSamwise deleted the phase/openrig-native-ui-port branch May 27, 2026 00:19
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