diff --git a/src/components/TreeReactFlow/Flavor.ts b/src/components/TreeReactFlow/Flavor.ts index 163e1be9..4e8e1717 100644 --- a/src/components/TreeReactFlow/Flavor.ts +++ b/src/components/TreeReactFlow/Flavor.ts @@ -17,7 +17,7 @@ export const commonHoverClasses = "hover:ring hover:ring-4 hover:ring-offset-4"; export const flavorClasses = (flavor: NodeFlavor): string => classNames( - typeOrTermClasses(isTypeLevel(flavor)), + sortClasses(flavorSort(flavor)), (() => { switch (flavor) { case "Hole": @@ -209,7 +209,7 @@ export const flavorContentClasses = ( flavor: NodeFlavorTextBody | NodeFlavorPrimBody | NodeFlavorNoBody ): string => classNames( - typeOrTermContentClasses(isTypeLevel(flavor)), + sortContentClasses(flavorSort(flavor)), (() => { switch (flavor) { case "Hole": @@ -531,10 +531,10 @@ export const boxFlavorBackground = (flavor: NodeFlavorBoxBody): string => { }; /** What sort of node does this flavor correspond to? - * Note that the backend could in principal tell us this independently of flavors, + * Note that the backend could in principle tell us this independently of flavors, * since it comes down to whether the node ultimately comes from an `Expr`, `Type` or `Kind`. */ -export const isTypeLevel = (flavor: NodeFlavor): "term" | "type" | "kind" => { +export const flavorSort = (flavor: NodeFlavor): "term" | "type" | "kind" => { switch (flavor) { case "Con": case "Lam": @@ -574,8 +574,8 @@ export const isTypeLevel = (flavor: NodeFlavor): "term" | "type" | "kind" => { } }; -export const typeOrTermClasses = (x: "term" | "type" | "kind"): string => { - switch (x) { +export const sortClasses = (s: "term" | "type" | "kind"): string => { + switch (s) { case "term": return "rounded-3xl"; case "type": @@ -585,10 +585,8 @@ export const typeOrTermClasses = (x: "term" | "type" | "kind"): string => { } }; -export const typeOrTermContentClasses = ( - x: "term" | "type" | "kind" -): string => { - switch (x) { +export const sortContentClasses = (s: "term" | "type" | "kind"): string => { + switch (s) { case "term": return ""; case "type": diff --git a/src/components/TreeReactFlow/index.tsx b/src/components/TreeReactFlow/index.tsx index 1337d3ac..244e2701 100644 --- a/src/components/TreeReactFlow/index.tsx +++ b/src/components/TreeReactFlow/index.tsx @@ -61,7 +61,7 @@ import { flavorLabel, flavorLabelClasses, noBodyFlavorContents, - typeOrTermClasses, + sortClasses, } from "./Flavor"; import { ZoomBar, ZoomBarProps } from "./ZoomBar"; import { WasmLayoutType } from "@zxch3n/tidy/wasm_dist"; @@ -274,7 +274,7 @@ const nodeTypes = {