Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions docs/ui-behavior.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ keyed by stable thread, turn, and item IDs; local prompt cards are keyed by
their submission IDs. The same keyed reconcile path handles initial display
and updates, mutating a card in place when its visible data changes. An
identical visible projection does not rebuild widgets or change geometry.
The complete prompt content, including attachments, adds the canonical 8 px
structural section gap before its first nested turn card. This spacing is
layout geometry and never becomes part of authored Markdown.

Local prompt admission resumes bottom following when the only pause was caused
by composer overlay growth, so the complete pending prompt becomes visible.
Expand Down
4 changes: 3 additions & 1 deletion src/codex/middle/ConversationCards.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,9 @@ class ConversationCard::Impl final {
nestedCards = new QWidget(owner);
nestedCards->setObjectName(QStringLiteral("conversationNestedCards"));
nestedLayout = new QVBoxLayout(nestedCards);
nestedLayout->setContentsMargins(0, 0, 0, 0);
// Keep a visible section boundary between the complete prompt and the
// activity nested beneath it, in addition to ordinary widget spacing.
nestedLayout->setContentsMargins(0, 8, 0, 0);
nestedLayout->setSpacing(8);
nestedCards->hide();
layout->addWidget(nestedCards);
Expand Down
39 changes: 36 additions & 3 deletions tests/codex/ConversationCardsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1458,7 +1458,24 @@ bool testCardFoldingGeometryAndRetention() {
view.resize(700, 820);
view.setTrailingSpaceHeight(500);
view.show();
bool result = expect(view.reconcile(snapshot), "folding fixture renders");
ConversationSnapshot promptOnly = snapshot;
promptOnly.sections.front().cards = {user};
bool result =
expect(view.reconcile(promptOnly), "prompt-only folding fixture renders");
spin();

ConversationCard *promptOnlyCard = card(view, stableKey(user.key));
QWidget *promptOnlyNestedCards =
promptOnlyCard
? promptOnlyCard->findChild<QWidget *>(
QStringLiteral("conversationNestedCards"),
Qt::FindDirectChildrenOnly)
: nullptr;
result &= expect(promptOnlyCard && promptOnlyNestedCards &&
promptOnlyNestedCards->isHidden(),
"an initial turn prompt reserves no nested-card gap");
result &= expect(view.reconcile(snapshot),
"first nested activity extends the folding fixture");
spin();

ConversationCard *userCard = card(view, stableKey(user.key));
Expand All @@ -1483,10 +1500,12 @@ bool testCardFoldingGeometryAndRetention() {
disclosure(reasoningCard)->property("chevronDirection") == "left",
"all cards share disclosure controls with role-correct initial state");
result &= expect(
userCard && userCard->property("authoritativeTurnActive").toBool() &&
userCard && userCard == promptOnlyCard &&
userCard->property("authoritativeTurnActive").toBool() &&
!agentCardWidget->property("authoritativeTurnActive").toBool() &&
!userCard->findChild<QTimer *>(QStringLiteral("activeTurnAnimation")),
"only the running outer You card receives a static emphasized border");
"the retained running outer You card receives a static emphasized "
"border");
snapshot.activeTurnId.reset();
result &= expect(view.reconcile(snapshot) &&
userCard == card(view, stableKey(user.key)) &&
Expand Down Expand Up @@ -1519,6 +1538,20 @@ bool testCardFoldingGeometryAndRetention() {
userCard->isAncestorOf(reasoningCard) &&
agentCardWidget->property("nestedConversationCard").toBool(),
"the first You card structurally owns its turn activity");
QWidget *promptContent = userCard->findChild<QWidget *>(
QStringLiteral("conversationCardContent"), Qt::FindDirectChildrenOnly);
const int promptContentBottom =
promptContent ? promptContent->geometry().y() + promptContent->height()
: -1;
const int firstNestedTop = agentCardWidget->mapTo(userCard, QPoint{}).y();
QWidget *nestedCards = userCard->findChild<QWidget *>(
QStringLiteral("conversationNestedCards"), Qt::FindDirectChildrenOnly);
result &= expect(
promptContent && nestedCards && nestedCards->layout() &&
nestedCards->layout()->contentsMargins().top() == 8 &&
firstNestedTop - promptContentBottom == 14,
"turn prompt content adds a visible canonical 8 px section boundary "
"before its first nested card");

const LocalPromptKey steeringKey{4343};
VisibleCardData steering{
Expand Down
2 changes: 1 addition & 1 deletion web/src/styles.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web/tests/responsive-layout.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ test("responsive CSS keeps the desktop grid and removes the old document-width f
assert.match(css, /\.thread-row \.status-dot\.danger\s*\{[^}]*background:\s*#c43d4d/u);
assert.match(css, /\.conversation-card\.userMessage\.steering\s*\{[^}]*background:\s*#eefafa;[^}]*border-color:\s*#9fd7d8/u);
assert.match(css, /\.conversation-card\.localPrompt\.steering\s*\{[^}]*background:\s*#eefafa;[^}]*border-color:\s*#5caeb1/u);
assert.match(css, /\.turn-nested\s*\{[^}]*gap:\s*8px;[^}]*margin-top:\s*8px/u);
assert.doesNotMatch(css, /acknowledgment-fade/u);
assert.match(css, /conversation-card\.turn-container\.active-turn[^}]*#6f98e8/u);
assert.match(css, /\.send-button\.steer\s*\{[^}]*background:\s*#167b80[^}]*color:\s*#fff/u);
Expand Down
Loading