Skip to content

Composer Chips Anywhere#703

Merged
arul28 merged 6 commits into
mainfrom
ade/composer-chips-anywhere-a9d02bd6
Jul 5, 2026
Merged

Composer Chips Anywhere#703
arul28 merged 6 commits into
mainfrom
ade/composer-chips-anywhere-a9d02bd6

Conversation

@arul28

@arul28 arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner

Composer chips that work anywhere, instantly

Typing /command, a skill name, or @file ANYWHERE in the prompt composer (not just at position 0) now surfaces suggestions instantly and converts to an inline chip — across desktop, the ade-code TUI, and iOS.

Trigger detection (shared)

  • New apps/desktop/src/shared/composerTriggers.ts: detectComposerTrigger(text, cursorPos) finds an in-progress /command ((?:^|\s)\/([^\s/]*)$) or @file token ending at the cursor; replaceComposerTriggerSpan splices exactly the trigger span; findConfirmedComposerTokens locates confirmed chip tokens. Word-boundary guards keep paths (/usr/bin), fractions (3/4), URLs, and emails from triggering.
  • Consumed by the desktop rich contenteditable + plain textarea, the WorkViewArea continue composer, and the TUI (direct import). iOS mirrors the regexes byte-identically in Swift.

Anywhere insertion + chips

  • Selection replaces exactly the trigger span; multiple chips coexist (fix @src/foo.ts then run /test). Lone leading commands keep the legacy path (local /clear intercept, argument-hint scaffold).
  • Desktop rich mode inserts non-editable chip nodes; the textarea renders a backdrop overlay styling confirmed tokens (mounted only when a confirmed token exists). TUI colors confirmed tokens in prompt rows. iOS draws rounded chip pills via a TextKit layout manager.
  • Enter/Tab fall through to normal send when a token has no menu match (no more dead keys); IME composition freezes trigger re-evaluation until compositionend.

Performance

  • ChatCommandMenu: 300ms → 40ms debounce, per-menu query cache (cache hits render same-frame, silent revalidation), stale-result sequence guard, spinner only when nothing to show.
  • fileSearchIndexService: name index split from content index — the build walk never reads file contents, quickOpen never waits on them; searchText loads lazily (bounded, binary-sniffed, cooperative yields). Per-query quickOpen cache invalidated by watcher events.
  • registry.fileSearch: sessionId→laneId cache via getSessionSummary (identity sessions excluded — resumeSession can migrate their lane); empty-query calls warm the index via new fileService.warmQuickOpenIndex and the composer pings on session bind, so the first @ is served from a warm index.

iOS

  • New WorkComposerTypedTriggers.swift: cursor-relative detector, suggestion controller (files via existing SyncService.quickOpen, curated slash catalog), inline strip above the keyboard, UITextView-backed composer with chip pills. Dead WorkSlashCommandsSheet/WorkMentionsPickerSheet deleted. Build + 14 detector tests green.

Tests

  • 22 shared trigger-utility tests; 3 composer regression tests (mid-sentence splice, Enter fall-through, @file splice+attach); index-service tests folded into fileService.test.ts; registry laneId-cache tests; 14 iOS detector tests. Desktop/ade-cli typecheck clean; 813 TUI tests green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Inline @ and / suggestions now work in the middle of a draft, not just at the start.
    • Composer text now shows confirmed file and command tokens as styled chips in desktop and iOS chats.
    • File search suggestions are faster and can warm up in the background for smoother lookup.
  • Bug Fixes

    • Improved trigger handling during typing, including IME/composition input and keyboard selection.
    • Search results and quick-open behavior are now more consistent, with better caching and fewer stale updates.

Greptile Summary

This PR adds composer chips that work anywhere in the prompt. The main changes are:

  • Shared cursor-relative /command and @file trigger detection.
  • Inline chip insertion and rendering across desktop, TUI, and iOS composers.
  • Faster file suggestions through lane caching, quick-open warming, query caching, and lazy content indexing.
  • Regression coverage for shared trigger utilities, desktop composer behavior, file search indexing, registry lane caching, and iOS trigger detection.

Confidence Score: 5/5

This PR appears safe to merge with low risk.

No verified issues were found in the changed paths. The changes include focused coverage for shared triggers, composer regressions, file indexing, registry lane caching, and iOS detection.

