Skip to content

feat(cloud-agent): improve topbar, mobile UX, and session management#1677

Merged
eshurakov merged 6 commits intomainfrom
eshurakov/cloud-agent/top-bar-and-prompt
Mar 31, 2026
Merged

feat(cloud-agent): improve topbar, mobile UX, and session management#1677
eshurakov merged 6 commits intomainfrom
eshurakov/cloud-agent/top-bar-and-prompt

Conversation

@eshurakov
Copy link
Copy Markdown
Contributor

@eshurakov eshurakov commented Mar 27, 2026

Summary

Integrates the cloud agent pages with the shared app topbar, adds mobile-responsive toolbar controls, and improves the new-session UX.

Topbar integration: Cloud agent pages now use the shared AppTopbar instead of hiding it. The session title (or repo name) and cost display are rendered in the topbar. ChatHeader is stripped down to floating action buttons (sound, menu, feedback) positioned top-right.

Mobile toolbar: Below the md breakpoint, the individual Mode/Model/Variant pickers collapse into a single MobileToolbarPopover. Popover widths are clamped to min(Xrem, calc(100vw - 2rem)) to prevent overflow on small screens. A MobileSidebarToggle button replaces the old hamburger menu for opening the session list on mobile.

New session UX: The most recent repo is auto-selected. Repo selection is no longer required to start a session (shows an error toast instead). The new-session panel gets the same mobile toolbar treatment.

Auto-scroll: Programmatic scrolls are distinguished from user scrolls via isAutoScrollingRef. Rapid streaming updates are coalesced with requestAnimationFrame. Scrolling up disables auto-scroll; scrolling near bottom re-enables it. Session switches reset scroll state.

Child session filtering: Sessions with a parentSessionId are excluded from the active sessions list in UserConnectionDO. Protocol schema updated with tests.

CSS: scrollbar-gutter: stable applied globally instead of desktop-only.

Verification

  • Format check passed (pre-push hook)
  • Lint passed (pre-push hook)
  • Typecheck passed (pre-push hook)

Visual Changes

Screenshot 2026-03-30 at 17 30 43

Reviewer Notes

  • The PageTitleContext no longer exposes hidden/setHidden — cloud agent pages now always show the topbar.
  • ChatHeader lost most of its content (repo, branch, model, cost) since that info moved to the topbar and inline areas. It now only renders action buttons.
  • The mobile breakpoint for toolbar controls is md (768px). The sidebar toggle breakpoint is lg (1024px).

@kilo-code-bot
Copy link
Copy Markdown
Contributor

kilo-code-bot bot commented Mar 27, 2026

Code Review Summary

Status: 6 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 6
SUGGESTION 0
Issue Details (click to expand)

The incremental diff fixes the previous sidebar ordering warning in src/components/cloud-agent-next/hooks/useSidebarSessions.ts; no new issues found in changed lines.

Other Observations (not in diff)

Issues found in unchanged code that cannot receive inline comments:

File Line Issue
kiloclaw/controller/src/routes/kilo-cli-run.ts 227 The cancel route marks the run cancelled immediately after sending SIGTERM, so the SIGKILL fallback never fires if the child ignores SIGTERM and the agent can keep running indefinitely.
src/routers/kiloclaw-router.ts 1003 The controller run starts before the database row is inserted; if the insert fails, the user is left with an active repair job but no persisted runId to poll or cancel.
src/routers/kiloclaw-router.ts 1064 Polling any stale running row persists the controller current run output onto that row without verifying it matches input.runId, which can corrupt run history after a later run starts.
src/routers/kiloclaw-router.ts 1096 Cancelling a stale running row always cancels the controller current run and then marks input.runId cancelled, so the database can report the wrong run as cancelled.
src/app/(app)/cloud/(agent)/layout.tsx 8 The suspense fallback still uses h-dvh; now that the app topbar is visible again, the loading state is taller than the viewport and can render below the fold.
src/app/(app)/organizations/[id]/cloud/(agent)/layout.tsx 17 The org cloud route has the same h-dvh loading fallback regression, so the initial spinner can appear below the visible area.

Fix these issues in Kilo Cloud

Files Reviewed (1 file)
  • src/components/cloud-agent-next/hooks/useSidebarSessions.ts - previous warning resolved

Reviewed by gpt-5.4-20260305 · 135,456 tokens

- Add mobile toolbar popover and constrain popover widths to viewport
- Left-align topbar title and improve mobile session list button
- Show app topbar with session context on cloud pages
- Improve new session UX and filter child sessions
@eshurakov eshurakov force-pushed the eshurakov/cloud-agent/top-bar-and-prompt branch from 595b1dd to 5c62c3a Compare March 30, 2026 15:09
@eshurakov eshurakov changed the title feat(cloud-agent): improve new session UX and filter child sessions feat(cloud-agent): improve topbar, mobile UX, and session management Mar 30, 2026
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm reverting this because my previous PR changed it and it wasn't needed

Long-lived sessions updated recently were disappearing from the sidebar
because the cutoff filtered on created_at while grouping uses updatedAt.
@markijbema
Copy link
Copy Markdown
Contributor

ChatHeader lost most of its content (repo, branch, model, cost) since that info moved to the topbar and inline areas. It now only renders action buttons.

I don't see repo in the screenshot?

…query keys

Replace server-computed recentDays with client-computed updatedSince ISO
datetime. This produces a stable tRPC query key per mount, improving
react-query cache hit rates.
…ssion lifecycle

Thread githubRepo, gitUrl, and platform through registerSession so early
metadata reflects the git source. Emit branch name in the 'ready' preparing
event and update fetchedSessionData on the client so the UI shows the
correct branch immediately after async preparation completes.
… appear first

The unifiedSessions.list endpoint defaults orderBy to created_at. The
sidebar filters by updatedSince but never overrode the sort order, so a
long-lived session that just became active would still sort below newer
inactive sessions.
@eshurakov eshurakov merged commit ff1ec4a into main Mar 31, 2026
19 checks passed
@eshurakov eshurakov deleted the eshurakov/cloud-agent/top-bar-and-prompt branch March 31, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants