From d0484e8c021badadd4087432d491aa51badfdc95 Mon Sep 17 00:00:00 2001 From: Charis <26616127+charislam@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:54:07 -0400 Subject: [PATCH 1/4] fix: prepare docs for typedoc update (#39084) We're dropping some information from newer versions of Typedoc spec (compared to older ones). Fixed this. --- apps/docs/features/docs/Reference.typeSpec.ts | 34 ++- .../Reference.typeSpec.test.ts.snap | 254 +++++++++++++++++- 2 files changed, 273 insertions(+), 15 deletions(-) diff --git a/apps/docs/features/docs/Reference.typeSpec.ts b/apps/docs/features/docs/Reference.typeSpec.ts index c076ff43ca2..98298bcf2b9 100644 --- a/apps/docs/features/docs/Reference.typeSpec.ts +++ b/apps/docs/features/docs/Reference.typeSpec.ts @@ -156,6 +156,15 @@ export interface CustomTypePropertyType { type: TypeDetails | undefined } +// The meaning of kind flags from `typedoc`: +// https://github.com/TypeStrong/typedoc/blob/2953b0148253589448176881a7acb46090f941bd/src/lib/output/themes/default/assets/typedoc/Application.ts#L36 +const KIND_MODULE = 2 +const KIND_CLASS = 128 +const KIND_INTERFACE = 256 +const KIND_CONSTRUCTOR = 512 +const KIND_METHOD = 2048 +const KIND_TYPE_LITERAL = 65536 + /** * * New versions of `typedoc` added the variant property, so this is a quick and @@ -205,7 +214,7 @@ function normalizeComment(original: TypedocComment | Comment | undefined): Comme return original } - let comment: Comment = {} + const comment: Comment = {} if ('summary' in original) { comment.shortText = original.summary.map((part) => part.text).join('') @@ -218,13 +227,6 @@ function normalizeComment(original: TypedocComment | Comment | undefined): Comme return comment } -// The meaning of kind flags from `typedoc`: -// https://github.com/TypeStrong/typedoc/blob/2953b0148253589448176881a7acb46090f941bd/src/lib/output/themes/default/assets/typedoc/Application.ts#L36 -const KIND_CLASS = 128 -const KIND_CONSTRUCTOR = 512 -const KIND_METHOD = 2048 -const KIND_TYPE_LITERAL = 65536 - export function parseTypeSpec() { const modules = (typeSpec.children ?? []).map(parseMod) return modules as Array @@ -294,7 +296,7 @@ function parseModInternal( node.children?.forEach((child: any) => parseModInternal(child, map, updatedPath, res)) return case 'declaration': - if (node.kind === KIND_CLASS) { + if (node.kind === KIND_CLASS || node.kind === KIND_MODULE) { updatedPath = [...currentPath, node.name] node.children?.forEach((child: any) => parseModInternal(child, map, updatedPath, res)) } else if (node.kind === KIND_CONSTRUCTOR) { @@ -540,6 +542,8 @@ function parseReferenceType(type: any, map: Map) { if (maybeType) { return maybeType + } else if (isNewTypedoc(referenced) && referenced.kind === KIND_INTERFACE) { + return parseInterface(referenced, map) } else if (isNewTypedoc(referenced) && referenced.kind === KIND_CLASS) { // Class is too complicated to display here, just return its name return { @@ -673,7 +677,9 @@ function parseTypeLiteral(type: any, map: Map): TypeDetails | undef const name = nameOrAnonymous(type) if ('children' in type.declaration) { - const properties = type.declaration.children.map((child: any) => parseTypeInternals(child, map)) + const properties = type.declaration.children + .map((child: any) => parseTypeInternals(child, map)) + .filter(Boolean) return { name, type: 'object', @@ -725,7 +731,9 @@ function parseTypeOperatorType(type: any, map: Map) { } function parseInterface(type: any, map: Map): CustomObjectType { - const properties = (type.children ?? []).map((child) => parseTypeInternals(child, map)) + const properties = (type.children ?? []) + .map((child) => parseTypeInternals(child, map)) + .filter(Boolean) return { type: 'object', @@ -766,6 +774,10 @@ function parseTypeInternals(elem: any, map: Map) { function parseInternalProperty(elem: any, map: Map) { const name = nameOrAnonymous(elem) + if (!elem.type) { + return undefined + } + const type = parseType(elem.type, map) const res = { diff --git a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap index 534f8f547c7..0eeee322f79 100644 --- a/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap +++ b/apps/docs/features/docs/__snapshots__/Reference.typeSpec.test.ts.snap @@ -29616,8 +29616,9 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` { "name": "transport", "type": { - "type": "nameOnly", - "name": "WebSocketLikeConstructor" + "type": "object", + "name": "WebSocketLikeConstructor", + "properties": [] }, "isOptional": true }, @@ -30241,8 +30242,253 @@ exports[`TS type spec parsing > matches snapshot 1`] = ` ], "ret": { "type": { - "type": "nameOnly", - "name": "WebSocketLike" + "type": "object", + "name": "WebSocketLike", + "properties": [ + { + "name": "binaryType", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "bufferedAmount", + "type": { + "type": "intrinsic", + "name": "number" + }, + "isOptional": true + }, + { + "name": "CLOSED", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CLOSING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "CONNECTING", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "dispatchEvent", + "type": { + "type": "function", + "params": [ + { + "name": "event", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "boolean" + } + } + }, + "isOptional": true + }, + { + "name": "extensions", + "type": { + "type": "intrinsic", + "name": "string" + }, + "isOptional": true + }, + { + "name": "onclose", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "CloseEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onerror", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onmessage", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "MessageEvent" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "onopen", + "type": { + "type": "union", + "subTypes": [ + { + "type": "literal", + "value": null + }, + { + "type": "function", + "params": [ + { + "name": "this", + "type": { + "type": "intrinsic", + "name": "any" + } + }, + { + "name": "ev", + "type": { + "type": "nameOnly", + "name": "Event" + } + } + ], + "ret": { + "type": { + "type": "intrinsic", + "name": "any" + } + } + } + ] + } + }, + { + "name": "OPEN", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "protocol", + "type": { + "type": "intrinsic", + "name": "string" + } + }, + { + "name": "readyState", + "type": { + "type": "intrinsic", + "name": "number" + } + }, + { + "name": "url", + "type": { + "type": "intrinsic", + "name": "string" + } + } + ] } } }, From 2bd6be9370b87ec3a4f9bfd067d446c46987c6a4 Mon Sep 17 00:00:00 2001 From: Chris Chinchilla Date: Tue, 30 Sep 2025 14:14:03 +0200 Subject: [PATCH 2/4] docs: Fix order of feature flags (#39114) * Fix order of feature flags * Update apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --------- Co-authored-by: Charis <26616127+charislam@users.noreply.github.com> --- .../Navigation/NavigationMenu/NavigationMenu.constants.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index 74a142f1bd7..f07e11812c6 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -41,13 +41,13 @@ const { 'docs:compliance', 'docs:contribution', 'docs:fdw', - 'docs:self-hosting', 'docs:framework_quickstarts', 'docs:full_platform', 'docs:local_development', 'docs:mobile_tutorials', 'docs:pgtap', 'docs:production_checklist', + 'docs:self-hosting', 'docs:web_apps', 'integrations:partners', 'sdk:csharp', From c04eec64684f9321409434e6094a4e36db141f4c Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 30 Sep 2025 20:14:25 +0800 Subject: [PATCH 3/4] Add region code to region selection in project and replica creation (#39071) * Add region code to region selection in project and replica creation * Tiny --- .../ProjectCreation/RegionSelector.tsx | 17 +++++++++++------ .../DeployNewReplicaPanel.tsx | 5 ++++- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx index 7e4eaeedc4d..9dbc26c80f0 100644 --- a/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx +++ b/apps/studio/components/interfaces/ProjectCreation/RegionSelector.tsx @@ -148,23 +148,28 @@ export const RegionSelector = ({ value={value.name} className="w-full [&>:nth-child(2)]:w-full" > -
+
region icon - {value.name} +
+ {value.name} + + {value.code} + +
-
- {recommendedSpecificRegions.has(value.code) && ( + {recommendedSpecificRegions.has(value.code) && ( +
Recommended - )} -
+
+ )}
) diff --git a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx index d43bd7b0c20..e6f55fac5b2 100644 --- a/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx +++ b/apps/studio/components/interfaces/Settings/Infrastructure/InfrastructureConfiguration/DeployNewReplicaPanel.tsx @@ -447,7 +447,10 @@ const DeployNewReplicaPanel = ({ /> )} > - {region.name} +