No files require special attention.

T-Rex T-Rex Logs

What T-Rex did

  • Ran the full focused composer test command in apps/desktop, producing a 63/63 pass result including explicit regression cases.
  • Ran a targeted regression filter in apps/desktop, with 3/3 relevant tests passing for mid-sentence slash splice, unmatched slash Enter send, and mid-sentence @query file attach/splice.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
apps/desktop/src/shared/composerTriggers.ts Introduces shared cursor-relative / and @ trigger utilities with boundary guards and token confirmation helpers.
apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx Integrates shared trigger detection, exact span replacement, IME guards, chip rendering, and index warm pings in the desktop composer.
apps/desktop/src/renderer/components/chat/ChatCommandMenu.tsx Reduces debounce, adds per-menu query caching and stale-result guards, and lets unmatched Enter/Tab fall through.
apps/desktop/src/main/services/files/fileSearchIndexService.ts Separates name indexing from lazy content loading and adds quick-open caching with watcher invalidation.
apps/desktop/src/main/services/adeActions/registry.ts Caches chat session lane resolution and warms quick-open on empty file-search queries.
apps/ade-cli/src/tuiClient/app.tsx Adds shared composer trigger detection and prompt chip rendering to the TUI.
apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift Adds iOS trigger detection, suggestion fetching, inline chip styling, and UITextView-backed composer behavior.
apps/ios/ADE/Views/Work/WorkChatSessionView.swift Wires the iOS composer to the new typed trigger text view and suggestion strip.

Sequence Diagram

%%{init: {'theme': 'neutral'}}%%
sequenceDiagram
  participant User
  participant Composer as Composer UI
  participant Trigger as detectComposerTrigger
  participant Menu as ChatCommandMenu / SuggestionStrip
  participant Registry as chat.fileSearch
  participant Files as fileService.quickOpen
  User->>Composer: "Type /command or @file anywhere"
  Composer->>Trigger: Detect token ending at cursor
  Trigger-->>Composer: Trigger kind, query, start span
  alt Slash trigger
    Composer->>Menu: Show filtered command rows
    User->>Menu: Select command
    Menu->>Composer: Replace trigger span with chip
  else File trigger
    Composer->>Menu: Request file suggestions
    Menu->>Registry: fileSearch(sessionId, query)
    Registry->>Files: quickOpen(workspace lane, query)
    Files-->>Registry: Path matches
    Registry-->>Menu: File suggestions
    User->>Menu: Select file
    Menu->>Composer: Replace trigger span and attach file
  end
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
sequenceDiagram
  participant User
  participant Composer as Composer UI
  participant Trigger as detectComposerTrigger
  participant Menu as ChatCommandMenu / SuggestionStrip
  participant Registry as chat.fileSearch
  participant Files as fileService.quickOpen
  User->>Composer: "Type /command or @file anywhere"
  Composer->>Trigger: Detect token ending at cursor
  Trigger-->>Composer: Trigger kind, query, start span
  alt Slash trigger
    Composer->>Menu: Show filtered command rows
    User->>Menu: Select command
    Menu->>Composer: Replace trigger span with chip
  else File trigger
    Composer->>Menu: Request file suggestions
    Menu->>Registry: fileSearch(sessionId, query)
    Registry->>Files: quickOpen(workspace lane, query)
    Files-->>Registry: Path matches
    Registry-->>Menu: File suggestions
    User->>Menu: Select file
    Menu->>Composer: Replace trigger span and attach file
  end
Loading

Comments Outside Diff (1)

  1. apps/desktop/src/main/services/files/fileSearchIndexService.ts, line 413-418 (link)

    P1 Stale cache race
    onFileChanged clears quickOpenCache before the async shouldIgnore(...).then(upsertFile) mutation finishes. When a quickOpen request lands in that window, it recomputes results from the old index.files and stores them in the now-empty cache. After line 418 adds the changed file, the cache is not cleared again, so file search can keep returning stale results until another watcher event.

    Artifacts

    Repro: focused Vitest harness for the quickOpen stale cache race

    • Contains supporting evidence from the run (text/typescript; charset=utf-8).

    Repro: verbose failing test output showing stale cached quickOpen result after watcher upsert

    • Keeps the command output available without making the summary code-heavy.

    View artifacts

    T-Rex Ran code and verified through T-Rex

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: apps/desktop/src/main/services/files/fileSearchIndexService.ts
    Line: 413-418
    
    Comment:
    **Stale cache race**
    `onFileChanged` clears `quickOpenCache` before the async `shouldIgnore(...).then(upsertFile)` mutation finishes. When a `quickOpen` request lands in that window, it recomputes results from the old `index.files` and stores them in the now-empty cache. After line 418 adds the changed file, the cache is not cleared again, so file search can keep returning stale results until another watcher event.
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code

