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
26 changes: 26 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:20-slim AS frontbuild

WORKDIR /app
COPY frontend/package*.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build

FROM python:3.12-slim

RUN apt-get update && apt-get install -y --no-install-recommends tmux && rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

COPY backend/pyproject.toml backend/uv.lock* ./
RUN uv sync --frozen --no-dev

COPY --from=frontbuild /app/dist /app/static

COPY backend/ .

ENV STATIC_DIR=/app/static

CMD ["uv", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"]
6 changes: 6 additions & 0 deletions backend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.env
*.pyc
__pycache__/
*.db
data/
.venv
5 changes: 5 additions & 0 deletions frontend/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules/
dist/
.env
*.db
.vite/
1 change: 1 addition & 0 deletions frontend/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface ApiClient {
// Bridges
listBridges(): Promise<BridgeConfig[]>;
createBridge(name: string): Promise<BridgeConfig>;
updateBridge(id: string, data: { enabled?: boolean }): Promise<BridgeConfig>;
deleteBridge(id: string): Promise<void>;

// Ordering
Expand Down
16 changes: 8 additions & 8 deletions frontend/src/components/SessionItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState, useRef, useEffect, useCallback } from 'react';
import { createPortal } from 'react-dom';
import { Terminal as TerminalIcon, ChevronRight, ChevronDown, X, AppWindow, Bell, Circle, Plus, Info, Copy, Check, CircleOff } from 'lucide-react';
import type { TmuxSession, TmuxWindow, SessionTarget, Selection } from '../types';
import { isFoldedSelection } from '../types';
import { isFoldedSelection, isWindowSelection } from '../types';
import { api } from '../api/client';
import { ConfirmDialog } from './ConfirmDialog';
import { getSessionExpanded, saveSessionExpanded } from '../utils/sidebarState';
Expand Down Expand Up @@ -295,9 +295,9 @@ export function SessionItem({
await api.swapWindows(containerId, session.id, data.windowIndex, targetIndex);
// Keep the selected window selected at its new position
if (hasAnyWindowSelected) {
if (selectedSession?.windowIndex === data.windowIndex) {
if (selectedWindowSession?.windowIndex === data.windowIndex) {
onSelectWindow(targetIndex);
} else if (selectedSession?.windowIndex === targetIndex) {
} else if (selectedWindowSession?.windowIndex === targetIndex) {
onSelectWindow(data.windowIndex);
}
}
Expand Down Expand Up @@ -405,11 +405,11 @@ export function SessionItem({
selectedSession.containerId === containerId &&
selectedSession.sessionId === session.id;

const selectedWindowSession = selectedSession != null && isWindowSelection(selectedSession) ? selectedSession : null;
const hasAnyWindowSelected =
selectedSession != null &&
!isFoldedSelection(selectedSession) &&
selectedSession.containerId === containerId &&
selectedSession.sessionName === session.name;
selectedWindowSession != null &&
selectedWindowSession.containerId === containerId &&
selectedWindowSession.sessionName === session.name;

const hasAnyWindowPreviewed =
previewSession?.containerId === containerId &&
Expand Down Expand Up @@ -503,7 +503,7 @@ export function SessionItem({
{session.windows.map((win) => {
const isSelected =
hasAnyWindowSelected &&
selectedSession?.windowIndex === win.index;
selectedWindowSession?.windowIndex === win.index;

const isPreviewed =
hasAnyWindowPreviewed &&
Expand Down
1 change: 1 addition & 0 deletions frontend/src/mocks/mockApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ export const mockApi: ApiClient = {

async listBridges() { return []; },
async createBridge(_name: string) { throw new Error('Not implemented in mock'); },
async updateBridge(_id: string, _data: { enabled?: boolean }) { throw new Error('Not implemented in mock'); },
async deleteBridge(_id: string) {},
async getContainerOrder() { return []; },
async saveContainerOrder(_order: string[]) {},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/MainPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export function MainPage() {
// useLayoutEffect avoids a visible blank frame.
const poolEnsure = pool.ensure;
useLayoutEffect(() => {
if (displayedSession && !isFoldedSelection(displayedSession)) {
if (displayedSession && isWindowSelection(displayedSession)) {
poolEnsure(displayedSession);
}
}, [displayedSession, poolEnsure]);
Expand Down