Files
supabase/apps/studio/components/grid
Danny White 9ea3919fb5 fix(studio): show column format in sort/filter type labels (#48201)
## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

Table editor sort (and filter) column pickers show `USER-DEFINED` for
extension types such as PostGIS `geography`, because they use `dataType`
from pg-meta.

| Before |
| --- |
| <img width="549" height="196" alt="CleanShot 2026-07-22 at 11 32 44"
src="https://github.com/user-attachments/assets/9ba2dec8-f5a3-479f-81c8-2dd133f6d419"
/> |

## What is the new behavior?

Those pickers use the same display helper as column headers
(`getColumnFormat`), so labels match the header (e.g. `geography`,
`int4[]`).

## Test plan

In SQL Editor:

```sql
create extension if not exists postgis with schema extensions;

create table public.geography_sort_repro (
  id bigint generated always as identity primary key,
  location extensions.geography(point, 4326),
  tags text[]
);
```

Then open `geography_sort_repro` in the Table Editor → Sort → pick
`location` / `tags`. Confirm labels are `geography` and `text[]` (not
`USER-DEFINED` / `_text`). Same check in the Filter column picker.

Cleanup: `drop table public.geography_sort_repro;`

## Additional context

`data_type` is intentionally coarse for non-`pg_catalog` types in
pg-meta; `format` already carries the real type name. Arrays need
`getColumnFormat` so `_int4` becomes `int4[]`.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Bug Fixes**
* Improved column type labels in filter and sort menus by displaying the
appropriate format instead of raw data types.
* Preserved existing JSON-field restrictions and tooltips while
improving the clarity of displayed column information.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-07-23 02:02:28 +10:00
..