Reviews (5): Last reviewed commit: "review: never serve or cache a partially..." | Re-trigger Greptile

@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
ade Ignored Ignored Preview Jul 5, 2026 3:40pm

@coderabbitai

coderabbitai Bot commented Jul 5, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Introduces a shared composer-trigger detection/replacement module used across the ADE CLI TUI, desktop AgentChatComposer, ChatCommandMenu, and WorkViewArea for mid-sentence @/slash triggers with chip-style rendering. Adds desktop fileSearch lane-ID caching, lazy quick-open indexing with caching, and a new iOS typed-trigger composer replacing legacy mention/slash picker sheets.

Changes

Shared composer trigger utility and TUI/desktop integration

Layer / File(s) Summary
Shared composerTriggers module
apps/desktop/src/shared/composerTriggers.ts, apps/desktop/src/shared/composerTriggers.test.ts
New module with detectComposerTrigger, replaceComposerTriggerSpan, findConfirmedComposerTokens, composerTriggerSpansWholeDraft, plus tests.
ADE CLI TUI prompt composer integration
apps/ade-cli/src/tuiClient/app.tsx
Legacy mention/slash detection replaced with shared trigger utilities; segmented chip-style prompt rendering and updated key handling.
AgentChatComposer and ChatCommandMenu rewrite
apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx, AgentChatComposer.test.tsx, ChatCommandMenu.tsx
Plain/rich composer modes use shared trigger utilities with IME guarding and chip rendering; command menu gains typed trigger, query caching, and boolean selectCurrent().
WorkCliContinuationComposer slash rewrite
apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
Mid-sentence slash detection/replacement via shared utilities instead of leading-slash-only overwrite.
chat.fileSearch lane resolution cache
apps/desktop/src/main/services/adeActions/registry.ts, registry.test.ts
Bounded lane-ID cache via getSessionSummary/listSessions fallback; quick-open index warming on empty queries.
Lazy content loading and quick-open caching
apps/desktop/src/main/services/files/fileSearchIndexService.ts, fileService.ts, fileService.test.ts
Lazy per-file text loading with byte budget tracking, bounded quick-open cache with invalidation, new warmQuickOpenIndex method.

iOS typed-trigger composer

Layer / File(s) Summary
Trigger detector, suggestion model, chip styling
apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift
Cursor-relative slash/at detection, suggestion catalogs, debounced async file search controller, chip pill layout manager.
Composer text view and suggestion strip
WorkComposerTypedTriggers.swift
UITextView-based TextKit composer with chip tracking/commit and SwiftUI suggestion strip.
Session view wiring and legacy sheet removal
WorkChatSessionView.swift, WorkMentionsPickerSheet.swift, WorkSlashCommandsSheet.swift
Wires laneId/SyncService into composer, refactors text field to use new text view, removes old picker sheets.
Trigger detector tests
apps/ios/ADETests/WorkComposerTriggerDetectorTests.swift
New XCTest coverage for detection, cursor relativity, tie-breaking, and bounds.

Estimated code review effort: 4 (Complex) | ~75 minutes

Possibly related PRs

  • arul28/ADE#555: Adds the daemon sync remote command for paginated chat history that underpins the composer/TUI chat flows touched here.

Suggested labels: desktop, ios

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly reflects the main change: enabling composer chips anywhere across surfaces.
✨ 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 ade/composer-chips-anywhere-a9d02bd6

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.

@arul28

arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

@copilot review but do not make fixes

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

🧹 Nitpick comments (2)
apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift (2)

198-260: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Unresolved lane keeps retrying listWorkspaces() on every @ fetch.

