Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Deploy AIOS web (React glide grid + FastAPI slice)
Browse files- api/main.py +0 -0
- api/routes_tables.py +2 -2
- platform/aios_grid.py +16 -8
- platform/core/store_pg.py +4 -3
- web/src/customer-grid/iconShapes.ts +18 -7
- web/src/customer-grid/icons.tsx +4 -4
api/main.py
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|
api/routes_tables.py
CHANGED
|
@@ -1087,8 +1087,8 @@ def list_tables(brief: bool = Query(False),
|
|
| 1087 |
`user_tables.lend`'s own note for why inlining the predicate is the one fix that is not
|
| 1088 |
available.
|
| 1089 |
|
| 1090 |
-
`brief=1` is for a link-field picker.
|
| 1091 |
-
not row counts or record mutability.
|
| 1092 |
field editor would move every stored row through Neon for no visible result, so this branch
|
| 1093 |
keeps the server-side permission wall but lends its rows-free projection instead.
|
| 1094 |
"""
|
|
|
|
| 1087 |
`user_tables.lend`'s own note for why inlining the predicate is the one fix that is not
|
| 1088 |
available.
|
| 1089 |
|
| 1090 |
+
`brief=1` is for a link-field picker. It needs the tables it may target and their schemas,
|
| 1091 |
+
not row counts or record mutability. Reading a full tenant document to decorate that one
|
| 1092 |
field editor would move every stored row through Neon for no visible result, so this branch
|
| 1093 |
keeps the server-side permission wall but lends its rows-free projection instead.
|
| 1094 |
"""
|
platform/aios_grid.py
CHANGED
|
@@ -1918,11 +1918,14 @@ MAX_FOLDER_NAME = 80
|
|
| 1918 |
#: 12-shape guess of mine that contained shapes the client cannot draw). Do not extend this set
|
| 1919 |
#: without the matching client geometry: an unknown shape falls back to the default folder mark,
|
| 1920 |
#: which is also I14's "existing folders get the folder icon" for every pre-wave-9 folder.
|
| 1921 |
-
FOLDER_ICON_SHAPES = {
|
| 1922 |
-
|
| 1923 |
-
|
| 1924 |
-
|
| 1925 |
-
|
|
|
|
|
|
|
|
|
|
| 1926 |
|
| 1927 |
|
| 1928 |
#: Wave-9 I17 (contract C4) β who may EDIT a saved view.
|
|
@@ -1982,9 +1985,14 @@ def clean_folder_icon(raw):
|
|
| 1982 |
shape = raw.get("shape")
|
| 1983 |
if shape not in FOLDER_ICON_SHAPES:
|
| 1984 |
return None
|
| 1985 |
-
tone = raw.get("tone")
|
| 1986 |
-
|
| 1987 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1988 |
|
| 1989 |
|
| 1990 |
def clean_folders(raw):
|
|
|
|
| 1918 |
#: 12-shape guess of mine that contained shapes the client cannot draw). Do not extend this set
|
| 1919 |
#: without the matching client geometry: an unknown shape falls back to the default folder mark,
|
| 1920 |
#: which is also I14's "existing folders get the folder icon" for every pre-wave-9 folder.
|
| 1921 |
+
FOLDER_ICON_SHAPES = {
|
| 1922 |
+
"folder", "star", "flag", "tag", "bookmark", "grid", "chart", "map", "users",
|
| 1923 |
+
"clock", "heart", "bolt",
|
| 1924 |
+
}
|
| 1925 |
+
#: Tones are the C1 pastels β FILLS ONLY, never text. This mirrors the current client vocabulary;
|
| 1926 |
+
#: the old host spelling `grey` is accepted as a read/write migration alias for `neutral` below.
|
| 1927 |
+
FOLDER_ICON_TONES = {"neutral", "blue", "green", "yellow", "red"}
|
| 1928 |
+
FOLDER_ICON_DEFAULT_TONE = "neutral"
|
| 1929 |
|
| 1930 |
|
| 1931 |
#: Wave-9 I17 (contract C4) β who may EDIT a saved view.
|
|
|
|
| 1985 |
shape = raw.get("shape")
|
| 1986 |
if shape not in FOLDER_ICON_SHAPES:
|
| 1987 |
return None
|
| 1988 |
+
tone = raw.get("tone")
|
| 1989 |
+
# The first host implementation called the neutral tone `grey`. Accept that legacy value so
|
| 1990 |
+
# an existing folder cannot crash a newer client, but canonicalise it on the next workspace
|
| 1991 |
+
# write/read to the current shared vocabulary.
|
| 1992 |
+
if tone == "grey":
|
| 1993 |
+
tone = FOLDER_ICON_DEFAULT_TONE
|
| 1994 |
+
return {"shape": shape,
|
| 1995 |
+
"tone": tone if tone in FOLDER_ICON_TONES else FOLDER_ICON_DEFAULT_TONE}
|
| 1996 |
|
| 1997 |
|
| 1998 |
def clean_folders(raw):
|
platform/core/store_pg.py
CHANGED
|
@@ -230,9 +230,10 @@ def _pool():
|
|
| 230 |
pass
|
| 231 |
# min_size=0 so a process that never touches the store opens no connection at all β the
|
| 232 |
# shared API serves plenty of requests (health, static, a cached payload) that never read.
|
| 233 |
-
# Returned connections are deliberately short-lived:
|
| 234 |
-
#
|
| 235 |
-
# Thirty seconds reuses a normal request burst without creating a resident
|
|
|
|
| 236 |
_POOL['pool'] = ConnectionPool(url, min_size=0, max_size=8, open=True, timeout=10.0,
|
| 237 |
max_idle=30.0)
|
| 238 |
_POOL['url'] = url
|
|
|
|
| 230 |
pass
|
| 231 |
# min_size=0 so a process that never touches the store opens no connection at all β the
|
| 232 |
# shared API serves plenty of requests (health, static, a cached payload) that never read.
|
| 233 |
+
# Returned connections are deliberately short-lived: Neon's compute should suspend between
|
| 234 |
+
# real requests, not be held awake by this process's idle pool for psycopg's 10-minute
|
| 235 |
+
# default. Thirty seconds still reuses a normal request burst without creating a resident
|
| 236 |
+
# database client.
|
| 237 |
_POOL['pool'] = ConnectionPool(url, min_size=0, max_size=8, open=True, timeout=10.0,
|
| 238 |
max_idle=30.0)
|
| 239 |
_POOL['url'] = url
|
web/src/customer-grid/iconShapes.ts
CHANGED
|
@@ -350,13 +350,24 @@ export const FOLDER_SHAPE_PATHS: Record<FolderShape, IconShape[]> = {
|
|
| 350 |
* the two ends, so the name matters more than the word: a tone the host does not recognise
|
| 351 |
* degrades to the default and the user's choice silently disappears on reload.
|
| 352 |
*/
|
| 353 |
-
export const FOLDER_TONE_PAINT: Record<FolderTone, { fill: string; stroke: string }> = {
|
| 354 |
-
neutral: { fill: LP_LINE, stroke: LP_MUTED },
|
| 355 |
-
blue: { fill: LP_BLUE, stroke: LP_BLUE_DEEP },
|
| 356 |
-
green: { fill: LP_GREEN, stroke: LP_GREEN_DEEP },
|
| 357 |
-
yellow: { fill: LP_YELLOW, stroke: LP_YELLOW_DEEP },
|
| 358 |
-
red: { fill: LP_RED, stroke: LP_RED_DEEP },
|
| 359 |
-
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 360 |
|
| 361 |
export const FOLDER_TONE_LABELS: Record<FolderTone, string> = {
|
| 362 |
neutral: "Neutral",
|
|
|
|
| 350 |
* the two ends, so the name matters more than the word: a tone the host does not recognise
|
| 351 |
* degrades to the default and the user's choice silently disappears on reload.
|
| 352 |
*/
|
| 353 |
+
export const FOLDER_TONE_PAINT: Record<FolderTone, { fill: string; stroke: string }> = {
|
| 354 |
+
neutral: { fill: LP_LINE, stroke: LP_MUTED },
|
| 355 |
+
blue: { fill: LP_BLUE, stroke: LP_BLUE_DEEP },
|
| 356 |
+
green: { fill: LP_GREEN, stroke: LP_GREEN_DEEP },
|
| 357 |
+
yellow: { fill: LP_YELLOW, stroke: LP_YELLOW_DEEP },
|
| 358 |
+
red: { fill: LP_RED, stroke: LP_RED_DEEP },
|
| 359 |
+
};
|
| 360 |
+
|
| 361 |
+
/**
|
| 362 |
+
* The tone is persisted data, not a compile-time fact. Older hosts used `grey` for the neutral
|
| 363 |
+
* tone, and a stale workspace can still carry it after the palette was renamed. Every painter
|
| 364 |
+
* must degrade to the neutral ink rather than dereferencing an absent paint record and taking the
|
| 365 |
+
* whole React tree down while drawing an otherwise healthy database.
|
| 366 |
+
*/
|
| 367 |
+
export function folderTonePaint(tone: unknown): { fill: string; stroke: string } {
|
| 368 |
+
return (typeof tone === "string" ? FOLDER_TONE_PAINT[tone as FolderTone] : undefined)
|
| 369 |
+
?? FOLDER_TONE_PAINT.neutral;
|
| 370 |
+
}
|
| 371 |
|
| 372 |
export const FOLDER_TONE_LABELS: Record<FolderTone, string> = {
|
| 373 |
neutral: "Neutral",
|
web/src/customer-grid/icons.tsx
CHANGED
|
@@ -22,7 +22,7 @@ import {
|
|
| 22 |
CHART_KIND_SHAPES,
|
| 23 |
CHART_KIND_TONE,
|
| 24 |
FOLDER_SHAPE_PATHS,
|
| 25 |
-
|
| 26 |
MODE_SHAPES,
|
| 27 |
TYPE_SHAPES,
|
| 28 |
} from "./iconShapes";
|
|
@@ -130,7 +130,7 @@ export function ToneModeIcon({
|
|
| 130 |
tone: FolderTone;
|
| 131 |
size?: number;
|
| 132 |
}) {
|
| 133 |
-
const paint =
|
| 134 |
return (
|
| 135 |
<svg
|
| 136 |
className="cg-mode-icon cg-tone-icon"
|
|
@@ -178,7 +178,7 @@ export function ChartKindIcon({
|
|
| 178 |
kind: ChartKindKey;
|
| 179 |
size?: number;
|
| 180 |
}) {
|
| 181 |
-
const paint =
|
| 182 |
return (
|
| 183 |
<svg
|
| 184 |
className="cg-mode-icon cg-tone-icon"
|
|
@@ -483,7 +483,7 @@ export function FolderMark({
|
|
| 483 |
size?: number;
|
| 484 |
}) {
|
| 485 |
const shape = icon?.shape ?? DEFAULT_FOLDER_SHAPE;
|
| 486 |
-
const paint =
|
| 487 |
return (
|
| 488 |
<svg
|
| 489 |
className="cg-folder-mark"
|
|
|
|
| 22 |
CHART_KIND_SHAPES,
|
| 23 |
CHART_KIND_TONE,
|
| 24 |
FOLDER_SHAPE_PATHS,
|
| 25 |
+
folderTonePaint,
|
| 26 |
MODE_SHAPES,
|
| 27 |
TYPE_SHAPES,
|
| 28 |
} from "./iconShapes";
|
|
|
|
| 130 |
tone: FolderTone;
|
| 131 |
size?: number;
|
| 132 |
}) {
|
| 133 |
+
const paint = folderTonePaint(tone);
|
| 134 |
return (
|
| 135 |
<svg
|
| 136 |
className="cg-mode-icon cg-tone-icon"
|
|
|
|
| 178 |
kind: ChartKindKey;
|
| 179 |
size?: number;
|
| 180 |
}) {
|
| 181 |
+
const paint = folderTonePaint(CHART_KIND_TONE[kind]);
|
| 182 |
return (
|
| 183 |
<svg
|
| 184 |
className="cg-mode-icon cg-tone-icon"
|
|
|
|
| 483 |
size?: number;
|
| 484 |
}) {
|
| 485 |
const shape = icon?.shape ?? DEFAULT_FOLDER_SHAPE;
|
| 486 |
+
const paint = folderTonePaint(icon?.tone ?? DEFAULT_FOLDER_TONE);
|
| 487 |
return (
|
| 488 |
<svg
|
| 489 |
className="cg-folder-mark"
|