* feat: GitHub pulse — open PRs, CI status and review requests in the notch
Adds a live GitHub integration to the integration_github pill:
- One GraphQL query fetches open PRs (CI + review decision), PRs
to review and default-branch CI for 10 recent repos
- Adaptive polling: 60 s when a PR/CI is pending, 300 s otherwise
- Alerts (badge + sound) on CI failure, new review request, CI pass;
priority: failure > review > pass; first poll is always silent
- GitHubPulseCardView replaces the stats card when pulse data is available
- GitHubDetailView with tappable PR/repo rows opens the matching GitHub URL
- Settings help text for the token (scope requirements)
- 37 unit tests covering parse, events, CIState and edge cases
- CI step "GitHub pulse tests" added to build.yml
- Docs: INTEGRATIONS.md §1quater, SPEC.md card/detail sections,
privacy.html section 4 (EN + FR), README integrations line
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix(github-pulse): 6 correctifs avant merge
1. Partial GraphQL errors: parse data when "data" key is present even if
"errors" exists; only keep old data when "data" is absent/null.
Replace print() with appendAppLog("github.log", ...) via private nbLog.
2. Badge: skip badge (not sound) when integration_github is already in focus.
3. Stale data: clear githubPulse when integration_github is removed from
activeIntegrations (AppState.didSet); clear githubPulse (+ githubStats
if deleted) when token changes in saveIntegrations(), then trigger an
immediate pulse poll on new token via GithubPoller.triggerPulseNow().
4. Duplicate IDs: parse() deduplicates myPRs and toReview by id (keeps
first). events() uses Dictionary(_:uniquingKeysWith:) for both PR and
repo maps. 5 new tests covering parse-time dedup and event dedup.
5. GitHubRepoCIRowView: CI dot + short name (10.5 pt #9398A1) + branch
(11 pt #C5C8CD) + status word right (failing/running/passing, 10 pt
in CI colour). Tap opens repo/actions URL filtered on host==github.com.
6. Height: .clipped() on GitHubPulseCardView and GitHubDetailView outer
containers; ScrollView maxHeight reduced to 80 pt (4 × 20 pt rows
exactly) so list never overflows the 160 pt overview card.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: GitHub card header shows stats inline, list height 3 rows + bottom fade
- GitHubPulseCardView: replace "Overview" label with "★ N · N repos" (11pt
#8E939C) when githubStats available; fall back to "Overview" otherwise.
Remove right-aligned stats text and Spacer. Trailing padding 12 → 36 to
avoid ↗ button overlap.
- GitHubDetailView: maxHeight 80 → 60 (3 rows × 20pt, no half-row cut).
Add bottom fade mask (black → clear over last 20%) when item count > 3.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: live diff — see file changes in the notch as Claude edits
- DiffEngine.swift (Foundation-only): LCS-based line diff with 3-line context
hunks, 200 KB / 4000-line size guards, CRLF normalization; handles Edit,
MultiEdit and Write tool inputs. String.makeDiffStep/parseDiffStep encode
diff step metadata in a private-use prefix so TickerRowView can detect them
- HookServer: PostToolUse for Edit/MultiEdit/Write builds and stores a FileDiff
in AppState.sessionDiffs[pillId], then appends a diff step. SessionEnd clears
the session; 1-hour inactivity timer auto-expires diffs
- TickerRowView: diff steps render filename + "+N" (green #22C55E) + "−M"
(red #F4505E), small monospaced — all other steps unchanged
- TickerView: tap on a diff step fires onDiffTap callback with the step index
- OverviewView: diff overlay (DiffCardView) replaces the ticker in the left
card when a diff step is tapped; Escape or ← dismisses it
- DiffCardView: scrollable monospaced diff lines (10.5 pt), ±12% background,
header with filename + totals + ↗ (code -g path:line or NSWorkspace)
- FinishedView: lists up to 4 touched files with +/− totals below the buttons;
tapping a file opens its DiffCardView
- Tests: 38 assertions across 11 groups; all 6 test scripts pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: diff tap on integration pills, static final line after Stop
Bug 1 — diff step taps now work on both the current and completed ticker
rows for all pills (including integration pills like integration_claude).
IntegrationCardView gains an onDiffTap callback wired from OverviewView;
TickerView passes per-row closures computed from the row text rather than
a single global tap; activeDiffStep renamed to activeDiffIdx and stores
the sessionDiffs index directly so it survives appendStep's 20-step cap.
Diff card also closes on view/mode change.
Bug 2 — after Stop the ticker shows the last assistant message as static
text (#C9CDD4, no shimmer, checkmark icon) until a new turn starts.
DiffEngine.toOneLine strips Markdown and collapses whitespace; Stop reads
last_assistant_message (fallback message), calls toOneLine, appendStep
and sets AgentTask.finalLine. finalLine is cleared on SessionStart,
UserPromptSubmit, PreToolUse and SessionEnd. TickerRowView gates shimmer
and chevron on isActive (thinking || working).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: stable diff ids, memory cap, ticker polish, Write jump, CI step
1. Stable diff ids: FileDiff gains an `id` int assigned by AppState from a
monotonically-increasing counter (nextDiffId) that is never reset across
sessions. appendSessionDiff sets and returns this id; the step marker
encodes diffId instead of a transient array index. Lookup is now
first(where: { \$0.id == diffId }) — tapping a step whose diff was
evicted is a no-op.
2. Memory cap: appendSessionDiff keeps at most 50 diffs per pill (oldest
evicted first). DiffEngine.fromNew applies the same 200 KB / 4 000-line
limit as fromEdit (tooLarge, no hunks, line count preserved).
3. Ticker non-active style: staticColor (#C9CDD4) only when !isActive &&
phase < 0.5 (current row); the completed row above keeps #6B7079.
4. FinishedView main text: finalLine ?? last non-diff step ?? "Session
finished". Never shows a \u{E001}-prefixed diff marker string.
5. DiffCardView ↗ button: /opt/homebrew/bin/code added first; Write opens
`code -g file:1`, Edit/MultiEdit opens `code file`. firstChangedLine
removed from FileDiff (no longer used).
6. fromEdit perf guard: m*n > 1_000_000 triggers countFallback (tooLarge).
7. CI: "Diff engine tests" step added to build.yml.
Tests: new cases for m*n blowup, fromNew tooLarge, diffId > 9 round-trip.
Docs: INTEGRATIONS.md corrected for Write semantics and 50-diff cap.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: answer AskUserQuestion from the notch (issue #94)
Parse AskUserQuestion PermissionRequests into a Foundation-only AskQuestion
model (1–4 questions, 2–4 options each, single- or multi-select). The question
card shows options as buttons (single-select: click = answer; multi-select:
toggles + Send), a free-text Other… field, a 1/N counter for multi-question
flows, and a "Reply in terminal" fallback. nb-hook.py emits allow +
updatedInput when decision is "answer". 21 parsing and answer-construction
tests, CI step added.
Idea from issue #94 by @Vega8991
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: answer AskUserQuestion via PreToolUse --ask hook (Claude Code 2.1.85+)
- nb-hook.py --ask mode: guards tool_name == AskUserQuestion, injects
coucou_kind, holds socket 125 s; on answer emits PreToolUse hookSpecificOutput
with updatedInput {questions, answers} so Claude Code receives the replies
- HookServer: dedicated AskUserQuestion PreToolUse hook entry (130 s timeout)
added to both buildHooksData() variants; hooksNeedUpdate() returns true when
that entry is absent; banner updated accordingly
- handleClient routes coucou_kind == ask_user_question to processQuestionRequest;
PermissionRequest for AskUserQuestion replies ask immediately; PreToolUse
general event skips state update for AskUserQuestion
- AskQuestion.buildAnswers now returns [String: Any]: single-select → String,
multi-select → [String] array (Claude Code 2.1.136+)
- QuestionView: ChipFlowLayout for option chips (shared with ModelPickerView),
header shows 1/N counter + Reply-in-terminal link, Send/Next only for
multi-select (disabled until a choice is made), single-select auto-advances
- Tests, docs updated; both schemes build clean
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: question card never appeared — treat .question as alert in expandIfNeeded
Added .question to the isAlert set so it force-expands when the island is
collapsed/hidden, and made it an always-wins view (alongside .approval) so it
replaces whatever is showing when the island is already open.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: question card UX — compact Other field, auto-release fd, header label
- Other… mode: field + Send capsule + ✕ now on one line (no extra row),
field has rounded background (white 7%, r8), Send capsule dims when empty,
Escape key resets to options, multi-select Send button hidden while Other
field is open
- releaseQuestionFD(): sends "ask" immediately when QuestionView disappears
without an explicit answer (collapse, view change, another alert taking over),
does not touch state.view — called via QuestionView.onDisappear
- Header label: "Claude Code is asking" (static, not project-name-dependent)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* Add Claude plan gauge pill with statusline relay and settings UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix claude-plan-gauge review: safe preview, live pill color, githubOnly, validation
- Preview writes nothing; all file I/O deferred to confirm (fixes cancel-uninstall data loss)
- Reinstall preserves existing statusLine padding/refreshInterval (only command swapped)
- Pill label and color computed live from claudePlanUsage at render; removed tasks mutation in didSet
- integration_claude_plan is githubOnly: true (App Store has no installer)
- Install checks xcode-select -p and shows clear error if CLTools missing
- nb-hook.py: invalid stdin returns early in normal mode; --statusline continues regardless
- Validation: clamp pct 100-200 to 100 (not rejected); reject pct > 200; reject resets_at > 400 days
- Card: TimelineView every 30s; DateFormatter created once with en_US_POSIX locale
- Settings Plan usage: shows Installed/Not installed state and only the relevant button
- Diff shows only the statusLine key (before/after), not full settings.json
- settings.json written with .withoutEscapingSlashes
- 27/27 tests pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* docs: mark Claude plan gauge as GitHub build only
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Redesign Claude plan gauge: header pill and Settings toggle, not a catalog pill
- Remove integration_claude_plan from PillCatalog; it was never shipped
- Add "Show in the notch" toggle in Settings → Agents → Plan usage; enabling
it auto-triggers relay install if not yet installed; cancelling reverts toggle
- Small capsule pill in IslandHeader (home view, GitHub build): colored dot +
"Claude 73%" label, active look while plan detail is open
- Tap pill: ClaudePlanCardView replaces left card; showingPlanDetail resets on
focusId/view/mode change; big Mochi takes plan usage color while open
- Card tweaks: fixed 50pt bar, arrow.clockwise icon, compact reset labels
("in 1 h 20" / "Mon 9:00"), subtitle "just now / N min ago / N h ago",
no truncation; TimelineView every 30s
- App Store build unaffected (all new UI is #if !APPSTORE)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Polish plan gauge: reset label, label width, cached relay state
- Weekly reset label: "Mon 9:00" without "Resets" prefix (icon suffices)
- Label column widened to 40pt so "5 hours" never truncates
- Cache relay-installed state in AppState.planRelayInstalled; set at launch,
refreshed on Settings open and after every Install/Uninstall confirm;
IslandHeader reads state.planRelayInstalled instead of calling
HookServer.statusLineInstalled() on each render
- Uninstall confirm sets showPlanInNotch = false
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: Ollama and LM Studio chat via OpenAI-compatible streaming API
- Add ollama/lmstudio cases to ChatProvider with isLocal, pillID, init?(pillID:)
- Add LocalChat helpers: normaliseURL, parseSSEDelta, filterThinkingBlocks
- Stream local responses token-by-token via URLSession.bytes
- Add ai_ollama (#FACC15) and ai_lmstudio (#A3E635) pills to PillCatalog
- Add server URL settings in Settings → Chat (Local models GroupBox)
- NSAllowsLocalNetworking in both Info.plist targets
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* feat: Markdown rendering in chat assistant responses
- Add ChatMarkdown block parser (Foundation only) and ChatMarkdownView renderer
- ChatBubble uses ChatMarkdownView for assistant messages
- Update system prompt to allow markdown formatting
- Add ChatMarkdown/LocalChat test suite with compile-and-run script
- Add test-chat-parsing step to CI build workflow
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* refactor: move local model networking into LocalChat, add fake server e2e tests
- Add LocalChatError typed enum (serverUnreachable, modelNotFound, serverError)
- Add LocalChat.fetchModels with embedding model filter (nomic-embed, bge, etc.)
- Add LocalChat.streamChat: full SSE streaming with typed error handling
- Add LocalChat.progressiveFilter for partial think-block suppression
- ClaudeService delegates local streaming entirely to LocalChat.streamChat
- Add tests/fake_local_llm.py: stdlib Python server with think blocks, null-content
deltas, model filter, unknown model 404, and Markdown streaming
- ChatParsingTests: unit tests + 4 end-to-end tests against fake server
- test-chat-parsing.sh starts/stops fake server with port-file handoff
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Local model connect flow, Markdown improvements, and docs update
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Fix pill hints, local model error flow, streaming scroll, and docs polish
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* Make the chat test server start reliably on CI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
- Move safeWebURL(_:) from IslandViewContent.swift to SafeWebURL.swift
so it can be compiled and tested independently
- Add tests/SafeWebURLTests.swift: 15 cases (5 accepted, 10 rejected)
- Add scripts/test-safe-links.sh on the same model as test-screen-geometry.sh
- Add "Test link filter" step to build.yml after "Test screen geometry"
- CHANGELOG: add entry for http/https-only links (#16)
- docs/INTEGRATIONS.md: document that Open button is disabled for non-web URLs
- docs/support.html: typographic apostrophes in French no-notch FAQ answer
Co-authored-by: Cris1670 <20190806+Cris1670@users.noreply.github.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>