Tighten Work board columns and Home approval labels
The Work board used auto-fit columns that reflowed and clustered at the left; pin it to four equal columns (minmax(0,1fr) so they shrink rather than overflow). On Home, render approval kind and risk as humanized labels instead of raw enum strings.
This commit is contained in:
1 parent
047815a7d5
commit
e95b2a8d32
2 files changed
+8
-2
No files matched your search
@@ -148,7 +148,7 @@ function WaitingCard({
|
||||
<div key={approval.id} style={{ padding: 12, border: "1px solid var(--border)", borderRadius: 8 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 500, marginBottom: 2 }}>{approval.title}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", marginBottom: 10 }}>
|
||||
{approval.kind} · {approval.risk} risk · from {from}
|
||||
{humanizeLabel(approval.kind)} · {humanizeLabel(approval.risk)} risk · from {from}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<Button tone="primary" size="small" onClick={() => onApprove(approval.id)}>Approve</Button>
|
||||
@@ -337,6 +337,12 @@ function renderSummary(pending: number, agents: number): string {
|
||||
return `${things} · ${onDeck}`;
|
||||
}
|
||||
|
||||
function humanizeLabel(value: string): string {
|
||||
if (!value) return value;
|
||||
const spaced = value.replace(/_/g, " ");
|
||||
return spaced.charAt(0).toUpperCase() + spaced.slice(1);
|
||||
}
|
||||
|
||||
function resolveRequester(approval: ApprovalRecord, employees: EmployeeRecord[], agents: AgentRecord[]): string {
|
||||
if (approval.requestedByType === "employee" && approval.requestedById) {
|
||||
const employee = employees.find((item) => item.id === approval.requestedById);
|
||||
|
||||
@@ -111,7 +111,7 @@ function BoardView({
|
||||
onCreate: () => void;
|
||||
}) {
|
||||
return (
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 12, minWidth: 0 }}>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(4, minmax(0, 1fr))", gap: 12, minWidth: 0 }}>
|
||||
{COLUMNS.map((column) => {
|
||||
const columnTasks = tasks.filter((task) => task.status === column.id);
|
||||
return (
|
||||
|
||||
Reference in new issue
Block a user