resolveWorkspaceId only caches a successful lookup (Line 258: if let resolved { cachedWorkspaceId = resolved }). If the lane hasn't synced a matching workspace yet (or the laneId never resolves), every keystroke's debounced fetch re-issues listWorkspaces() over sync, with no backoff. Consider caching a "not found" sentinel with a short TTL, or resolving once when laneId is set instead of per-query.

🤖 Prompt for 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.

In `@apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift` around lines 198 -
260, The `scheduleFileFetch` flow keeps calling `resolveWorkspaceId` and
`sync.listWorkspaces()` on every debounced `@` query when a lane has no resolved
workspace yet. Update `resolveWorkspaceId(laneId:sync:)` to cache the unresolved
state too, using a short-lived sentinel/TTL or by resolving once when `laneId`
changes, so repeated keystrokes don’t re-run workspace discovery. Keep the
existing success cache (`cachedWorkspaceId`) but also prevent repeated retries
for the same unresolved lane until the cache expires or the lane changes.

32-67: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Tie-break branch appears unreachable given the regex constraints.

Both slashRegex and atRegex anchor with $ and their capture groups exclude whitespace. For both to match the same (text, cursor), the character immediately before the "loser" trigger would have to be whitespace, but that position necessarily falls inside the "winner" trigger's whitespace-excluding capture span — a contradiction. In practice, at most one of the two can ever match, so case let (s?, a?): (Line 57‑58) is dead code, and the two "closest wins" tests (testClosestToCursorWinsWhenBothMatch, testSlashWinsWhenItIsClosest in WorkComposerTriggerDetectorTests.swift) exercise "only one matched" rather than an actual tie-break. Given this PR's goal is exact parity with the desktop/TUI regex behavior, worth confirming the desktop composerTriggers.ts implementation doesn't rely on a genuinely reachable dual-match tie-break that iOS is silently missing.

import re
slash_re = re.compile(r'(?:^|\s)/([^\s/]*)$')
at_re = re.compile(r'(?:^|\s)@([^\s@]*)$')
import itertools, string
# brute-force short strings to look for any text where both match simultaneously
alphabet = list(" ab/@")
found = False
for n in range(1, 7):
    for combo in itertools.product(alphabet, repeat=n):
        s = ''.join(combo)
        if slash_re.search(s) and at_re.search(s):
            found = True
            print(repr(s))
            break
    if found:
        break
print("found any dual match:", found)
🤖 Prompt for 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.

In `@apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift` around lines 32 -
67, The dual-match tie-break in WorkComposerTriggerDetector.detect is
unreachable because slashRegex and atRegex cannot both match the same prefix, so
the `case let (s?, a?)` branch is dead. Remove that branch and simplify the
selection logic so the detector returns the single matching
WorkComposerTriggerMatch, or align it with the desktop composerTriggers.ts
behavior only if that implementation truly depends on a reachable tie-break.
Update WorkComposerTriggerDetectorTests to cover the actual single-match
behavior rather than asserting a nonexistent tie.
🤖 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 `@apps/desktop/src/main/services/files/fileSearchIndexService.ts`:
- Around line 399-402: The quick-open cache is being invalidated too early in
the file update flow, allowing a query to repopulate stale results before the
async `shouldIgnore(...).then(...)` work finishes. Update
`fileSearchIndexService` so `invalidateQuickOpenCache(index)` runs after
`removePath` or `upsertFile` completes in the `matchingIndexes` update path, and
keep the guard around unbuilt empty indexes intact. Refer to `matchingIndexes`,
`invalidateQuickOpenCache`, `removePath`, and `upsertFile` to place the
invalidation at the end of the async update.

In `@apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift`:
- Around line 472-490: The trigger detection in textViewDidChange is missing the
same IME composition guard used in textViewDidChangeSelection, so it can fire on
marked text and show suggestions mid-composition. Update
WorkComposerTypedTriggers’s textViewDidChange flow to call detectTrigger only
when textView.markedTextRange is nil, keeping it consistent with the existing
restyle and selection handling logic.
- Around line 303-357: The custom TextKit setup in WorkComposerTextView is being
created as local objects in makeUIView, so the NSTexStorage and
WorkComposerChipLayoutManager can be deallocated after setup. Move ownership of
that stack into the Coordinator (or another long-lived property) and have
makeUIView wire the UITextView to those persistent instances so the chip layout
remains active for the lifetime of the view.

