Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
69ee469
wip(plugin-dashboard): drill opens a centred dialog over the standard…
claude Nov 22, 2026
184bb3c
test(plugin-dashboard): pin the drill dialog over the standard list, …
claude Nov 22, 2026
65b1a66
fix(plugin-dashboard): one chip for a drill condition stated twice; t…
claude Nov 22, 2026
132cb18
fix(plugin-dashboard): a drilled date bound reads as the list's date …
claude Nov 22, 2026
0290ee5
Merge origin/main into claude/issue-36256-drill-dialog
claude Nov 22, 2026
546668b
chore(changeset): the drill dialog changeset declares Clause-② yes (w…
claude Nov 22, 2026
f8140a7
fix(plugin-dashboard): the drill chip split names no spec-owned type,…
claude Nov 22, 2026
37367f3
Merge origin/main into claude/issue-36256-drill-dialog
claude Nov 22, 2026
bd8af5c
fix(plugin-dashboard): the drill dialog caps its width at 70vw rather…
claude Nov 22, 2026
0a48051
Merge branch 'main' into claude/issue-36256-drill-dialog
objectstack-fleet[bot] Nov 22, 2026
38e0789
fix(dashboard): drill dialog columns for relationship paths, record f…
claude Nov 22, 2026
5af2f6e
test(plugin-dashboard): split the drill chain pin by host kind
claude Nov 22, 2026
c59a3fc
Merge branch 'main' into claude/issue-36256-drill-dialog
objectstack-fleet[bot] Nov 22, 2026
6df5000
fix(dashboard): the off-page record dialog draws the fields the drill…
claude Nov 22, 2026
b91ec49
test(plugin-dashboard): type the projecting list stub
claude Nov 22, 2026
62d97e4
fix(dashboard): a page block's drill keeps its rule-array filter
claude Nov 22, 2026
942e9c2
fix(dashboard): read measured fields from object parts only
claude Nov 22, 2026
8e8c3bf
fix(dashboard): a drill keeps every filter it cannot lower, and draws…
claude Nov 22, 2026
a9d781d
chore(changeset): grade @object-ui/components patch
claude Nov 22, 2026
40bd802
Merge remote-tracking branch 'origin/main' into claude/issue-36256-dr…
claude Nov 23, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .changeset/36256-drill-dialog-standard-list.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
'@object-ui/plugin-dashboard': patch
'@object-ui/plugin-report': patch
'@object-ui/react': patch
'@object-ui/app-shell': patch
'@object-ui/components': patch
---

feat(plugin-dashboard): a dashboard or report drill opens a centred dialog over the standard list, and a report's chart marks drill

Clause-②: yes (widening) — additive members only, among them the new `PageRegionPostureReset` export of `@object-ui/components`; nothing is removed or renamed
Metadata-protocol: none

Clicking a number on a dashboard (a chart mark, a metric tile, a table cell) or on a dataset report used to open a full-height side drawer whose table listed every field of the object, with no sort, no filter and no word on which conditions selected the records; a row stacked a second record panel on top. The drill now opens a dialog about 70% wide and 65% tall that dims and blurs nothing behind it, and its body is the standard list the object list page draws (`list-view`): the same row height, column-header sort, filter chips, added columns, record count and column calculations. The drill's conditions (the clicked bucket, the widget's filter, the measure's scope) are the list's own chips and can be changed or removed; a condition no chip can say (a relationship path, an `$or`) still filters the list. The default columns are the record's name, the grouped fields and the measured fields. Nothing done in the dialog is saved, and it writes nothing. A record's name opens the record's full page, whose 「N of M」 stepper walks the drill's rows and whose way back is the dashboard or report; no second panel is stacked. 「Open in list」 is unchanged. On a phone the drill keeps the side drawer, with the same list.

A dataset report's chart marks now drill too: a bar opens the same records as the summary line it stands for.

Additive members: `DrillNavigationValue.openRecord` and the `DrillRecordOrigin` type (`@object-ui/react`), `DrillDownDrawerProps.defaultColumns` (`@object-ui/plugin-dashboard`), `DatasetDrillArgs.fields` (`@object-ui/plugin-report`), `PageRegionPostureReset` (`@object-ui/components`). A renderer without `@object-ui/plugin-list` registered lists the drilled records in the dashboard's data table. A host that gives no `openRecord` (a page block's metric or pivot) opens the drilled record in a dialog, from either body.

Inside a page the drill draws the same standard list: the page region's posture (the compact or capped list a page block draws) is cleared for the drill's dialog by the new `PageRegionPostureReset` (`@object-ui/components`), so a page block's metric or pivot drill shows its chips, its record count and its pager, and no 「View all」 link to a list without the drill's condition. A drill whose filter names no condition any read can carry (a string, a number) lists nothing and says so, instead of listing every record.
8 changes: 6 additions & 2 deletions ui/packages/app-shell/src/views/DashboardView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,6 @@ type DashboardRefreshState = Parameters<
// ---------------------------------------------------------------------------