+ {region.name} + {region.region} +

))} From 15fe10affaf18482f4ec8d24d96e580f50a9fa83 Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Tue, 30 Sep 2025 20:23:47 +0800 Subject: [PATCH 4/4] Flatten table editor grid context menu copy action (#39116) --- .../grid/components/menu/RowContextMenu.tsx | 33 ++++++++----------- 1 file changed, 13 insertions(+), 20 deletions(-) diff --git a/apps/studio/components/grid/components/menu/RowContextMenu.tsx b/apps/studio/components/grid/components/menu/RowContextMenu.tsx index d336e2002d9..1e90055e4e2 100644 --- a/apps/studio/components/grid/components/menu/RowContextMenu.tsx +++ b/apps/studio/components/grid/components/menu/RowContextMenu.tsx @@ -1,12 +1,12 @@ -import { ChevronRight, Clipboard, Edit, Trash } from 'lucide-react' +import { Clipboard, Edit, Trash } from 'lucide-react' import { useCallback } from 'react' -import { Item, ItemParams, Menu, Separator, Submenu } from 'react-contexify' +import { Item, ItemParams, Menu } from 'react-contexify' import { toast } from 'sonner' import type { SupaRow } from 'components/grid/types' import { useTableEditorStateSnapshot } from 'state/table-editor' import { useTableEditorTableStateSnapshot } from 'state/table-editor-table' -import { copyToClipboard } from 'ui' +import { copyToClipboard, DialogSectionSeparator } from 'ui' import { ROW_CONTEXT_MENU_ID } from '.' import { formatClipboardValue } from '../../utils/common' @@ -67,27 +67,20 @@ const RowContextMenu = ({ rows }: RowContextMenuProps) => { return ( - - - Copy -
- } - arrow={} - > - - Copy cell - - - Copy row - - + + + Copy cell + + + + Copy row + + - +