Skip to content

An open-source, self-hosted system for apps built with web technologies.

Start menu tables state their Column widths and minimums, and let React UI cut text short

zohayrslileh28a720b7b109
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
index c0fe22e..efaa73d 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/processes/process-item.tsx
@@ -35,13 +35,13 @@ export default function ProcessRow({ process, program, server, client }: Readonl
<Table.Cell>
<span className="flex min-w-0 items-center" style={{ gap: space.small, maxWidth: "100%" }}>
{program ? <img src={programIcon(application.doors.program, program.assetId)} alt="" draggable={false} style={{ width: space.medium, height: space.medium }} className="shrink-0 object-contain" /> : null}
- <span className="min-w-0 truncate" title={process.identity}>{label}</span>
+ <Text truncate title={process.identity}>{label}</Text>
{/* A failure to end stays beside the Process it belongs to. */}
- {failure && <span role="alert" className="min-w-0 truncate" title={failure} style={{ color: danger }}>{failure}</span>}
+ {failure && <span role="alert" style={{ display: "flex", minWidth: 0, color: danger }}><Text truncate title={failure}>{failure}</Text></span>}
</span>
</Table.Cell>
- <Table.Cell><Text tone="secondary" className="block truncate">{program?.name ?? process.program}</Text></Table.Cell>
+ <Table.Cell><Text tone="secondary">{program?.name ?? process.program}</Text></Table.Cell>
<Table.Cell>
<span className="flex" style={{ gap: space.xsmall }}>
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
index 577b6c1..39dacae 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/processes/processes.tsx
@@ -1,7 +1,7 @@
import type Process from "@client/core/link-manager/auth-manager/process-manager/process"
import type Program from "@client/core/link-manager/auth-manager/program-manager/program"
import ProcessRow from "./process-item"
-import { Table, useAppearance, useScale } from "@phreshos/react-ui"
+import { Table, useAppearance, useScale, ScrollArea } from "@phreshos/react-ui"
import Empty from "../empty"
/** Live Processes, including those without a Client window, as a table. */
@@ -16,13 +16,13 @@ export default function Processes({ processes, programs, empty }: Readonly<{
if (!processes.length) return <Empty>{empty}</Empty>
// A fixed layout keeps the table within the content: a long Process name is cut short instead of widening it.
- return <Table aria-label="Processes" size="small" style={{ minWidth: 0, tableLayout: "fixed" }}>
+ return <ScrollArea axis="horizontal"><Table aria-label="Processes" size="small">
<Table.Header>
- <Table.Column id="process" rowHeader>Process</Table.Column>
- <Table.Column id="program" style={{ width: space.xlarge * 6 }}>Program</Table.Column>
- <Table.Column id="endpoints" style={{ width: space.xlarge * 5 }}>Endpoints</Table.Column>
- <Table.Column id="end" aria-label="End" style={{ width: space.xlarge * 2 }}> </Table.Column>
+ <Table.Column id="process" rowHeader minWidth={space.xlarge * 6}>Process</Table.Column>
+ <Table.Column id="program" width={space.xlarge * 6}>Program</Table.Column>
+ <Table.Column id="endpoints" width={space.xlarge * 5}>Endpoints</Table.Column>
+ <Table.Column id="end" aria-label="End" width={space.xlarge * 2}> </Table.Column>
</Table.Header>
<Table.Body>
@@ -31,5 +31,5 @@ export default function Processes({ processes, programs, empty }: Readonly<{
server={process.server ? process.server.ready ? "ready" : "starting" : null} client={process.client !== null} />)}
</Table.Body>
- </Table>
+ </Table></ScrollArea>
}
diff --git a/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx b/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
index 17c05dd..ab142fe 100644
--- a/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
+++ b/source/client/view/structure/desktop/layers/shell/start-menu/programs/programs.tsx
@@ -2,7 +2,7 @@ import programIcon from "@client/view/structure/desktop/programs/program-icon"
import { ApplicationContext } from "@client/view/contexts"
import type Program from "@client/core/link-manager/auth-manager/program-manager/program"
import { useLaunchPlacement } from "@client/view/structure/desktop/launch-placement"
-import { Badge, GridList, Table, Text, useAppearance, useScale } from "@phreshos/react-ui"
+import { Badge, GridList, Table, Text, useAppearance, useScale, ScrollArea } from "@phreshos/react-ui"
import { useRef } from "react"
import Empty from "../empty"
@@ -47,13 +47,13 @@ export default function Programs({ programs, layout, running, empty, onLaunch }:
</GridList>
- return <Table aria-label="Programs" size="small" onAction={launch} style={{ minWidth: 0, tableLayout: "fixed" }}>
+ return <ScrollArea axis="horizontal"><Table aria-label="Programs" size="small" onAction={launch}>
<Table.Header>
- <Table.Column id="name" rowHeader>Name</Table.Column>
- <Table.Column id="version" style={{ width: space.xlarge * 3 }}>Version</Table.Column>
- <Table.Column id="category" style={{ width: space.xlarge * 4.5 }}>Category</Table.Column>
- <Table.Column id="state" style={{ width: space.xlarge * 3.5 }}>State</Table.Column>
+ <Table.Column id="name" rowHeader minWidth={space.xlarge * 6}>Name</Table.Column>
+ <Table.Column id="version" width={space.xlarge * 3}>Version</Table.Column>
+ <Table.Column id="category" width={space.xlarge * 4.5}>Category</Table.Column>
+ <Table.Column id="state" width={space.xlarge * 3.5}>State</Table.Column>
</Table.Header>
<Table.Body>
@@ -61,7 +61,7 @@ export default function Programs({ programs, layout, running, empty, onLaunch }:
<Table.Cell>
<span className="flex min-w-0 items-center" title={program.description ?? undefined} style={{ gap: space.small }}>
<img src={icon(program)} alt="" draggable={false} className="shrink-0 object-contain" style={{ width: space.medium * 1.5, height: space.medium * 1.5 }} />
- <span className="min-w-0 truncate">{program.name}</span>
+ <Text truncate>{program.name}</Text>
</span>
</Table.Cell>
<Table.Cell><Text tone="secondary" className="tabular-nums">{program.version}</Text></Table.Cell>
@@ -70,7 +70,7 @@ export default function Programs({ programs, layout, running, empty, onLaunch }:
</Table.Row>)}
</Table.Body>
- </Table>
+ </Table></ScrollArea>
}
/**