Compose conversation cards by payload - #57
Merged
VolkerChristian merged 2 commits intoAug 27, 2026
Conversation
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.
Summary\n\n- compose conversation cards directly from their typed payload variants instead of maintaining parallel card-kind construction, update, and comparison switches\n- colocate each payload's construction and update logic while retaining the existing shared ConversationCard ownership and folding behavior\n- reconcile user-message image thumbnails by path so text-only updates retain unchanged thumbnails\n- preserve generated-image reload behavior because an image may become available later at the same path\n\n## Measurements\n\nRelease build, median of five representative runs:\n\n| Scenario | Before | After |\n| --- | ---: | ---: |\n| Mixed card construction | 302.625 us | 303.405 us |\n| Agent-message update | 12.6386 us | 12.6158 us |\n| 80-card no-op reconciliation | 2.39619 us | 2.39586 us |\n| One changed card among 80 | 2310.98 us | 2308.48 us |\n| Text update with unchanged image | 7613.13 us | 11.5443 us |\n\nThe unchanged-thumbnail path is approximately 660x faster. The remaining differences are measurement noise.\n\n## Simplification\n\n- removes three parallel decision trees in favor of payload-directed composition\n- production code is net 12 lines smaller\n- adds no controllers, repositories, caches, event systems, or duplicated application state\n- keeps card identity, folding, command output, generated-image, and LocalPrompt-to-UserMessage behavior intact\n\n## Tests\n\n- focused conversation-card tests passed after each commit\n- complete suite: 7/7 passed, 0 failures\n\nFocused coverage includes unchanged image retention, path replacement, deletion, recreation, and unavailable-image placeholders.\n\n## Scope\n\nThis PR intentionally excludes:\n\n- PR8: information/approval orange-card behavior and placement\n- PR9: background-activity spinner/notification\n- PR10: intermittent first-response card overlap/layout settlement\n- protocol changes\n- child-thread ownership or hierarchy changes\n- unrelated styling and features\n