export function DashboardView({ dataSource }: { dataSource?: any }) {
// Drill "escape hatch": lets the drill drawers open an object's full list page.
const drillNavigation = useRecordListDrillNavigation();
const { dashboardName } = useParams<{ dashboardName: string }>();
// Setup's own System Overview (`platform-objects`' `system_overview`).
const isSystemOverview = useInSetupApp() && dashboardName === 'system_overview';
Expand Down Expand Up @@ -235,6 +233,12 @@ export function DashboardView({ dataSource }: { dataSource?: any }) {
const missedName = !dashboard && dashboardsSettled && !previewDrafts && dashboardName ? dashboardName : null;
const access = useMetaItemRefusal('dashboard', missedName);

// Drill navigation: the drill list's 「Open in list」 and its record pages,
// which name this dashboard as their way back (objectstack-ai/objectstack#36256).
const drillNavigation = useRecordListDrillNavigation(
dashboard ? resolveKeyedI18nLabel(dashboard.label, t) || dashboard.name : undefined,
);

// ---- Runtime capability gate --------------------------------------------
// Hide widgets whose `requiresObject` is not registered (mirrors
// NavigationItem.requiresObject for nav entries). Defaults to widget.object
Expand Down
18 changes: 11 additions & 7 deletions ui/packages/app-shell/src/views/ReportView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,10 @@ export function ReportView({ dataSource }: { dataSource?: DataSource }) {
// Drill-through (ADR-0021 D2): clicking an aggregated row/cell opens the
// underlying records in an in-place drawer (peek without leaving the report),
// with an "Open in list →" escape hatch to the full object list page.
const drillNavigation = useRecordListDrillNavigation();
const [drill, setDrill] = useState<{ object: string; filter: Record<string, unknown>; title: string } | null>(null);
const drillNavigation = useRecordListDrillNavigation(
metadataText(reportData?.title, language) ?? metadataText(reportData?.label, language),
);
const [drill, setDrill] = useState<{ object: string; filter: Record<string, unknown>; title: string; fields?: string[] } | null>(null);

const getFieldsForObject = useCallback(
(objName: string | undefined) => {
Expand Down Expand Up @@ -152,7 +154,7 @@ export function ReportView({ dataSource }: { dataSource?: DataSource }) {
// dim (the drill lands on a superset rather than filtering wrongly)
// - granularity-bucketed dates → need a range, not equality; skip too
const handleDatasetDrill = useCallback(
async ({ dataset, groupKey, object, objectFilter }: DatasetDrillArgs) => {
async ({ dataset, groupKey, object, objectFilter, fields }: DatasetDrillArgs) => {
try {
// Drawer header: the clicked group's display values (e.g. "West / Q3"),
// else the report's label in the viewer's language (objectui#13470).
Expand All @@ -165,7 +167,7 @@ export function ReportView({ dataSource }: { dataSource?: DataSource }) {
// server's drillRawRows — correct for select/lookup dims (a stored
// value, not a display label) with NO dataset-definition round-trip.
if (object && objectFilter) {
setDrill({ object, filter: objectFilter, title });
setDrill({ object, filter: objectFilter, title, fields });
return;
}

Expand Down Expand Up @@ -602,15 +604,17 @@ export function ReportView({ dataSource }: { dataSource?: DataSource }) {
/>
</div>
</div>
{/* Drill-through drawer: peek the records behind a clicked group, then
click a row to open a record, or use "Open in list →" to escalate to
the full object list page. */}
{/* Drill-through dialog: the records behind a clicked group or bar in the
standard list; a record's name opens its page, 「Open in list」 the
object's list page (objectstack-ai/objectstack#36256). */}
<DrillDownDrawer
open={!!drill}
onClose={() => setDrill(null)}
title={drill?.title ?? ''}
objectName={drill?.object ?? ''}
filter={drill?.filter}
defaultColumns={drill?.fields}
target="dialog"
dataSource={dataSource as any}
/>
</DrillNavigationProvider>
Expand Down
104 changes: 104 additions & 0 deletions ui/packages/app-shell/src/views/drillDialogStandardList-36256.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
/**
* objectstack-ai/objectstack#36256 items 3, 5 and 8 — the drill dialog draws
* the REAL standard list (`@object-ui/plugin-list`'s `list-view`): the
* drill's conditions are the list's own chips, removable; the default
* columns are the record's name and the drilled fields; and nothing the
* reader does in it writes anything — no record write through the data
* source, no request that is not a read, no stored preference.
*/
import { describe, it, expect, vi, afterEach } from 'vitest';
import { act, cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import '@testing-library/jest-dom';
import React from 'react';
import { DrillNavigationProvider, SchemaRendererProvider } from '@object-ui/react';
import { DrillDownDrawer } from '@object-ui/plugin-dashboard';
import '@object-ui/plugin-list';

const DEFINITION = {
name: 'deal_36256',
label: 'Deal',
nameField: 'name',
fields: {
name: { type: 'text', label: 'Name' },
stage: {
type: 'select',
label: 'Stage',
options: [
{ value: 'proposal', label: 'Proposal' },
{ value: 'negotiation', label: 'Negotiation' },
],
},
amount: { type: 'number', label: 'Amount' },
owner: { type: 'text', label: 'Owner' },
},
};

function mount() {
const ds = {
find: vi.fn().mockResolvedValue({ data: [{ id: 'd1', name: 'Acme', stage: 'negotiation', amount: 3 }], total: 1 }),
findOne: vi.fn(),
create: vi.fn(),
update: vi.fn(),
delete: vi.fn(),
bulk: vi.fn(),
getObjectSchema: vi.fn(async () => structuredClone(DEFINITION)),
};
const fetchSpy = vi.fn(async () => ({ ok: true, json: async () => ({}) }));
vi.stubGlobal('fetch', fetchSpy);
const setItem = vi.spyOn(Storage.prototype, 'setItem');
const openRecord = vi.fn();
render(
<SchemaRendererProvider dataSource={ds as any}>
<DrillNavigationProvider value={{ openRecord }}>
<DrillDownDrawer
open
target="dialog"
onClose={vi.fn()}
title="Negotiation"
objectName="deal_36256"
filter={{ stage: 'negotiation', amount: { $null: false } }}
defaultColumns={['stage', 'amount']}
dataSource={ds}
/>
</DrillNavigationProvider>
</SchemaRendererProvider>,
);
return { ds, fetchSpy, setItem, openRecord };
}

afterEach(() => {
cleanup();
vi.unstubAllGlobals();
vi.restoreAllMocks();
});

describe('the drill dialog draws the standard list (#36256)', () => {
it('shows the drill conditions as removable chips, and removing one re-reads without writing', async () => {
const { ds, fetchSpy, setItem } = mount();
const dialog = await screen.findByTestId('drill-down-dialog');
const chip = await within(dialog).findByTestId('filter-chip-stage');
expect(chip).toHaveTextContent('Stage: Negotiation');
await waitFor(() => expect(ds.find).toHaveBeenCalled());
const firstQuery = JSON.stringify(ds.find.mock.calls.at(-1));
expect(firstQuery).toContain('negotiation');

const reads = ds.find.mock.calls.length;
await act(async () => fireEvent.click(within(dialog).getByTestId('filter-chip-remove-stage')));
await waitFor(() => expect(ds.find.mock.calls.length).toBeGreaterThan(reads));
expect(JSON.stringify(ds.find.mock.calls.at(-1))).not.toContain('negotiation');

for (const write of [ds.create, ds.update, ds.delete, ds.bulk]) expect(write).not.toHaveBeenCalled();
for (const [, init] of fetchSpy.mock.calls as unknown as Array<[unknown, { method?: string } | undefined]>) {
expect((init?.method ?? 'GET').toUpperCase()).toBe('GET');
}
expect(setItem).not.toHaveBeenCalled();
});

it("leads with the record's name, then the drilled fields", async () => {
mount();
const dialog = await screen.findByTestId('drill-down-dialog');
await within(dialog).findByText('Acme');
const headers = within(dialog).getAllByRole('columnheader').map((h) => h.textContent?.trim()).filter(Boolean);
expect(headers.slice(0, 3)).toEqual(['Name', 'Stage', 'Amount']);
});
});
113 changes: 113 additions & 0 deletions ui/packages/app-shell/src/views/pageBlockDrillFilter-36256.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/**
* objectstack-ai/objectstack#36256 — a page block's drill lists the records
* its number counts.
*
* HotCRM's 销售主页 KPI tile is an `object-metric` block whose `filter` is the
* spec's rule-array form, `[{ field: 'stage', operator: 'equals', value:
* 'closed_won' }]`, handed to the drill as written. The drill draws the REAL
* standard list (`@object-ui/plugin-list`) over an in-memory matcher
* (`ValueDataSource`), so the read it sends is judged as a server would judge
* it. The tile counts the won deals. The drill must read with that condition
* and list exactly those deals, never every record of the object.
*/
import { describe, it, expect, vi, afterEach } from 'vitest';
import { cleanup, fireEvent, render, screen, waitFor, within } from '@testing-library/react';
import '@testing-library/jest-dom';
import React from 'react';
import { SchemaRenderer, SchemaRendererProvider } from '@object-ui/react';
import { ValueDataSource } from '@object-ui/core';
import '@object-ui/plugin-dashboard';
import '@object-ui/plugin-list';

const DEFINITION = {
name: 'opp_36256',
label: 'Opportunity',
nameField: 'name',
fields: {
name: { type: 'text', label: 'Name' },
stage: { type: 'text', label: 'Stage' },
amount: { type: 'number', label: 'Amount' },
},
};

const ROWS = [
{ id: 'o1', name: 'Initech Phase 1', stage: 'closed_won', amount: 90000 },
{ id: 'o2', name: 'Wayne Q1 Expansion', stage: 'closed_won', amount: 380000 },
{ id: 'o3', name: 'Apex Logistics Data Hub', stage: 'needs_analysis', amount: 93000 },
];
const WON = ROWS.filter((r) => r.stage === 'closed_won');

function mount(filter: unknown = [{ field: 'stage', operator: 'equals', value: 'closed_won' }]) {
const matcher = new ValueDataSource({ items: ROWS });
const ds = {
find: vi.fn((object: string, params?: Record<string, unknown>) => matcher.find(object, params as never)),
// The tile's own number: the won deals' sum.
aggregate: vi.fn(async (_object: string, _params: Record<string, unknown>) => [{ amount_sum: WON.reduce((a, r) => a + r.amount, 0) }]),
getObjectSchema: vi.fn(async () => structuredClone(DEFINITION)),
};
vi.stubGlobal('fetch', vi.fn(async () => ({ ok: true, json: async () => ({}) })));
render(
<SchemaRendererProvider dataSource={ds as never}>
<SchemaRenderer
schema={{
type: 'object-metric',
objectName: 'opp_36256',
label: 'Revenue won',
aggregate: { field: 'amount', function: 'sum' },
filter,
drillDown: { enabled: true, target: 'dialog', columns: ['name', 'stage', 'amount'] },
} as never}
/>
</SchemaRendererProvider>,
);
return ds;
}

afterEach(() => {
cleanup();
vi.unstubAllGlobals();
vi.restoreAllMocks();
});

describe("a page block's rule-array filter reaches its drill's read (#36256)", () => {
it('lists exactly the records the tile counts, and the read carries the condition', async () => {
const ds = mount();
fireEvent.click(await screen.findByRole('button', { name: /revenue won|470,000/i }));
const dialog = await screen.findByTestId('drill-down-dialog');
for (const won of WON) expect(await within(dialog).findByText(won.name)).toBeInTheDocument();
await waitFor(() => expect(within(dialog).queryByText('Apex Logistics Data Hub')).toBeNull());
// The read the list sent, and the condition it carries.
const reads = ds.find.mock.calls.filter(([object]) => object === 'opp_36256');
expect(reads.length).toBeGreaterThan(0);
expect(JSON.stringify(reads.at(-1)?.[1]?.$filter)).toContain('closed_won');
});

it.each([
['an array that is neither rules nor AST', [{ stage: 'closed_won' }]],
['a rule with a blank field', [{ field: '', operator: 'equals', value: 'closed_won' }]],
['a valid rule beside a malformed one', [{ field: 'stage', operator: 'equals', value: 'closed_won' }, { stage: 'x' }]],
])('hands a filter the conversion answers nothing for to the list as its base filter, never an unfiltered read: %s', async (_, filter) => {
const ds = mount(filter);
fireEvent.click(await screen.findByRole('button', { name: /revenue won|470,000/i }));
const dialog = await screen.findByTestId('drill-down-dialog');
await waitFor(() => expect(ds.find.mock.calls.some(([object]) => object === 'opp_36256')).toBe(true));
// Every read carries the filter (a server refuses it as malformed; it is
// never read as no filter).
for (const [object, params] of ds.find.mock.calls) {
if (object === 'opp_36256') expect(params?.$filter).toBeDefined();
}
await waitFor(() => expect(within(dialog).queryByText('Apex Logistics Data Hub')).toBeNull());
});

it.each([
['a string', 'stage = closed_won'],
['a number', 7],
])('lists nothing for a filter no read can carry, and sends no read: %s', async (_, filter) => {
const ds = mount(filter);
fireEvent.click(await screen.findByRole('button', { name: /revenue won|470,000/i }));
const dialog = await screen.findByTestId('drill-down-dialog');
expect(within(dialog).getByTestId('drill-down-notice')).toHaveAttribute('data-notice', 'unavailable');
await new Promise((r) => setTimeout(r, 50));
expect(ds.find.mock.calls.filter(([object]) => object === 'opp_36256')).toEqual([]);
});
});
Loading
Loading