Repository navigation
Type tool input/metadata in the domain; point the display pipeline's dependencies downward - #1013
Merged
ivanfenenko merged 2 commits intoNov 10, 2026
Conversation
Timeline UI indexed a tool part's raw input / metadata JSON by wire key (per-tool chrome, step titles, background work, child session linking, the tool result sheet). Add ToolPartFields in domain/message on both platforms: per-meaning accessors (inputPattern, inputTargetPath, childSessionId, patchFiles, executeCallPreviews, questionAnswers, summaryCalls, resultFields, withChildSessionId, ...) that keep each surface's existing read rule. UI consumes them; the raw fields stay on the model, so the session cache and protocol adapters are untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Android: DisplayMessagePipeline called the UI block builder to decide whether a message is one text block. PresentationBlockId and the default timeline's text-run segmentation (text runs, tool grouping, visibility and part-id rules) move to domain/message/pipeline as TimelineSegments; the UI builder maps segments to blocks and the pipeline counts text runs. A test checks the two agree. iOS: the Markdown document model (NativeMarkdownDocument and its block, inline, code-span and diff types), the variant/detector and the parser move from Components / UI to Domain/Markdown; the SwiftUI rendering stays in Components. The highlighter reaches DisplayMessagePipeline and MessageContentPreparer.shared through their initializers from AppContainer instead of the domain reading Container. Co-Authored-By: Claude Opus 5.5 <[email protected]>
ivanfenenko
marked this pull request as ready for review
November 10, 2026 08:16
ivanfenenko
added a commit
that referenced
this pull request
Nov 10, 2026
…out of the wrong layer (#1012) * Type live-event queries in the domain on both platforms Feature code matched server event-name strings and read raw event properties itself. Add typed queries on OpencodeEvent in domain/event (worktree and branch updates, run end, reconnect, model catalog refresh, archive change, session error and user abort, title / revert / delete / move updates) and move the event names there. UI subscribers use the typed form, and SessionInfo / SessionChatViewModel no longer hold an EventDomainAdapter. The adapter keeps its query methods as delegates. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Move Android UiText out of the ui package Five domain files imported UiText from ui.text. The plain type and its lookup-based resolve move to domain.text; the Android Resources lookup and the Compose resolve() stay in ui.text (UiTextResources.kt). The serialization surrogates in TimelineText.kt carry explicit serial names, so navigation keys serialize exactly as before. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Move SplitPanePreferences beside the split-pane component The store in domain/preferences depended on the design-system types OpenCodeSplitPaneScreen / State / Layout on both platforms. It now lives next to the component (Android ui/components/layout, package ui.components; iOS Components/Layout). Storage names, keys and values are unchanged. The screenshot module already compiles ui/components/layout, so its symlink to the old path is removed. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Type tool input/metadata in the domain; point the display pipeline's dependencies downward (#1013) * Read tool input and metadata through typed domain accessors Timeline UI indexed a tool part's raw input / metadata JSON by wire key (per-tool chrome, step titles, background work, child session linking, the tool result sheet). Add ToolPartFields in domain/message on both platforms: per-meaning accessors (inputPattern, inputTargetPath, childSessionId, patchFiles, executeCallPreviews, questionAnswers, summaryCalls, resultFields, withChildSessionId, ...) that keep each surface's existing read rule. UI consumes them; the raw fields stay on the model, so the session cache and protocol adapters are untouched. Co-Authored-By: Claude Opus 5.5 <[email protected]> * Point the display pipeline's dependencies down into the domain Android: DisplayMessagePipeline called the UI block builder to decide whether a message is one text block. PresentationBlockId and the default timeline's text-run segmentation (text runs, tool grouping, visibility and part-id rules) move to domain/message/pipeline as TimelineSegments; the UI builder maps segments to blocks and the pipeline counts text runs. A test checks the two agree. iOS: the Markdown document model (NativeMarkdownDocument and its block, inline, code-span and diff types), the variant/detector and the parser move from Components / UI to Domain/Markdown; the SwiftUI rendering stays in Components. The highlighter reaches DisplayMessagePipeline and MessageContentPreparer.shared through their initializers from AppContainer instead of the domain reading Container. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]> * Invalidate on background stop from the occupancy stream only The sync coordinator invalidated on both the stopped occupancy and the backgroundStop signal, which arrive on separate tasks. A late signal could invalidate after a foreground catch-up started and force a second reload, which made ProjectionReconciliationTests flaky on CI. Co-Authored-By: Claude Fable 5.2 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
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.
Layering refactor, part 2 of 2. Stacked on #1012 (base branch
chore/typed-events-and-neutral-ui-types); review and merge that first. No behaviour change, no UI change.What moved and why
ToolPart.input/.metadata(per-tool chrome and step titles, background work, child session linking, the tool result sheet). Newdomain/message/ToolPartFields(.kt/.swift) holds per-meaning accessors with the same names on both platforms:inputPattern,inputSearchPath,inputQuery,inputUrl/inputURL,inputCommand,inputTaskBrief,inputTargetPath,inputReadPath,inputQuestions,questionAnswers,childSessionId,isBackground,fileExisted,exitCode,patchFileCount,patchFiles,filediff*,executeCallPreviews,resultFields,linkedChildSessionId,withChildSessionId,subagent*,summaryCalls, and so on. Each accessor keeps the exact read rule its surface used (for example, Android's builder reads a JSONnullas"null"while the result sheet skips it; background work only accepts JSON strings), so every tool renders as before. The raw fields stay on the model:SessionCacheCodec(schemaVersion 1) and both protocols' adapters are untouched.ToolPartIdentity.isQuestion(tool)was added so UI does not passtool.input.DisplayMessagePipelinecalled the UI block builder (buildOrFallback) to decide whether a message is a single text block.PresentationBlockIdand the default timeline's segmentation (text runs, tool grouping, transparent parts, visibility and part-id rules) move todomain/message/pipeline(TimelineSegments). The UI builder's default path now maps those segments to blocks, and the pipeline counts text runs (TimelineSegments.hasSoleTextBlock). The chip, step-rail and activity-card builders stay in the UI.SessionChatTimelineBlocksResultstays in the UI in its own file. A newTimelineSegmentsTestchecks that the pipeline rule agrees with the built blocks.DisplayMessagePipelineCharacterizationTestis unchanged and green.NativeMarkdownDocument, block/inline/list/table/code-span/diff/diagnostic types, data only),OpenCodeRenderedMarkdownVariant,OpenCodeRenderedMarkdownDetectorandOpenCodeRenderedMarkdownParsermove fromComponents/ChatandUI/MarkdowntoDomain/Markdown. The SwiftUI rendering stays in Components.MessageContentPreparer.sharedis now defined inDI/AppContainer.swiftwithContainer.codeHighlighterpassed to its initializer, andAppContainerpasses the highlighter toDisplayMessagePipeline(codeHighlighter:)for memory-pressure trims.Domain/no longer referencesContaineror imports FactoryKit in those two files.After this PR:
grep -rn "^import dev.opencode.mobile.ui" android/.../domainis empty; no non-playground file under Androidui/importskotlinx.serialization.json; no non-playground file under iOSUI/orComponents/referencesAnyCodableorAnySendable.Checks
android/:./gradlew :app:assembleDebug :app:compileDebugAndroidTestKotlin :app:testDebugUnitTest --continue→ BUILD SUCCESSFUL; 3508 unit tests, 0 failures, 1 skipped (one new test). The first commit was also compiled on its own, and its timeline, tool-result, background-work and linker tests passed (284 tests).xcodebuild build-for-testingDebug andxcodebuild buildRelease forgeneric/platform=iOS Simulator→ succeeded.xcodebuild test -only-testing:"OpenCode MobileTests"on a dedicated simulator → 3474 tests in 334 suites passed.gitleaks git --pre-commit --stagedbefore each commit: no leaks.Risks / Follow-ups
TimelineSegments. Only the default path was cut; the chip, step-rail and activity-card walks still sit in the UI builder.lineas a scalar. On iOS,summaryCallCountreturns the raw count (including 0) andsearchResultCountreadsmatchesthencount. Android hasgrepMatchCount/globFileCountand ignores an empty summary. iOS also hasinputRequestedToolandinputDirectory, which Android UI has no use for.DisplayMessagePipeline's snapshot-source initializer (playground and tests) still does not observe memory pressure, as before. TheMessageSyncinitializer defaultscodeHighlighterto the sameHighlightCoreHighlightingEngine.sharedthatContainer.codeHighlighteris.android/screenshotfails to compile onorigin/mainas well (pre-existing, see Type live events in the domain; move UiText and SplitPanePreferences out of the wrong layer #1012); none of the moved files are symlinked into it.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.