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
2 changes: 2 additions & 0 deletions packages/app/src/app/components/session/composer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,8 @@ export default function Composer(props: ComposerProps) {
contentEditable={true}
role="textbox"
aria-multiline="true"
aria-label="Task prompt"
aria-placeholder="Ask OpenWork"
onInput={() => {
updateMentionQuery();
emitDraftChange();
Expand Down
14 changes: 13 additions & 1 deletion packages/app/src/app/components/session/sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export type SidebarProps = {
sessions: Array<{ id: string; title: string; slug?: string | null }>;
selectedSessionId: string | null;
onSelectSession: (id: string) => void;
onViewAllSessions: () => void;
sessionStatusById: Record<string, string>;
onCreateSession: () => void;
onDeleteSession: (id: string) => void;
Expand All @@ -29,6 +30,9 @@ export type SidebarProps = {

export default function SessionSidebar(props: SidebarProps) {
const realTodos = createMemo(() => props.todos.filter((todo) => todo.content.trim()));
const sessionLimit = 8;
const visibleSessions = createMemo(() => props.sessions.slice(0, sessionLimit));
const hasMoreSessions = createMemo(() => props.sessions.length > sessionLimit);

const progressDots = createMemo(() => {
const activeTodos = realTodos();
Expand Down Expand Up @@ -96,7 +100,7 @@ export default function SessionSidebar(props: SidebarProps) {
<div>
<div class="text-xs text-gray-10 font-semibold mb-3 px-2 truncate">{props.workspaceName}</div>
<div class="space-y-1">
<For each={props.sessions.slice(0, 8)}>
<For each={visibleSessions()}>
{(session) => (
<button
class={`w-full text-left px-3 py-2 rounded-lg text-sm transition-colors ${
Expand Down Expand Up @@ -135,6 +139,14 @@ export default function SessionSidebar(props: SidebarProps) {
</button>
)}
</For>
<Show when={hasMoreSessions()}>
<button
class="w-full text-left px-3 py-2 rounded-lg text-xs text-gray-10 hover:text-gray-12 hover:bg-gray-2 transition-colors"
onClick={props.onViewAllSessions}
>
View all sessions ({props.sessions.length})
</button>
</Show>
</div>
</div>

Expand Down
44 changes: 25 additions & 19 deletions packages/app/src/app/pages/session.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1147,6 +1147,11 @@ export default function SessionView(props: SessionViewProps) {
props.setView("dashboard");
};

const openSessionsList = () => {
props.setTab("sessions");
props.setView("dashboard");
};

const openMcp = () => {
props.setTab("mcp");
props.setView("dashboard");
Expand Down Expand Up @@ -1206,25 +1211,26 @@ export default function SessionView(props: SessionViewProps) {

<div class="flex-1 flex overflow-hidden">
<aside class="hidden lg:flex w-72 border-r border-gray-6 bg-gray-1 flex-col">
<SessionSidebar
todos={props.todos}
expandedSections={props.expandedSidebarSections}
onToggleSection={(section) => {
props.setExpandedSidebarSections((curr) => ({...curr, [section]: !curr[section]}));
}}
workspaceName={workspaceLabel()}
sessions={props.sessions}
selectedSessionId={props.selectedSessionId}
onSelectSession={async (id) => {
await props.selectSession(id);
props.setView("session", id);
props.setTab("sessions");
}}
sessionStatusById={props.sessionStatusById}
onCreateSession={props.createSessionAndOpen}
onDeleteSession={handleDeleteSession}
newTaskDisabled={props.newTaskDisabled}
/>
<SessionSidebar
todos={props.todos}
expandedSections={props.expandedSidebarSections}
onToggleSection={(section) => {
props.setExpandedSidebarSections((curr) => ({...curr, [section]: !curr[section]}));
}}
workspaceName={workspaceLabel()}
sessions={props.sessions}
selectedSessionId={props.selectedSessionId}
onSelectSession={async (id) => {
await props.selectSession(id);
props.setView("session", id);
props.setTab("sessions");
}}
onViewAllSessions={openSessionsList}
sessionStatusById={props.sessionStatusById}
onCreateSession={props.createSessionAndOpen}
onDeleteSession={handleDeleteSession}
newTaskDisabled={props.newTaskDisabled}
/>
</aside>

<div
Expand Down
Loading