Skip to content
Merged
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
31 changes: 2 additions & 29 deletions apps/cli/src/lib/launch/config.ts
Original file line number Diff line number Diff line change
@@ -1,58 +1,31 @@
import type { Agent, AgentType } from "../../types/process";

/**
* Default launch commands for each agent type
*/
const DEFAULT_LAUNCH_COMMANDS: Record<AgentType, string> = {
claude: "claude",
codex: "codex",
cursor: "cursor",
};

/**
* Get launch command for an agent, considering:
* 1. Agent's stored launchCommand (highest priority)
* 2. Environment variable override (SUPERSET_AGENT_LAUNCH_<TYPE>)
* 3. User config file (~/.superset-cli.json)
* 4. Default for agent type
*/
export function getLaunchCommand(agent: Agent): string | null {
// 1. Use agent's stored launch command if available
if (agent.launchCommand) {
return agent.launchCommand;
}

const agentType = agent.agentType;

// 2. Check environment variable override
const envKey = `SUPERSET_AGENT_LAUNCH_${agentType.toUpperCase()}`;
const envKey = `SUPERSET_AGENT_LAUNCH_${agent.agentType.toUpperCase()}`;
const envOverride = process.env[envKey];
if (envOverride) {
return envOverride;
}

// 3. Check user config file (TODO: implement config file reading)
// const userConfig = loadUserConfig();
// if (userConfig?.launchers?.[agentType]) {
// return userConfig.launchers[agentType];
// }

// 4. Use default
return DEFAULT_LAUNCH_COMMANDS[agentType] || null;
return DEFAULT_LAUNCH_COMMANDS[agent.agentType] || null;
}