---

Nitpick comments:
In `@apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift`:
- Around line 198-260: The `scheduleFileFetch` flow keeps calling
`resolveWorkspaceId` and `sync.listWorkspaces()` on every debounced `@` query
when a lane has no resolved workspace yet. Update
`resolveWorkspaceId(laneId:sync:)` to cache the unresolved state too, using a
short-lived sentinel/TTL or by resolving once when `laneId` changes, so repeated
keystrokes don’t re-run workspace discovery. Keep the existing success cache
(`cachedWorkspaceId`) but also prevent repeated retries for the same unresolved
lane until the cache expires or the lane changes.
- Around line 32-67: The dual-match tie-break in
WorkComposerTriggerDetector.detect is unreachable because slashRegex and atRegex
cannot both match the same prefix, so the `case let (s?, a?)` branch is dead.
Remove that branch and simplify the selection logic so the detector returns the
single matching WorkComposerTriggerMatch, or align it with the desktop
composerTriggers.ts behavior only if that implementation truly depends on a
reachable tie-break. Update WorkComposerTriggerDetectorTests to cover the actual
single-match behavior rather than asserting a nonexistent tie.
🪄 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: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: e262374d-62ed-4590-88d4-1f0fec8a5cbb

📥 Commits

Reviewing files that changed from the base of the PR and between 30af03f and 18f9ad2.

