Implement MōStats - #1
Merged
Merged
Conversation
…sibility and improve quit handling
Introduce the compact process explorer's typed IPC contracts and a live native process collector feeding a main-owned snapshot service. I10 - contracts and skeletons: - Renderer ProcessExplorerService (process_explorer.proto): cached unary GetProcessSnapshot + lightweight GetSnapshotRevision, selection memory total, and action state/run RPCs, with explicit availability and command-line privacy boundaries, isolated from the metrics stream. - Native ProcessCollectorService contract (process_collector.proto), modeled for MoStats (no host CPU/system-memory or energy/disk-IO). - Renderer process gateway. I11 - native collector and main snapshot service: - Read-only native collector (src/native/processes): libproc enumeration, KERN_PROCARGS2 argv, proc_pid_rusage footprint + PROC_PIDTASKALLINFO resident fallback, cumulative CPU time; per-process network stays UNSUPPORTED; NSWorkspace app/icon enrichment in an isolated Objective-C++ file (CMake gains OBJCXX + AppKit). Never sends signals or reveals paths. - Main snapshot service drives the collector through a non-overlapping refresh loop gated on window visibility, maps native records directly to the renderer ProcessRow DTO, computes per-process CPU% from cumulative counter deltas (first-sample/restart/reset report unavailable), and sums selected-process memory honestly. Disposed on quit. - Add ProcessRow.cpu_usage so main owns the CPU computation and the renderer stays presentation-only. Command-line arguments are display/search data only and are never logged, persisted, exported, or echoed in warnings. Process actions remain inert until I14. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
… destructive actions
There was a problem hiding this comment.
Pull request overview
Implements MōStats, a compact macOS system monitor + process explorer built on MōBrowser, with typed IPC/protobuf contracts, main/renderer services, native probes, and CI/testing scaffolding.
Changes:
- Adds build/tooling configuration (Vite/Vitest/TS/ESLint/Tailwind/PostCSS) and project docs.
- Implements renderer UI + domain logic for live metrics and a searchable/grouped process explorer with detail/actions.
- Adds main-process services and native probes (memory/network/temperature/process collection), plus unit tests and GitHub Actions workflows.
Reviewed changes
Copilot reviewed 100 out of 106 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| vitest.config.ts | Vitest setup + path aliases for unit tests. |
| vite.config.ts | Vite config split by main vs renderer build modes. |
| tsconfig.node.json | TS config for node-side config files (Vite/Vitest). |
| tsconfig.json | Core TS compiler options + path mappings for @/* and @main/*. |
| tests/unit/sample-history.test.ts | Unit tests for history buffer helpers. |
| tests/unit/process-explorer-gateway.test.ts | Unit tests for renderer gateway asset assembly/caching behavior. |
| tests/unit/process-detail.test.ts | Unit tests for process-detail projection logic. |
| tests/unit/metrics-service.test.ts | Unit tests for main MetricsService lifecycle gating and publish robustness. |
| tests/unit/metric-view.test.ts | Unit tests for metric-state derivations (pending/ok/elevated/critical/unavailable). |
| tests/unit/format.test.ts | Unit tests for renderer formatting utilities. |
| tests/unit/area-path.test.ts | Unit tests for SVG area geometry helpers. |
| tests/helpers/process-fixtures.ts | Shared typed fixtures for process/projection tests. |
| src/renderer/proto/metrics.proto | Renderer-facing metrics IPC contract (streaming snapshots). |
| src/renderer/proto/app.proto | Renderer→main app IPC (always-on-top, active view gating, clipboard copy). |
| src/renderer/main.tsx | Renderer entry point + disables trackpad pinch-to-zoom. |
| src/renderer/lib/utils.ts | cn() helper combining clsx + tailwind-merge. |
| src/renderer/lib/format.ts | Pure formatting helpers for bytes/percent/rates/time/temp, etc. |
| src/renderer/index.html | Renderer HTML shell + loads main bundle. |
| src/renderer/index.css | Tailwind v4 CSS-first theme tokens + base/util layers. |
| src/renderer/gateway/process-explorer-gateway.ts | Renderer gateway for snapshots, revision pings, assets, and actions. |
| src/renderer/gateway/metrics-gateway.ts | Renderer gateway for metrics streaming subscription. |
| src/renderer/gateway/app-gateway.ts | Renderer gateway for app-level IPC calls. |
| src/renderer/domain/sample-history.ts | Ring-buffer helpers + scrub index mapping. |
| src/renderer/domain/process-detail.ts | Pure process detail projection + totals/availability logic. |
| src/renderer/domain/metric-view.ts | Pure mapping of generated enums → presentation state/text. |
| src/renderer/domain/area-path.ts | SVG path generation for contiguous runs + gaps. |
| src/renderer/components/ui/segmented-control.tsx | Compact segmented control used in the title bar. |
| src/renderer/components/ui/dropdown-menu.tsx | Local Radix dropdown wrapper for compact menus. |
| src/renderer/components/ui/button.tsx | Minimal button variants used by the app chrome. |
| src/renderer/components/processes/use-process-actions.ts | Hook managing action state fetch + run/refresh/terminate behavior. |
| src/renderer/components/processes/scroll-fade.tsx | Horizontal scroll lane with dynamic edge fades. |
| src/renderer/components/processes/process-sort-control.tsx | CPU/RAM sort dropdown for process list. |
| src/renderer/components/processes/process-search-field.tsx | Search field with custom clear button + keyboard affordances. |
| src/renderer/components/processes/process-row.tsx | Memoized row rendering for grouped processes. |
| src/renderer/components/processes/process-list.tsx | Scrollable list panel + pinned order during pointer/focus interaction. |
| src/renderer/components/processes/process-icon.tsx | App icon rendering with fallback glyph behavior. |
| src/renderer/components/processes/process-explorer-view.tsx | Processes view lifecycle: pulls, revision subscription, drill-in stack. |
| src/renderer/components/processes/process-actions.tsx | Detail view action row (reveal/quit/force quit) with tooltips. |
| src/renderer/components/processes/disclosure.tsx | Disclosure animation wrapper + clipboard copy button via main. |
| src/renderer/components/metrics/segmented-meter.tsx | Memory composition segmented bar with hover tooltip + legend. |
| src/renderer/components/metrics/network-row.tsx | Network metric row: mirrored chart + live/scrub values. |
| src/renderer/components/metrics/network-graph.tsx | Mirrored throughput chart geometry + scrubbing. |
| src/renderer/components/metrics/metrics-overview.tsx | Stats view composition + subscription gating by active view. |
| src/renderer/components/metrics/metric-row-header.tsx | Shared metric-row chrome + tooltip pill + value/unit rendering. |
| src/renderer/components/metrics/memory-row.tsx | Memory row: percent headline + segmented composition bar. |
| src/renderer/components/metrics/disk-row.tsx | Disk row: percent headline + progressbar meter + used/total text. |
| src/renderer/components/metrics/cpu-row.tsx | CPU row: usage headline + graph + scrubbing tooltip. |
| src/renderer/components/metrics/cpu-graph.tsx | CPU area chart with state-colored rendering + scrubbing. |
| src/renderer/components/metrics/area-layer.tsx | Shared SVG layers (baseline, runs, scrub band). |
| src/renderer/App.tsx | Renderer composition root (view switch + pin toggle + view gating). |
| src/native/proto/temperature.proto | Native temperature probe RPC contract. |
| src/native/proto/process_collector.proto | Native process collector contract with per-field availability. |
| src/native/proto/network.proto | Native network counters probe RPC contract. |
| src/native/proto/memory.proto | Native memory composition probe RPC contract. |
| src/native/processes/responsiveness.h | Native responsiveness probe interface. |
| src/native/processes/responsiveness.cc | Native responsiveness probe implementation (private CGS symbols). |
| src/native/processes/process_collector.h | Native process collector interfaces (collect + icon fetch). |
| src/native/processes/app_metadata.h | App metadata + icon cache interfaces (NSWorkspace/AppKit bridge). |
| src/native/metrics/temperature_probe.h | Temperature probe interface + rules (best-effort). |
| src/native/metrics/network_probe.h | Network probe interface. |
| src/native/metrics/network_probe.cc | Network probe implementation using NET_RT_IFLIST2 + interface filtering. |
| src/native/metrics/memory_probe.h | Memory probe interface. |
| src/native/metrics/memory_probe.cc | Memory probe implementation using host_statistics64 + sysctl hw.memsize. |
| src/native/main.cc | Native module entry registering RPC services. |
| src/main/tray-controller.ts | Tray icon/menu behavior + show/hide + launch-at-login toggle. |
| src/main/processes/process-explorer-service.ts | Main process explorer IPC service composition (snapshots + actions). |
| src/main/poll-loop.ts | Reusable “run immediately + interval while active” async cadence helper. |
| src/main/metrics/metrics-service.ts | Main metrics streaming service with activation gating. |
| src/main/metrics/metrics-sampler.ts | Metrics sampler (node + native probes) with timeouts and delta math. |
| src/main/index.ts | Main entry point bootstrapping the application. |
| src/main/branding.ts | Central display name constant. |
| src/main/application.ts | Main composition root: window/tray/menu + service activation gating + IPC. |
| src/main/application-window.ts | Window lifecycle, show/hide behavior, and macOS chrome settings. |
| src/main/application-menu.ts | Minimal macOS application menu composition. |
| README.md | Project overview, requirements, and developer docs. |
| postcss.config.js | PostCSS config enabling Tailwind v4 plugin. |
| package.json | Dependencies/scripts for MoBrowser app, lint/typecheck/test/build. |
| mobrowser.conf.json | MoBrowser app metadata, bundle settings, signing/notarization env wiring. |
| eslint.config.mjs | ESLint config for TS/React hooks + stylistic rules. |
| components.json | shadcn/ui config + alias mapping. |
| CMakeLists.txt | Native build configuration + frameworks and sources. |
| CLAUDE.md | Points Claude tooling at AGENTS instructions. |
| assets/entitlements.plist | macOS entitlements used for signing/hardened runtime behavior. |
| AGENTS.md | Repo-local agent guidance (read MoBrowser docs, don’t guess APIs). |
| .vscode/tasks.json | VS Code task for building main via Vite mode. |
| .vscode/launch.json | VS Code debug configurations for main + renderer. |
| .gitignore | Ignores build outputs, generated code, and local IDE metadata. |
| .github/workflows/unit-tests.yml | CI workflow running unit tests. |
| .github/workflows/static-analysis.yml | CI workflow running lint + typecheck. |
| .github/workflows/build.yml | Release build workflow for macOS packaging + draft GitHub release. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vladimir-ikryanov
approved these changes
Jun 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements a compact macOS system monitor and process explorer built with MōBrowser, React, TypeScript, and native probes. The app shows live CPU, memory, disk, network, uptime, and temperature metrics, plus searchable grouped process details with Reveal, Quit, and Force Quit actions.
Adds typed IPC/protobuf contracts, native collection services, app/tray/menu setup, renderer UI, README docs, unit tests, and CI workflows for build, static analysis, and tests.
Issue: https://github.com/TeamDev-IP/Marketing/issues/865