Skip to content
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
4bb8963
feat(shell): stream workspace changes into the explorer
rohitg00 Aug 13, 2026
47761a6
feat(shell): system-level workspace watch behind shell::changed
rohitg00 Aug 13, 2026
db62869
feat(shell): live follow opens as a diff, deep noise filter
rohitg00 Aug 13, 2026
1d4b563
fix(shell): created files reach the live diff as creations
rohitg00 Aug 13, 2026
51d90f2
fix(shell): temp artifacts never steal the live follow
rohitg00 Aug 13, 2026
f4db8fd
docs(shell): document the shell::changed trigger type
rohitg00 Aug 13, 2026
e7b1019
feat(shell): review feed, lazy deep folders, nested-repo diffs, noise…
rohitg00 Aug 13, 2026
560c10b
feat(shell): line-count chips and totals in the changes feed
rohitg00 Aug 13, 2026
d9dec5e
feat(shell): burst-grouped changes feed
rohitg00 Aug 13, 2026
990a897
feat(shell): own diff renderer with folds, syntax color, and dir-awar…
rohitg00 Aug 13, 2026
f7d2eb2
fix(shell): own atomic-write temps never stream
rohitg00 Aug 13, 2026
f29bda3
feat(shell): diff pane matches the reference rendering
rohitg00 Aug 13, 2026
c479c6d
feat(shell): consume the open-in-shell deep link
rohitg00 Aug 13, 2026
de92f68
fix(shell): jailed watch paths, unstallable fan-out, bounded diffs
rohitg00 Aug 13, 2026
28e8049
(MOT-4407) feat(shell): polish live explorer review UI
rohitg00 Aug 13, 2026
5f1039d
(MOT-4407) feat(shell): add Codex-style workspace review
rohitg00 Aug 13, 2026
76cd044
(MOT-4407) feat(shell): edit worktree diffs safely
rohitg00 Aug 13, 2026
3d0d689
(MOT-4407) merge main into shell live explorer
rohitg00 Aug 13, 2026
1827dd0
(MOT-4407) docs(shell): add post-merge live review screenshot
rohitg00 Aug 13, 2026
b7766c4
(MOT-4407) fix(shell): keep explorer synced to chat root
rohitg00 Aug 13, 2026
303573c
(MOT-4407) fix(shell): retain exact working directory roots
rohitg00 Aug 13, 2026
62c01f5
(MOT-4407) fix(shell): avoid replaying collapse all
rohitg00 Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions console/web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,7 @@ function ScreenBody({
onRequestClose={onClose}
onMissing={onExtMissing}
workingDir={active?.workingDir ?? null}
conversationId={active?.id ?? null}
/>
)
}
Expand Down
34 changes: 31 additions & 3 deletions console/web/src/components/chat/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ import {
mergeFiredTriggers,
type SessionTriggerInfo,
} from '@/lib/backend/triggers'
import { copyTextToClipboard } from '@/lib/clipboard'
import type {
ApprovalStreamEvent,
CompactResult,
QueuedMessagePreview,
} from '@/lib/backend/types'
import { copyTextToClipboard } from '@/lib/clipboard'
import { useConversationsCtxOptional } from '@/lib/conversations-context'
import { syncEditorWorkspace } from '@/lib/editor-sync'
import { expandFileMentions, parseFileMentions } from '@/lib/file-mentions'
Expand All @@ -46,7 +46,7 @@ import {
summaryLabel,
} from '@/lib/pdf-attachments'
import { newMessageId } from '@/lib/session-id'
import { useExtSessionChips } from '@/lib/ui-slots'
import { useExtSessionChips, useExtSessionTurnSummaries } from '@/lib/ui-slots'
import { cn } from '@/lib/utils'
import { fetchDefaultWorkingDir, validateWorkspaceDir } from '@/lib/working-dir'
import {
Expand Down Expand Up @@ -646,6 +646,24 @@ export function ChatView({
(chip) => chip.id === 'context',
)

/* Injected turn summaries live beside the composer rather than in the
* transcript. Workers own their data and subscribe by session id; the host
* only gives them the active turn state. */
const extSessionTurnSummaries = useExtSessionTurnSummaries()
const sessionTurnSummaries = useMemo(() => {
if (extSessionTurnSummaries.length === 0) return null
return [...extSessionTurnSummaries].sort(compareChips).map((summary) => {
const Summary = summary.render
return (
<Summary
key={summary.id}
sessionId={conversation.id}
isStreaming={streamingIndicator}
/>
)
})
}, [extSessionTurnSummaries, conversation.id, streamingIndicator])

/* Shared live region: SR announcements for auto-accept, stop-reason
* notices, and compaction markers route through this hook. Sighted
* users see the same messages in the transcript; visually-impaired
Expand Down Expand Up @@ -1729,7 +1747,9 @@ export function ChatView({
type="button"
onClick={handleCopySessionId}
aria-label={
copied ? `copied ${sessionId}` : `copy session id ${sessionId}`
copied
? `copied ${sessionId}`
: `copy session id ${sessionId}`
}
className="flex self-stretch items-center gap-1 text-ink-faint hover:text-ink transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent"
>
Expand Down Expand Up @@ -1929,6 +1949,14 @@ export function ChatView({
) : null}
</section>
) : null}
{sessionTurnSummaries ? (
<div
className="flex flex-wrap items-center justify-end gap-1.5 px-1"
data-chat-turn-summary-slot
>
{sessionTurnSummaries}
</div>
) : null}
<Composer
mode={conversation.mode}
model={effectiveModel}
Expand Down
20 changes: 20 additions & 0 deletions console/web/src/components/ui/FileDiff.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ export interface FileDiffProps {
diffStyle?: 'unified' | 'split'
/** Long lines wrap by default; `'scroll'` preserves strict columns. */
overflow?: 'scroll' | 'wrap'
/** Intraline emphasis. `'none'` keeps only whole-line highlighting. */
lineDiffType?: 'word-alt' | 'word' | 'char' | 'none'
/** Ignore leading/trailing whitespace when computing changed lines. */
ignoreWhitespace?: boolean
/** Render the file body folded; useful for collapse-all review controls. */
collapsed?: boolean
/** Expand every unchanged line instead of the compact hunk view. */
expandUnchanged?: boolean
/** Hide Pierre's file header when the caller supplies its own review row. */
disableFileHeader?: boolean
className?: string
}

Expand All @@ -32,6 +42,11 @@ export function FileDiff({
newFile,
diffStyle = 'unified',
overflow = 'wrap',
lineDiffType = 'word-alt',
ignoreWhitespace = false,
collapsed = false,
expandUnchanged = false,
disableFileHeader = false,
className,
}: FileDiffProps) {
const [theme] = useTheme()
Expand All @@ -43,6 +58,11 @@ export function FileDiff({
options={{
diffStyle,
overflow,
lineDiffType,
collapsed,
expandUnchanged,
disableFileHeader,
parseDiffOptions: { ignoreWhitespace },
theme: DEFAULT_THEMES,
themeType: theme,
}}
Expand Down
17 changes: 17 additions & 0 deletions console/web/src/lib/ui-loader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,14 @@ import {
registerExtPage,
registerExtRenderer,
registerExtSessionChip,
registerExtSessionTurnSummary,
} from '@/lib/ui-slots'
import type {
ConfigFormProps,
ConsoleApi,
Host,
SessionChipProps,
SessionTurnSummaryProps,
SetupFn,
UiAssetKind,
UiAssetRef,
Expand Down Expand Up @@ -158,6 +160,21 @@ function makeHost(
}),
)
},
registerTurnSummary(summary) {
const Summary = summary.render
return track(
registerExtSessionTurnSummary({
...summary,
scope,
path,
render: (props: SessionTurnSummaryProps) => (
<ScopedExtension scope={scope} path={path}>
<Summary {...props} />
</ScopedExtension>
),
}),
)
},
},
}
}
Expand Down
46 changes: 46 additions & 0 deletions console/web/src/lib/ui-slots.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {
FunctionTriggerRenderer,
PageRegistration,
SessionChipRegistration,
SessionTurnSummaryRegistration,
} from '@/types/injectable-ui'

