Skip to content

Commit bd759bb

Browse files
committed
fix(app-shell): offer the footer menu on a shared view only where the metadata door stores it; migrate e2e count reads to the footer row
Claude-Session: https://claude.ai/code/session_01L6bhgVb7fsaFeMStucvNWA Co-authored-by: Claude <noreply@anthropic.com>
1 parent c116220 commit bd759bb

4 files changed

Lines changed: 17 additions & 12 deletions

File tree

‎ui/e2e/list-condition-row-35549.spec.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import { uiRoot } from '../scripts/ui-root.mjs';
3737
*
3838
* - The data source is in memory: one object definition and twelve records.
3939
* It records every `find` it is asked, and answers the stage filter
40-
* (`in`) and the sort the list sends, so the count bar and the row order
40+
* (`in`) and the sort the list sends, so the footer row's count and the row order
4141
* move as they do against a server.
4242
* - The translator is the English defaults table (no provider).
4343
* - Animations are off, so a closed popover leaves the page at once rather
@@ -256,7 +256,7 @@ async function mount(page: Page): Promise<void> {
256256
await page.goto('http://localhost/list-condition-row');
257257
await page.addScriptTag({ content: bundle, type: 'module' });
258258
await page.getByTestId('toolbar-filter-trigger').waitFor({ state: 'attached', timeout: 30_000 });
259-
await page.getByTestId('record-count-bar').waitFor({ state: 'attached', timeout: 30_000 });
259+
await page.getByTestId('data-table-summary-lead').waitFor({ state: 'attached', timeout: 30_000 });
260260
await style(page);
261261
}
262262

@@ -268,8 +268,8 @@ async function click(page: Page, testId: string): Promise<void> {
268268

269269
const slot = (page: Page) => page.getByTestId('list-condition-row');
270270
const slotHeight = (page: Page) => slot(page).evaluate((el) => el.getBoundingClientRect().height);
271-
/** The number the count bar reads, once the list has answered. */
272-
const count = async (page: Page) => (await page.getByTestId('record-count-bar').textContent())?.match(/\d+/)?.[0];
271+
/** The number the grid's footer row leads with (objectstack#35702), once the list has answered. */
272+
const count = async (page: Page) => (await page.getByTestId('data-table-summary-lead').textContent())?.match(/\d+/)?.[0];
273273
const sortNow = (page: Page) =>
274274
page.evaluate(() => (window as unknown as { __sort: Array<{ field: string; order: string }> }).__sort.map((s) => `${s.field}:${s.order}`));
275275

‎ui/e2e/live/saved-view-filter.spec.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { test, expect } from '@playwright/test';
2727
* `showcase_task.in_progress` is a SHIPPED saved view whose stored filter is
2828
* exactly that rule array (`src/ui/views/task.view.ts`), so no fixture setup is
2929
* needed — opening it is the reproduction. Before the fix the list renders no
30-
* rows at all (the request 400s, so `record-count-bar` never mounts); after it,
30+
* rows at all (the request 400s, so the footer row's count never mounts); after it,
3131
* the 2 in-progress tasks out of 10.
3232
*
3333
* Prereqs: the usual live-e2e pair (see playwright.live.config.ts). Run:
@@ -60,7 +60,7 @@ test('a saved view filter reaches $filter as AST, and the server answers 200', a
6060
await page.goto(`/apps/${APP}/showcase_task/view/showcase_task.in_progress`);
6161

6262
// The filter applied: 2 of the 10 seeded tasks are in_progress.
63-
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 20000 });
63+
await expect(page.getByTestId('data-table-summary-lead')).toContainText(/^2 /, { timeout: 20000 });
6464

6565
// And it applied by being ACCEPTED, not by some later rescue.
6666
expect(refused, `data requests the backend refused:\n${refused.join('\n')}`).toEqual([]);

‎ui/e2e/live/user-filters.spec.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ test.describe('ADR-0053 interface mode — Task Triage tabs element', () => {
3333
// Picking a tab filters the grid and mirrors into the URL.
3434
await urgentTab.click();
3535
await expect(page).toHaveURL(/uf__tab=urgent/);
36-
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 15000 });
36+
await expect(page.getByTestId('data-table-summary-lead')).toContainText(/^2 /, { timeout: 15000 });
3737

3838
// Reload: the tab selection and its filter survive.
3939
await page.reload();
4040
await expect(page).toHaveURL(/uf__tab=urgent/);
41-
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 15000 });
41+
await expect(page.getByTestId('data-table-summary-lead')).toContainText(/^2 /, { timeout: 15000 });
4242
});
4343
});
4444

@@ -105,7 +105,7 @@ test.describe('ADR-0047 interface mode — Task Workbench', () => {
105105
// Select Urgent: the grid narrows and the URL picks up the selection.
106106
await options.getByText('Urgent').click();
107107
await expect(page).toHaveURL(/uf_priority=urgent/);
108-
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 15000 });
108+
await expect(page.getByTestId('data-table-summary-lead')).toContainText(/^2 /, { timeout: 15000 });
109109

110110
// Counts snapshot: with Urgent active the OTHER options keep their
111111
// pre-selection counts instead of collapsing to 0 (the server already
@@ -123,6 +123,6 @@ test.describe('ADR-0047 interface mode — Task Workbench', () => {
123123
await page.reload();
124124
await expect(page).toHaveURL(/uf_priority=urgent/);
125125
await expect(page.getByTestId('filter-badge-priority')).toContainText('1');
126-
await expect(page.getByTestId('record-count-bar')).toContainText(/^2 /, { timeout: 15000 });
126+
await expect(page.getByTestId('data-table-summary-lead')).toContainText(/^2 /, { timeout: 15000 });
127127
});
128128
});

‎ui/packages/app-shell/src/views/ObjectView.tsx‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import { useRecordOpenPreference } from '../utils/recordOpenPreference.js';
5959
import { usePhoneViewport } from '../hooks/usePhoneViewport.js';
6060
import { LIST_PINNED_VIEW_PREFERENCE, objectPreferenceScope, useWorkspacePreference } from '../utils/workspacePreference.js';
6161
import type { ListViewProps } from '@object-ui/plugin-list';
62-
import { defaultListViewId, viewRowId } from '../utils/viewIdentity.js';
62+
import { defaultListViewId, isSavedViewId, viewRowId } from '../utils/viewIdentity.js';
6363
import { useObjectActions } from '../hooks/useObjectActions.js';
6464
import { useObjectTranslation, useObjectLabel } from '@object-ui/i18n';
6565
import { usePermissions } from '@object-ui/permissions';
@@ -1120,7 +1120,12 @@ function ObjectViewInner({ dataSource, objects, onEdit, externalRefreshKey }: Co
11201120
? undefined
11211121
: activeIsPersonal
11221122
? (canUpdatePersonalView ? handlePickPersonalViewSummary : undefined)
1123-
: isAdmin ? handlePickSharedViewSummary : undefined,
1123+
// Only a view the metadata door stores: a package view
1124+
// (a qualified, dotted name) or a saved one, never the
1125+
// fallback tab an object with no views is drawn with.
1126+
: isAdmin && (String(activeView.id).includes('.') || isSavedViewId(savedViews, String(activeView.id)))
1127+
? handlePickSharedViewSummary
1128+
: undefined,
11241129
},
11251130
});
11261131

0 commit comments

Comments
 (0)