⛔ Files ignored due to path filters (5)
  • apps/ios/ADE.xcodeproj/project.pbxproj is excluded by !**/*.xcodeproj/project.pbxproj
  • docs/features/ade-code/README.md is excluded by !docs/**
  • docs/features/chat/composer-and-ui.md is excluded by !docs/**
  • docs/features/files-and-editor/file-watcher-and-trust.md is excluded by !docs/**
  • docs/features/sync-and-multi-device/ios-companion.md is excluded by !docs/**
📒 Files selected for processing (17)
  • apps/ade-cli/src/tuiClient/app.tsx
  • apps/desktop/src/main/services/adeActions/registry.test.ts
  • apps/desktop/src/main/services/adeActions/registry.ts
  • apps/desktop/src/main/services/files/fileSearchIndexService.ts
  • apps/desktop/src/main/services/files/fileService.test.ts
  • apps/desktop/src/main/services/files/fileService.ts
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.test.tsx
  • apps/desktop/src/renderer/components/chat/AgentChatComposer.tsx
  • apps/desktop/src/renderer/components/chat/ChatCommandMenu.tsx
  • apps/desktop/src/renderer/components/terminals/WorkViewArea.tsx
  • apps/desktop/src/shared/composerTriggers.test.ts
  • apps/desktop/src/shared/composerTriggers.ts
  • apps/ios/ADE/Views/Work/WorkChatSessionView.swift
  • apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift
  • apps/ios/ADE/Views/Work/WorkMentionsPickerSheet.swift
  • apps/ios/ADE/Views/Work/WorkSlashCommandsSheet.swift
  • apps/ios/ADETests/WorkComposerTriggerDetectorTests.swift
💤 Files with no reviewable changes (2)
  • apps/ios/ADE/Views/Work/WorkMentionsPickerSheet.swift
  • apps/ios/ADE/Views/Work/WorkSlashCommandsSheet.swift

Comment thread apps/desktop/src/main/services/files/fileSearchIndexService.ts
Comment thread apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift
Comment thread apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift
@arul28 arul28 force-pushed the ade/composer-chips-anywhere-a9d02bd6 branch from 18f9ad2 to f2f8c19 Compare July 5, 2026 14:47
@arul28

arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f2f8c19c8c

ℹ️ 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 apps/ade-cli/src/tuiClient/app.tsx
@arul28

arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5341f3de2e

ℹ️ 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 apps/ios/ADE/Views/Work/WorkComposerTypedTriggers.swift
arul28 and others added 5 commits July 5, 2026 11:19
…across desktop, TUI, and iOS

- shared/composerTriggers.ts: detectComposerTrigger + replaceComposerTriggerSpan; slash and @ triggers work at any cursor position with word-boundary guards (paths/URLs/fractions/emails never trigger)
- Desktop: both composer inputs (rich contenteditable + textarea) and WorkViewArea consume the shared util; selection splices exactly the trigger span; confirmed tokens render as chips (chip nodes in rich mode, backdrop overlay in textarea); IME composition guarded
- ChatCommandMenu: 300ms -> 40ms debounce, per-menu query cache with same-frame warm hits, stale-result sequence guard, spinner only when nothing to show
- fileSearchIndexService: name index split from content index (no file reads on build; quickOpen never touches content; searchText loads lazily with bounds); per-query quickOpen cache invalidated by watcher events
- registry fileSearch: sessionId->laneId cache via getSessionSummary; empty query warms the index (fileService.warmQuickOpenIndex); composer pings on session bind so first @ is instant
- TUI: prompt trigger detection is cursor-relative via the same shared module; slash menu works mid-sentence (Enter/Tab complete the token); confirmed tokens render as colored chips
- iOS: new typed-trigger detection (UITextView-backed composer), inline suggestion strip above the keyboard, attributed chip pills; dead WorkSlashCommandsSheet/WorkMentionsPickerSheet removed

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… detection, judo cleanups

- ChatCommandMenu.selectCurrent returns whether a row was selected; Enter/Tab fall through to send when a mid-sentence /token or @token has no match (desktop composer + WorkViewArea via handleCommandMenuKeyDown) instead of becoming a dead key; empty-menu arrow guards
- iOS: WorkComposerSuggestionController clears its cached workspaceId when laneId changes so @ quick-open never searches the previous lane
- registry fileSearch: skip the laneId cache for identity (CTO/worker) sessions — resumeSession can migrate their lane; regular sessions stay cached
- shared findConfirmedComposerTokens replaces duplicated token scans in the desktop overlay and TUI prompt renderer (+tests)
- collapse duplicate legacy slash-select branches; extract evaluatePlainTrigger for the three textarea handlers

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Fold fileSearchIndexService tests into fileService.test.ts (helper has a single parent module; removes the fragment file)
- AgentChatComposer.test.tsx +3: mid-sentence slash splice, Enter fall-through on unmatched token (quality A1 regression), mid-sentence @file splice + attachment
- iOS: WorkComposerTriggerDetectorTests (14 pure-logic tests; suite green on simulator)
- Docs parity: composer-and-ui source map (composerTriggers + ChatCommandMenu rows), ade-code composer section, ios-companion composer section, file-watcher session-lane cache note
- CLI/TUI parity verified clean (headless daemon shares the action registry; TUI fall-through matches desktop)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…in iOS TextKit stack; IME-guard trigger detection

- fileSearchIndexService.onFileChanged invalidates the quickOpen query cache again after the deferred removePath/upsertFile applies, so a quickOpen in the gap cannot pin a stale result set
- WorkComposerTextView retains its manually-built NSTextStorage/NSLayoutManager on the coordinator (UITextView only retains the text container)
- textViewDidChange skips detectTrigger while marked text is active, matching the didChangeSelection guard

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…palette query, mouse insert

Sweep the remaining leading-slash assumptions in the TUI palette plumbing:
arrow-key guards key off live slashRows (not prompt.startsWith("/")), the
slash palette renders for any active slash trigger, its query derives from
the trigger span, and mouse-clicking a row splices the trigger span via
insertSlashCommandRow instead of replacing the whole prompt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@arul28

arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@arul28 arul28 force-pushed the ade/composer-chips-anywhere-a9d02bd6 branch from 5341f3d to 03ed94c Compare July 5, 2026 15:20

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 03ed94c664

ℹ️ 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 apps/desktop/src/main/services/adeActions/registry.ts
ensureBuilt now awaits an in-flight buildingPromise before the early return,
and buildWorkspace invalidates the quickOpen query cache on completion (both
exit paths), so a query racing a warm build can neither see nor pin partial
results. Adds an in-flight-build regression test.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@arul28

arul28 commented Jul 5, 2026

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 9495e28059

ℹ️ 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".

@arul28 arul28 merged commit 59a8cae into main Jul 5, 2026
29 checks passed
@arul28 arul28 deleted the ade/composer-chips-anywhere-a9d02bd6 branch July 5, 2026 15:53
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