export interface RegisteredPage extends PageRegistration {
Expand Down Expand Up @@ -41,6 +42,12 @@ export interface RegisteredSessionChip extends SessionChipRegistration {
path: string
}

export interface RegisteredSessionTurnSummary
extends SessionTurnSummaryRegistration {
scope: string
path: string
}

interface Store<T> {
subscribe(listener: () => void): () => void
get(): readonly T[]
Expand Down Expand Up @@ -80,6 +87,7 @@ const pagesStore = createStore<RegisteredPage>()
const renderersStore = createStore<RegisteredRenderer>()
const configFormsStore = createStore<RegisteredConfigForm>()
const sessionChipsStore = createStore<RegisteredSessionChip>()
const sessionTurnSummariesStore = createStore<RegisteredSessionTurnSummary>()

/**
* Register an extension page. Duplicate `id`: last registration wins in
Expand Down Expand Up @@ -129,6 +137,22 @@ export function registerExtSessionChip(
return sessionChipsStore.add(entry)
}

/** Duplicate summary id: last registration wins in chat footer lookups. */
export function registerExtSessionTurnSummary(
entry: RegisteredSessionTurnSummary,
): () => void {
const duplicate = sessionTurnSummariesStore
.get()
.find((summary) => summary.id === entry.id)
if (duplicate) {
console.warn(
`[iii-ui] duplicate session turn-summary id '${entry.id}' - ` +
`'${entry.path}' overrides '${duplicate.path}'`,
)
}
return sessionTurnSummariesStore.add(entry)
}

export function getExtPages(): readonly RegisteredPage[] {
return pagesStore.get()
}
Expand Down Expand Up @@ -184,6 +208,28 @@ export function useExtSessionChips(): readonly RegisteredSessionChip[] {
return useMemo(() => dedupeSessionChips(chips), [chips])
}

function dedupeSessionTurnSummaries(
summaries: readonly RegisteredSessionTurnSummary[],
): readonly RegisteredSessionTurnSummary[] {
const byId = new Map<string, RegisteredSessionTurnSummary>()
for (const summary of summaries) byId.set(summary.id, summary)
return [...byId.values()]
}

/** Footer turn summaries deduplicated by id; last registration wins. */
export function getExtSessionTurnSummaries(): readonly RegisteredSessionTurnSummary[] {
return dedupeSessionTurnSummaries(sessionTurnSummariesStore.get())
}

export function useExtSessionTurnSummaries(): readonly RegisteredSessionTurnSummary[] {
const summaries = useSyncExternalStore(
sessionTurnSummariesStore.subscribe,
sessionTurnSummariesStore.get,
() => EMPTY,
)
return useMemo(() => dedupeSessionTurnSummaries(summaries), [summaries])
}

/** The injected form override for one configuration id (last wins). */
export function useExtConfigForm(
configurationId: string,
Expand Down
49 changes: 49 additions & 0 deletions console/web/src/lib/ui-turn-summary-slots.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import { describe, expect, it } from 'vitest'
import type { RegisteredSessionTurnSummary } from './ui-slots'
import {
getExtSessionTurnSummaries,
registerExtSessionTurnSummary,
} from './ui-slots'

function summary(id: string, path: string): RegisteredSessionTurnSummary {
return { id, path, scope: path.split('/')[0], render: () => null }
}

describe('session turn-summary slot', () => {
it('dedupes by id and restores a shadowed registration', () => {
const offShell = registerExtSessionTurnSummary(
summary('changed-files', 'shell/page.js'),
)
const offOther = registerExtSessionTurnSummary(
summary('changed-files', 'other/page.js'),
)

expect(getExtSessionTurnSummaries().map((item) => item.path)).toEqual([
'other/page.js',
])

offOther()
expect(getExtSessionTurnSummaries().map((item) => item.path)).toEqual([
'shell/page.js',
])

offShell()
offShell()
expect(getExtSessionTurnSummaries()).toEqual([])
})

it('preserves registration order across distinct ids', () => {
const offA = registerExtSessionTurnSummary(
summary('changed-files', 'shell/page.js'),
)
const offB = registerExtSessionTurnSummary(summary('tests', 'test/page.js'))

expect(getExtSessionTurnSummaries().map((item) => item.id)).toEqual([
'changed-files',
'tests',
])

offA()
offB()
})
})
4 changes: 4 additions & 0 deletions console/web/src/pages/Ext/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ interface ExtPageProps {
* filesystem-shaped pages can follow the chat's folder.
*/
workingDir?: string | null
/** Active chat id for session-scoped reactive pages. */
conversationId?: string | null
}

export function ExtPage({
Expand All @@ -62,6 +64,7 @@ export function ExtPage({
tabId = '',
onRequestClose,
workingDir,
conversationId,
}: ExtPageProps) {
const routePageId = useExtPageRoute()
const pageId = pageIdProp ?? routePageId
Expand Down Expand Up @@ -122,6 +125,7 @@ export function ExtPage({
tabId={tabId}
onRequestClose={onRequestClose}
workingDir={workingDir}
conversationId={conversationId}
/>
</div>
)
Expand Down
23 changes: 23 additions & 0 deletions console/web/src/types/injectable-ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ export interface PageRenderProps {
* no conversation is active or none is set.
*/
workingDir?: string | null
/** Active chat session id. Reactive pages use it to subscribe to exact
Harness turn boundaries without receiving another chat's events. */
conversationId?: string | null
}

export interface PageRegistration {
Expand Down Expand Up @@ -197,6 +200,25 @@ export interface SessionChipRegistration {
render: React.ComponentType<SessionChipProps>
}

/**
* Props a chat footer turn-summary receives. The extension owns the summary
* data; the host supplies only the active session and its live turn state.
*/
export interface SessionTurnSummaryProps {
sessionId: string
isStreaming: boolean
}

/**
* A compact per-session summary rendered immediately above the composer.
* Duplicate `id`: last registration wins.
*/
export interface SessionTurnSummaryRegistration {
/** kebab-case; convention `<worker>-<name>`. */
id: string
render: React.ComponentType<SessionTurnSummaryProps>
}

/**
* What `setup(host)` receives. Every registrar returns an unregister fn AND
* is auto-tracked: the loader runs all of them on dispose.
Expand All @@ -221,6 +243,7 @@ export interface Host {
}
chat: {
registerSessionChip(chip: SessionChipRegistration): () => void
registerTurnSummary(summary: SessionTurnSummaryRegistration): () => void
}
}

Expand Down
2 changes: 1 addition & 1 deletion harness/src/hooks/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub struct HookTriggerConfig {
/// pre/post_trigger only: target function_id globs to consult on.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub functions: Option<Vec<String>>,
/// post_turn only: session_id globs this validator gates (omit = all).
/// pre_turn/post_turn: session_id globs this hook applies to (omit = all).
#[serde(default, skip_serializing_if = "Option::is_none")]
pub sessions: Option<Vec<String>>,
/// post_turn only: template mode — send THIS argument object to the
Expand Down
Loading