Skip to content
Open
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
4 changes: 2 additions & 2 deletions apps/desktop/e2e-budget.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"electron": "needs a second real Session (Host round trip) to switch to; the focus and draft-restore halves alone would not earn a window"
},
"session-workbar.spec.ts": {
"tests": 5,
"electron": "Git changes re-read on window focus, terminal PTY ownership across Sessions, Side Chat's fork lifecycle, and a first send that has to reach the Host; the composer-usage test is renderer-only and rides along on those windows until app-shell.tsx's composer-to-workbar wiring has a story host"
"tests": 6,
"electron": "workbar visibility persists across Session switches and reloads, Git changes re-read on window focus, terminal PTY ownership across Sessions, Side Chat's fork lifecycle, and a first send that has to reach the Host; the composer-usage test is renderer-only and rides along on those windows until app-shell.tsx's composer-to-workbar wiring has a story host"
},
"settings.spec.ts": {
"tests": 4,
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/renderer-architecture.json
Original file line number Diff line number Diff line change
Expand Up @@ -899,7 +899,7 @@
"react": 1
},
"importSpecifiers": 124,
"nonTriviaTokens": 15563
"nonTriviaTokens": 15562
},
"src/renderer/use-app-shell-composer-quotes.ts": {
"importDeclarations": 2,
Expand Down
51 changes: 21 additions & 30 deletions apps/desktop/src/renderer/app-shell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1604,6 +1604,7 @@ function AppShellContent({
modelChoices: chatModelChoices,
reportError: reportWorkbarError,
});
const { commands, selectors, LiveContextUsageProbe } = workbar;

const exitWorkHub = useCallback(() => setWorkHubActive(false), []);
const selectSessionSurface = useCallback(
Expand Down Expand Up @@ -1648,7 +1649,7 @@ function AppShellContent({
sessions,
activeSessionId: activeId,
activeSession,
hiddenSessionIds: workbar.selectors.hiddenSessionIds,
hiddenSessionIds: selectors.hiddenSessionIds,
});
const visibleSessions = sessionRail.sessions;
const sessionListCollapsed = railLayout.collapsed;
Expand Down Expand Up @@ -1727,9 +1728,9 @@ function AppShellContent({
setSearchModalOpen,
setSessionListCollapsed: sessionRailLayoutStore.setCollapsed,
workbar: {
rightCollapsed: workbar.selectors.rightCollapsed,
toggleRight: workbar.commands.toggleRight,
openTool: workbar.commands.openTool,
rightCollapsed: selectors.rightCollapsed,
toggleRight: commands.toggleRight,
openTool: commands.openTool,
},
setThemePref,
setUiLocaleOverride,
Expand Down Expand Up @@ -1764,7 +1765,7 @@ function AppShellContent({
setInteractionBySession: sessionUiController.setInteractionBySession,
onInteractionChanged: markInteractionChanged,
onExecutionBoundaryChanged: reloadActiveExecutionBoundary,
respondToUserForm: workbar.commands.respondToUserForm,
respondToUserForm: commands.respondToUserForm,
showModelSetupToast,
toastApi,
newChatModel: newChatModel ?? null,
Expand Down Expand Up @@ -1992,7 +1993,7 @@ function AppShellContent({
);
return false;
}
workbar.commands.openTool('side-chat', 'right', {
commands.openTool('side-chat', 'right', {
...(slashCommand.command.prompt
? { initialPrompt: slashCommand.command.prompt }
: {}),
Expand Down Expand Up @@ -2594,7 +2595,7 @@ function AppShellContent({
},
openProjectFolder,
openSessionInChat,
openSideConversation: () => workbar.commands.openTool('side-chat'),
openSideConversation: () => commands.openTool('side-chat'),
openSettings,
openSettingsSection,
openSkillsFolder,
Expand Down Expand Up @@ -2654,24 +2655,14 @@ function AppShellContent({
readers at all — and three writers of the same value is three chances
for them to disagree. */
data-sidebar-state={sessionListCollapsed ? 'collapsed' : 'expanded'}
/* Published here for the same reason `data-sidebar-state` is: the frame is
the only ancestor shared by the sidebar column and the titlebar strip,
and both need this number. The column is this wide; the titlebar's
session breadcrumb opens at that edge rather than straddling the seam
between the columns.

Only the EXPANDED width, and only as an inline style, because that is
the half of the answer this component owns — the user's dragged width.
The collapsed width is a constant, so shell-layout.css states it off
`data-sidebar-state`. Writing both here would duplicate the constant;
writing this one unconditionally would bury the other, since an inline
custom property outranks any rule that redefines it. */
/* The frame is the shared owner for dimensions consumed by both shell
columns and titlebar chrome. CSS clears the titlebar reserve when the
responsive layout moves the workbar below the conversation. */
style={
sessionListCollapsed
? undefined
: ({
'--maka-sidenav-width': `${sessionListWidth}px`,
} as CSSProperties)
({
'--maka-session-workbar-width': `${workbar.host.rightWidth}px`,
'--maka-sidenav-width': sessionListCollapsed ? 0 : `${sessionListWidth}px`,
} as CSSProperties)
}
>
<LiveTurnReconciler
Expand Down Expand Up @@ -2747,8 +2738,8 @@ function AppShellContent({
{!sharedSessionActive && !VIEWS_WITHOUT_WORKSPACE_ACTIONS.has(agentsView) && (
<WorkbarTitlebarActions
available={workbarAvailable}
collapsed={workbar.selectors.rightCollapsed}
onToggle={workbar.commands.toggleRight}
collapsed={selectors.rightCollapsed}
onToggle={commands.toggleRight}
/>
)}
</>
Expand Down Expand Up @@ -2893,7 +2884,7 @@ function AppShellContent({
newTaskSendPending={newTaskSendPending}
stopPendingBySession={stopPendingBySession}
respondToSandboxBoundary={respondToSandboxBoundary}
respondToClientCapability={workbar.commands.respondToClientCapability}
respondToClientCapability={commands.respondToClientCapability}
respondToUserQuestion={respondToUserQuestion}
respondToUserForm={respondToUserForm}
stop={stop}
Expand Down Expand Up @@ -2959,8 +2950,8 @@ function AppShellContent({
activeModelLabel={activeModelLabel}
activeProviderType={activeConnection?.providerType}
latestRequestUsageTokens={selectLatestRequestUsage(messages, activeTranscriptRange, activeModel, activeSessionForModelControls)}
onOpenContextUsage={() => workbar.commands.openTool('inspector')}
LiveContextUsageProbe={workbar.LiveContextUsageProbe}
onOpenContextUsage={() => commands.openTool('inspector')}
LiveContextUsageProbe={LiveContextUsageProbe}
modelChoices={chatModelChoices}
modelSwitchHasHistory={modelSwitchHasHistory}
hideUnavailableCurrentModel={sessionHealthNotice?.onClickTarget === 'model_picker'}
Expand Down Expand Up @@ -3137,7 +3128,7 @@ function AppShellContent({
text: input.text,
sourceTurnId: input.turnId,
};
workbar.commands.openSideChatWithQuote(quote);
commands.openSideChatWithQuote(quote);
}
: undefined
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ export function WorkbarHost({ model: props }: { model: WorkbarHostModel }) {
const toast = useToast();
const copy = getShellCopy(locale).app;
const style = {
'--maka-session-workbar-width': `${props.rightWidth}px`,
'--maka-session-bottom-panel-height': `${props.bottomHeight}px`,
} as CSSProperties;

Expand Down
14 changes: 13 additions & 1 deletion apps/desktop/src/renderer/styles/shell-layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,10 @@
the OS reports (macOS: traffic lights on the left; Windows: caption buttons
on the right; Linux: neither, so the design floor stands). */
padding-left: var(--maka-titlebar-gutter-left);
padding-right: calc(var(--space-6) + var(--maka-titlebar-overlay-right-width));
padding-right: calc(
var(--space-6) + var(--maka-titlebar-overlay-right-width) +
var(--maka-titlebar-workbar-reserve, 0px)
);
-webkit-app-region: drag;

/* Three columns, not a flex row, because the middle one has to line up with
Expand Down Expand Up @@ -321,6 +324,15 @@
change to the sidebar's motion, not to this strip. */
}

:where(
.appFrame:has(.maka-session-workbar[data-placement='right']:not([data-collapsed]))
)
.maka-window-titlebar {
--maka-titlebar-workbar-reserve: calc(
var(--maka-session-workbar-width) + var(--agents-content-area-gap)
);
}

/* Drag regions are hit-tested from element rects, and the top layer is invisible
to that pass: a `showModal()` dialog paints over the titlebar, but its controls
inside the titlebar rect still reach the OS as window drags. */
Expand Down
4 changes: 4 additions & 0 deletions apps/desktop/src/renderer/styles/workbar/artifacts.css
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,10 @@

/* Narrow windows place the single workbar below the conversation. */
@media (max-width: 990px) {
.maka-window-titlebar {
--maka-titlebar-workbar-reserve: 0px;
}

.maka-detail-with-artifacts {
grid-template-areas:
"main"
Expand Down
Loading