Files
hermes-agent/apps/desktop/src/app/chat/session-history-nav.tsx
T
m4 fb13457f6f
CI / Supply-chain scan (push) Has been cancelled
Docker Build, Test, and Publish / Detect affected areas (push) Has been cancelled
auto-fix lint issues & formatting / Generate eslint --fix patch (push) Has been cancelled
Nix flake check / Detect affected areas (push) Has been cancelled
Deploy Site / deploy-vercel (push) Has been cancelled
Deploy Site / deploy-docs (push) Has been cancelled
CI / Detect affected areas (push) Has been cancelled
Docker Build, Test, and Publish / build (amd64, type=gha,scope=docker-amd64, type=gha,mode=max,scope=docker-amd64, linux/amd64, ubuntu-latest-32-core) (push) Has been cancelled
CI / Desktop E2E (push) Has been cancelled
CI / Docs Site (push) Has been cancelled
CI / Deny unrelated histories (push) Has been cancelled
CI / Check contributors (push) Has been cancelled
Docker Build, Test, and Publish / build (arm64, type=gha,scope=docker-arm64, type=gha,mode=max,scope=docker-arm64, linux/arm64, ubuntu-latest-32-arm-core) (push) Has been cancelled
CI / Check uv.lock (push) Has been cancelled
CI / Check no committed infographics (push) Has been cancelled
CI / Profile artifact check (push) Has been cancelled
Docker Build, Test, and Publish / publish (amd64, type=gha,scope=docker-amd64, type=gha,mode=max,scope=docker-amd64, linux/amd64, ubuntu-latest-32-core) (push) Has been cancelled
Docker Build, Test, and Publish / publish (arm64, type=gha,scope=docker-arm64, type=gha,mode=max,scope=docker-arm64, linux/arm64, ubuntu-latest-32-arm-core) (push) Has been cancelled
Docker Build, Test, and Publish / merge (push) Has been cancelled
auto-fix lint issues & formatting / Apply patch (push) Has been cancelled
CI / Check no case-colliding filenames (push) Has been cancelled
CI / package-lock.json diff (push) Has been cancelled
CI / Lint Docker scripts (push) Has been cancelled
CI / Review label gate (push) Has been cancelled
CI / All required checks pass (push) Has been cancelled
CI / CI timing report (push) Has been cancelled
CI / Python tests (push) Has been cancelled
CI / OS-specific tests (push) Has been cancelled
CI / Python lints (push) Has been cancelled
CI / JS & TS checks (push) Has been cancelled
CI / Installer tests (push) Has been cancelled
CI / Rust tests (push) Has been cancelled
Nix flake check / nix flake check (push) Has been cancelled
feat: consolidate desktop and provider updates
2026-09-27 17:37:19 +08:00

46 lines
1.6 KiB
TypeScript

import { useStore } from '@nanostores/react'
import { useNavigate } from 'react-router'
import { openSession } from '@/app/open-session'
import { Codicon } from '@/components/ui/codicon'
import { useI18n } from '@/i18n'
import { $sessionHistoryFlags, navigateSessionHistory } from '@/store/session-history'
/** Back/forward over the main pane's conversation history, rendered at the
* left of the workspace zone's titlebar band (see `stripLead` in
* track-model). The chat's own header band is suppressed inside zones, so
* this is the only home that survives every layout. */
export function SessionHistoryNav() {
const flags = useStore($sessionHistoryFlags)
const navigate = useNavigate()
const { t } = useI18n()
const go = (delta: number) => navigateSessionHistory(delta, id => openSession(id, navigate))
const buttonClass =
'grid size-5.5 place-items-center rounded-md text-(--ui-text-tertiary) hover:bg-(--ui-control-hover-background) hover:text-foreground disabled:pointer-events-none disabled:opacity-30'
return (
<div className="flex items-center gap-0.5 pr-1" data-slot="session-history-nav">
<button
aria-label={t.chatNav.back}
className={buttonClass}
disabled={!flags.canBack}
onClick={() => go(-1)}
type="button"
>
<Codicon name="chevron-left" size="0.875rem" />
</button>
<button
aria-label={t.chatNav.forward}
className={buttonClass}
disabled={!flags.canForward}
onClick={() => go(1)}
type="button"
>
<Codicon name="chevron-right" size="0.875rem" />
</button>
</div>
)
}