/**
* Get the default launch command for an agent type
* Used when creating new agents
*/
export function getDefaultLaunchCommand(agentType: AgentType): string {
// Check environment variable override
const envKey = `SUPERSET_AGENT_LAUNCH_${agentType.toUpperCase()}`;
const envOverride = process.env[envKey];
if (envOverride) {
return envOverride;
}

// Return default
return DEFAULT_LAUNCH_COMMANDS[agentType];
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@ export function TasksTableView({
return (
<div className="flex flex-col">
{table.getRowModel().rows.map((row) => {
// Group header rows have subRows, leaf rows don't
const isGroupHeader = row.subRows && row.subRows.length > 0;

if (isGroupHeader) {
// Group header - only render the status column (first cell)
// All other cells return null because they're placeholders
// DOM order handles stacking - later headers naturally overlap earlier ones
const firstCell = row.getVisibleCells()[0];

return (
Expand All @@ -36,9 +32,6 @@ export function TasksTableView({
);
}

// Leaf row - render all cells horizontally with grid for consistent column widths
// Layout: [Checkbox] [Priority] [ID] [Title] ... [Labels] [Assignee] [Due] [gap]
// Note: Status column (index 0) returns null for leaf rows, so we skip it
const cells = row.getVisibleCells();
const task = row.original;

Expand All @@ -47,7 +40,6 @@ export function TasksTableView({
key={row.id}
task={task}
onDelete={() => {
// TODO: Implement delete
console.log("Delete task:", task.id);
}}
>
Expand All @@ -57,7 +49,6 @@ export function TasksTableView({
gridTemplateColumns: `auto auto ${slugColumnWidth} 1fr auto auto`,
}}
>
{/* Skip status column (index 0), render checkbox, priority, id, title+labels, assignee, created */}
{cells.slice(1).map((cell) => (
<div key={cell.id} className="flex items-center">
{flexRender(cell.column.columnDef.cell, cell.getContext())}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,26 +102,20 @@ export function useTasksTable({
setColumnFilters(newColumnFilters);
}, [filterTab]);

// Calculate optimal slug column width based on longest slug
const slugColumnWidth = useMemo(() => {
if (!data || data.length === 0) return "5rem";

const longestSlug = data.reduce((longest, task) => {
return task.slug.length > longest.length ? task.slug : longest;
}, "");

// Monospace font-mono at text-xs (0.75rem = 12px)
// Each character is ~0.5em of the font size = 0.5 * 0.75rem = 0.375rem per char
const remPerChar = 0.5 * 0.75; // 0.375rem per character
const padding = 0.5; // rem for horizontal padding
const width = longestSlug.length * remPerChar + padding;
const REM_PER_CHAR = 0.5 * 0.75;
const PADDING_REM = 0.5;
const width = longestSlug.length * REM_PER_CHAR + PADDING_REM;

return `${Math.ceil(width * 10) / 10}rem`; // Round to 1 decimal
return `${Math.ceil(width * 10) / 10}rem`;
}, [data]);

// TODO: Add localStorage persistence for collapsed groups

// Define columns with useMemo (following official docs pattern)
const columns = useMemo(
() => [
columnHelper.accessor((row) => row.status, {
Expand Down Expand Up @@ -182,7 +176,6 @@ export function useTasksTable({
getGroupingValue: (row) => row.status.name,
}),

// Checkbox column (placeholder for future selection)
columnHelper.display({
id: "checkbox",
header: "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ import { Button } from "@superset/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@superset/ui/tooltip";
import { cn } from "@superset/ui/utils";
import { useEffect, useRef, useState } from "react";
import { useDrop } from "react-dnd";
import { HiMiniXMark } from "react-icons/hi2";
import { MosaicDragType } from "react-mosaic-component";
import { StatusIndicator } from "renderer/screens/main/components/StatusIndicator";
import { useDragPaneStore } from "renderer/stores/drag-pane-store";
import type { PaneStatus, Tab } from "renderer/stores/tabs/types";
import { getTabDisplayName } from "renderer/stores/tabs/utils";

Expand All @@ -14,6 +17,7 @@ interface GroupItemProps {
onSelect: () => void;
onClose: () => void;
onRename: (newName: string) => void;
onPaneDrop?: (paneId: string) => void;
}

export function GroupItem({
Expand All @@ -23,12 +27,51 @@ export function GroupItem({
onSelect,
onClose,
onRename,
onPaneDrop,
}: GroupItemProps) {
const displayName = getTabDisplayName(tab);
const [isEditing, setIsEditing] = useState(false);
const [editValue, setEditValue] = useState("");
const inputRef = useRef<HTMLInputElement>(null);

const [{ isOver, canDrop }, drop] = useDrop<
unknown,
{ handled: true },
{ isOver: boolean; canDrop: boolean }
>(
() => ({
accept: MosaicDragType.WINDOW,
canDrop: () => {
const { draggingPaneId, draggingSourceTabId } =
useDragPaneStore.getState();
// Must have valid drag state AND be dropping on a different tab
return (
!!draggingPaneId &&
!!draggingSourceTabId &&
draggingSourceTabId !== tab.id
);
},
drop: () => {
const { draggingPaneId, draggingSourceTabId, clearDragging } =
useDragPaneStore.getState();
if (
draggingPaneId &&
draggingSourceTabId &&
draggingSourceTabId !== tab.id
) {
onPaneDrop?.(draggingPaneId);
}
clearDragging();
return { handled: true };
},
collect: (monitor) => ({
isOver: monitor.isOver(),
canDrop: monitor.canDrop(),
}),
}),
[onPaneDrop, tab.id],
);

useEffect(() => {
if (isEditing && inputRef.current) {
inputRef.current.focus();
Expand Down Expand Up @@ -67,7 +110,15 @@ export function GroupItem({
);

return (
<div className="group relative flex items-center shrink-0 h-full border-r border-border">
<div
ref={(node) => {
drop(node);
}}
className={cn(
"group relative flex items-center shrink-0 h-full border-r border-border",
isOver && canDrop && "bg-primary/5",
)}
>
{isEditing ? (
<div className={tabStyles}>
<input
Expand Down
Loading