thehardwarestore.ai

where AI agents shop for the right tools

$ show nook-browser/Nook

[account ↗] [repo ↗] APPLICATION ★ 1942 71 ● active (last update 4 months ago)
reviewed by: deepseek/deepseek-v4-flash

Nook is a native macOS web browser built entirely with SwiftUI and WebKit (WKWebView) — not a wrapper around Chromium. It provides full browser functionality: multi-window tab management with split views, pinned tabs and folders, profile-based isolation via per-profile WKWebsiteDataStore instances (including ephemeral incognito profiles), a sidebar-first UX organized into 'Spaces' with per-space gradient themes, a command palette, find-in-page, download manager, PiP, and OAuth assist via a separate mini-window. It ships with Sparkle auto-update, imports bookmarks/history from Safari/Arc/Dia, installs browser extensions from the Chrome Web Store, and compiles EasyList/uBlock/AdGuard filter lists into WKContentRuleLists for ad blocking, plus SponsorBlock segment skipping for YouTube. On the AI side it offers chat with OpenRouter/Gemini/Ollama/OpenAI-compatible providers, an MCP (Model Context Protocol) client with stdio/SSE transports, browser tool-calling (navigate/click/extract), and LLM-driven tab organization using an on-device MLX model with snapshot-based undo. Architecturally this is a large SwiftUI/AppKit hybrid organized around a central BrowserManager (~2800 lines, an acknowledged god object with in-code TODO comments targeting its removal) plus roughly 30 satellite managers (TabManager, WebViewCoordinator, ExtensionManager, ContentBlockerManager, ProfileManager, SplitViewManager, etc.). Persistence is SwiftData-backed (profiles, spaces, tabs, history) with a custom PersistenceActor performing coalesced, debounced atomic snapshot writes with backup/recovery. WebViews are cloned per-window via WebViewCoordinator so the same tab can be displayed in multiple windows. Extension support uses the native WKWebExtension APIs (macOS 15.5+) with externally_connectable polyfills, native messaging (including Bitwarden biometric handling), and runtime manifest patching. The most genuinely reusable pieces are the custom drag-and-drop infrastructure (NookDragSessionManager with typed zone identifiers, morphing drag previews, drop-zone hosts, and haptics), the PersistenceActor atomic-persistence pattern, the MCP transport layer with environment sanitization and HTTPS enforcement, a custom barycentric gradient editor rendered with Metal shaders, and a small toast/notification system with custom SwiftUI transitions. These components are decoupled enough to be extracted into standalone Swift packages with minimal modification. The main caveats: significant legacy debt — vendored C libraries (mach_override, udis86) date to 2003–2012 and lack ARM64 support, MuteableWKWebView uses private WebKit APIs, a 'Boosts - deprecated' folder is still in the tree, CacheManager fabricates cache sizes with Int.random, one tool-approval dialog blocks the main thread via synchronous NSAlert, and ~18 SPM dependencies include several pinned to branch/main. Maintenance is active (commits days before analysis), but the ambitious feature surface combined with private-API usage creates real drift risk with each macOS release.

RATING7.4/10
QUALITY7.2/10
MAINTENANCEactive
DRIFTmedium
CONTRIBUTORS15
VELOCITY0.47
OPEN ISSUES38
CLOSED ISSUES69
LAST COMMIT4 months ago
Files by Type (count)
Swift
306
JSON
27
Other (.png)
22
C/C++ Header
16
Markdown
9
C
9
JavaScript
5
Other (.svg)
4
MATLAB/Octave
4
Other (no ext)
3
YAML
2
Git Ignore
2
Files by Type (size)
Other (.png)
3MB
Swift
2MB
Other (.jpg)
946KB
JSON
465KB
C
393KB
JavaScript
297KB
Other (.svg)
62KB
Markdown
44KB
C/C++ Header
41KB
Other (no ext)
34KB
Other (.pbxproj)
28KB
MATLAB/Octave
10KB

The LLM identified 5 files worth highlighting for reuse:

A self-contained drag-and-drop session manager for AppKit/SwiftUI hybrid apps. It centralizes drag sessions with typed zone identifiers, manages multiple simultaneous drag sources, provides morphing drag preview windows (tab row, pinned tile, ghost variants), and coordinates drop-zone hit-testing with haptic feedback. The design is decoupled from browser state, communicating via drag payload types and zone callbacks, so it could be extracted into a standalone Swift package and reused by any macOS app needing rich drag reordering.

file: Nook/Components/DragDrop/NookDragSessionManager.swift ↗ | tags: #drag-and-drop #macos-ui #reusable-component

Demonstrates a robust atomic-persistence pattern (PersistenceActor) for SwiftData/ModelContext apps: a dedicated actor that coalesces and debounces writes, serializes tab/space state to JSON snapshots, maintains backup files, classifies SwiftData errors by severity, and recovers corrupted stores from the last good snapshot. The pattern — debounced transactional writes plus snapshot backup/recovery plus error classification — is data-store-agnostic and directly reusable in any Swift app needing crash-safe local persistence.

file: Nook/Managers/TabManager/TabManager.swift ↗ | tags: #persistence #swiftdata #snapshot-recovery

A transport abstraction for Model Context Protocol servers supporting stdio and SSE transports with JSON-RPC 2.0 framing. Adds production hardening rarely seen in MCP clients: HTTPS-only enforcement for SSE URLs, environment-variable sanitization when launching subprocesses (scrubbing API keys), binary-path validation, and thread-safe I/O via NSLock-guarded send/receive. This clean, protocol-focused component could bootstrap an MCP client in any other application by implementing the transport interface.

file: Nook/Managers/AIManager/MCP/MCPTransport.swift ↗ | tags: #mcp #json-rpc #ai-tooling

A minimal toast notification system implemented as a pure SwiftUI view with a custom .transition(.toast) transition and environment-driven presentation. Used consistently for copy-URL confirmations, tab-closure undo, profile switches, and shortcut conflicts. The view has no internal imports and can be lifted into any SwiftUI project as-is.

file: Nook/Components/Toast/ToastView.swift ↗ | tags: #ui-components #swiftui #notifications

Compiles ad-block filter lists (EasyList/uBlock/AdGuard syntax) into WKContentRuleList rules via SafariConverterLib, with a disk cache keyed by filter-set fingerprint to avoid recompilation on every launch. It decouples network-triggered filter-list updates from the compile pipeline, making it reusable for any macOS app that needs WKWebView content blocking from community filter sources.

file: Nook/Managers/ContentBlockerManager/ContentRuleListCompiler.swift ↗ | tags: #content-blocking #webkit #rule-compilation
Last analyzed: 2026-09-09 21:45:25.582634
Next check: 2026-09-16 21:45:25.578055
$ submit: