@jskit-ai/shell-web 0.2.57 → 0.2.59
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/package.json +4 -4
- package/src/client/components/ShellPageActionsTarget.vue +6 -5
- package/src/client/composables/useShellPageActionsFold.js +19 -14
- package/src/client/support/appBarWidths.js +5 -1
- package/src/client/support/pageActions.js +5 -4
- package/test/adaptiveShell.browser.test.js +49 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- An expanded or large top app bar truncates a long page title before it folds a page action into More actions: it folds the actions, the last first, only when the title would have less than 200px beside them (or its whole width when narrower). A medium bar still keeps its whole title. 0.2.58's fold left every bar's actions only the room beside the title's whole width, so a title wider than the bar folded every foldable action and was truncated anyway: control's support case page, at 1280 px, put its one action, Close the case, behind More actions beside a 1356 px subject. `useShellPageActionsFold` takes `wholeTitle` (ShellPageActionsTarget passes the medium size class), and `appBarWidths.js` exports the floor as `WIDE_BAR_TITLE_FLOOR`. `adaptiveShell.browser.test.js` checks a long title at 1280 px (every action stays, the title truncates) and at 900 px (the last actions fold, only as many as leave the title its floor).
|
|
6
|
+
|
|
5
7
|
- A medium or expanded top app bar folds the page actions it has no room for into its "More actions" menu, the last first, so the menu button and the bar's own items after the actions (the account menu, `shell-layout:top-right`) always stay on screen. Medium and wider bars showed every page action whatever its width, and the actions' box never shrank, so a record page with long labels pushed the rest of the bar out of the window: mobilynet's hosted service page at 768 px (Change size, Restart, "Restore into a new hosted service", Add tags) left the title no room and put More actions, with Delete and Update tooling, and the account button past the window's edge, where nobody could reach them. `ShellPageActionsTarget` now measures its bar's row as drawn and keeps the actions that fit beside the page title's whole width, after the bar's other items, as a compact bar already does for its top-right items; the others go into the menu in bar order, before its `overflow` actions. The primary action never folds, and the title is clipped only once nothing more can. It measures again when the bar is resized, its content changes (a title, an action's label, a page's actions) or fonts load, and a bar that widens shows its folded actions again. Until a fit, the actions' box clips the actions rather than push the items after it, and `ShellLayout`'s title box gives up its room first. A page whose actions fit beside its title, at 1280 px nearly every one, keeps them all in the bar. Where a title was clipped beside actions that still fitted, the title is now whole and the actions it needs the room of fold, the last first: a long title at 1280 px, or a record page with a long name at 768 px. A layout that draws its own top app bar with `useShellAppBar()` gets the same fold when `ShellPageActionsTarget` is an item of its bar's row; the room its title needs is read from the title's text, and an empty item that grows, such as a `v-spacer`, counts as room. Compact bars keep their rule: every action but the primary one is in the menu.
|
|
6
8
|
- `ShellLayout`'s drawer, rail and navigation bar no longer arrive under the page as it opens. An app whose navigation waits for context it loads after the page opens, such as its own session's permissions (mobilynet's console), had the drawer, the rail, the navigation bar and the app bar's menu control drawn when that arrived, so the content, the title and the FAB moved under a person's pointer: in the adaptive shell fixture, a page's button moved from x=24 to x=272 (x=104 beside the rail) and a click made where it showed landed on the drawer's or the rail's Machines link, and on a phone the FAB rose 80px and the click landed on the bar's Alerts tab. The placement context now says which part is still loading: `mergeContext(value, source, { pending: true })` (and `replaceContext`, and the runtime's `setContext(value, { source, pending })`), set before `ShellLayout` mounts and ended by the source's next call without `pending`, on success or failure; the runtime's `isContextPending()` reads it. Meanwhile `ShellLayout` lays its parts out unseen and untouchable, its main `aria-busy`, and then shows them all at once, where they stay, with nothing sliding or fading in. It waits once, as it mounts; with nothing pending it shows the page right after the render that mounts it, as before. A content-fitted drawer is fitted before the page first shows, once the page's fonts have arrived or after at most 100 ms, the longest block period the CSS Fonts spec recommends for `font-display: swap` (a page whose navigation was ready slid 61px as the drawer opened at 248px and was fitted a frame later, then 2px more when Roboto Flex replaced the fallback font). A font slower than that leaves the page shown in the fallback font and refits the drawer when it comes, as swap does; material-web now asks for its typefaces as the app boots, so they are usually in before the shell mounts, and a drawer that arrives after the shell mounted is watched and fitted as one drawn from the start. A placement runtime an app writes itself, such as a test double that mounts `ShellLayout`, needs `isContextPending()`.
|
|
7
9
|
- **Breaking for apps' smoke checks:** a navigation bar destination takes `shortLabel`, the label a phone's bar shows (each destination there has about 68px); menus, the rail and the drawer keep `label`. A bar label wider than its slot now ends in an ellipsis inside it: the label could be 88px (5.5rem) wide in a 68px slot, so the centred button cut both its ends (mobilynet's "Metal servers" read "etal server"). The ellipsis is a fallback, not a pass: `runAdaptiveShellSmoke` and `runAdaptiveShellSmokeCase` now fail on any bar label that is cut or ends in an ellipsis, naming it, and `expectWholeNavigationBarLabels(bottomNavigation, expect)` (`@jskit-ai/shell-web/test/adaptiveShellSmoke`) runs the same check on any page. **An app whose bar labels run long must give those placements a `shortLabel` when it takes this JSKIT**, or its adaptive shell smoke fails. An app's own tab link wrapper that lists its props passes `shortLabel` on, as the application-shell pattern's `TabLinkItem` now does.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jskit-ai/shell-web",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.59",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "jskit test"
|
|
@@ -48,14 +48,14 @@
|
|
|
48
48
|
"./locales/en.json": "./locales/en.json"
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
|
-
"@jskit-ai/architecture-inspector": "0.1.
|
|
51
|
+
"@jskit-ai/architecture-inspector": "0.1.35"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"@jskit-ai/material-web": "0.1.
|
|
54
|
+
"@jskit-ai/material-web": "0.1.17",
|
|
55
55
|
"@vue/compiler-sfc": "3.5.44"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@jskit-ai/kernel": "0.2.
|
|
58
|
+
"@jskit-ai/kernel": "0.2.36",
|
|
59
59
|
"pinia": "^4.0.3",
|
|
60
60
|
"vue": "^3.5.44",
|
|
61
61
|
"vue-router": "^5.3.1",
|
|
@@ -7,9 +7,10 @@ import { SHELL_PAGE_ACTIONS_ID } from "../support/navigationPresentation.js";
|
|
|
7
7
|
import { NO_SHELL_PAGE_ACTIONS_REGISTRY, SHELL_PAGE_ACTIONS_REGISTRY_KEY } from "../support/pageActions.js";
|
|
8
8
|
|
|
9
9
|
// Where the current page's ShellPageActions show: after the page title in the top app bar, followed by the bar's
|
|
10
|
-
// overflow menu (Material 3's trailing "More actions" menu) when an action goes there. On medium
|
|
11
|
-
//
|
|
12
|
-
//
|
|
10
|
+
// overflow menu (Material 3's trailing "More actions" menu) when an action goes there. On medium windows the actions
|
|
11
|
+
// that don't fit beside the whole title go there, the last first (useShellPageActionsFold); on expanded and large ones
|
|
12
|
+
// the title truncates first, and only the actions that don't fit beside its floor go. Until they have, the actions'
|
|
13
|
+
// box clips them, so the menu button and the bar's items after it stay on screen. Its `menu`
|
|
13
14
|
// slot adds the bar's own items that don't fit (on a phone, ShellLayout's top-right items) below the actions. The menu
|
|
14
15
|
// keeps the slot mounted while it is closed, so an item there that does more than draw a button keeps working.
|
|
15
16
|
// ShellLayout's bar has it; a layout that draws its own top app bar renders it once there, as an item of the bar's
|
|
@@ -31,7 +32,7 @@ const moreLabel = computed(() => t("jskit.shell.actions.more"));
|
|
|
31
32
|
const slots = useSlots();
|
|
32
33
|
const menuOpen = ref(false);
|
|
33
34
|
const actionsBox = ref(null);
|
|
34
|
-
const { isCompact } = useShellWindowSizeClass();
|
|
35
|
+
const { isCompact, isMedium } = useShellWindowSizeClass();
|
|
35
36
|
const folds = computed(() => !isCompact.value);
|
|
36
37
|
|
|
37
38
|
// Read as the menu renders, since slots are not reactive.
|
|
@@ -39,7 +40,7 @@ function showsItems() {
|
|
|
39
40
|
return props.menuItems && Boolean(slots.menu);
|
|
40
41
|
}
|
|
41
42
|
|
|
42
|
-
useShellPageActionsFold({ enabled: folds, registry, target: actionsBox, ownMenu: showsItems });
|
|
43
|
+
useShellPageActionsFold({ enabled: folds, wholeTitle: isMedium, registry, target: actionsBox, ownMenu: showsItems });
|
|
43
44
|
|
|
44
45
|
function showsMenu() {
|
|
45
46
|
return menuEntries.value.length > 0 || showsItems();
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { nextTick, onBeforeUnmount, onMounted, watch } from "vue";
|
|
2
2
|
import { PAGE_TITLE_ID } from "../navigation/shellNavigationRuntime.js";
|
|
3
|
-
import { ICON_BUTTON_WIDTH, contentWidth, wholeTitleWidth, widthInRow } from "../support/appBarWidths.js";
|
|
3
|
+
import { ICON_BUTTON_WIDTH, WIDE_BAR_TITLE_FLOOR, contentWidth, wholeTitleWidth, widthInRow } from "../support/appBarWidths.js";
|
|
4
4
|
import { resolveFoldedPageActions } from "../support/pageActions.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
* The width a top app bar's row leaves its page actions and overflow button beside the
|
|
8
|
-
*
|
|
9
|
-
*
|
|
7
|
+
* The width a top app bar's row leaves its page actions and overflow button beside the title: the row's width less each
|
|
8
|
+
* of its other items, where an item that grows (the title's box, a spacer) needs only the title, or nothing when it is
|
|
9
|
+
* empty. The title needs its whole width when `wholeTitle`, else that up to WIDE_BAR_TITLE_FLOOR, past which it
|
|
10
|
+
* truncates.
|
|
10
11
|
* @param {HTMLElement} row
|
|
11
12
|
* @param {HTMLElement} target The actions' box.
|
|
12
13
|
* @param {Element | null} menuButton
|
|
14
|
+
* @param {boolean} wholeTitle
|
|
13
15
|
*/
|
|
14
|
-
function actionsRoom(row, target, menuButton) {
|
|
16
|
+
function actionsRoom(row, target, menuButton, wholeTitle) {
|
|
15
17
|
const title = document.getElementById(PAGE_TITLE_ID);
|
|
16
18
|
let room = contentWidth(row);
|
|
17
19
|
for (const child of row.children) {
|
|
@@ -21,7 +23,8 @@ function actionsRoom(row, target, menuButton) {
|
|
|
21
23
|
room -= widthInRow(child);
|
|
22
24
|
if (Number.parseFloat(window.getComputedStyle(child).flexGrow) > 0) {
|
|
23
25
|
if (title && child.contains(title)) {
|
|
24
|
-
|
|
26
|
+
const whole = wholeTitleWidth(title);
|
|
27
|
+
room += contentWidth(child) - (wholeTitle ? whole : Math.min(whole, WIDE_BAR_TITLE_FLOOR));
|
|
25
28
|
} else if (child.childElementCount === 0 && !child.textContent.trim()) {
|
|
26
29
|
room += child.getBoundingClientRect().width;
|
|
27
30
|
}
|
|
@@ -36,18 +39,20 @@ function widthOfChildren(element) {
|
|
|
36
39
|
}
|
|
37
40
|
|
|
38
41
|
/**
|
|
39
|
-
* Folds a medium or
|
|
40
|
-
* the last first (resolveFoldedPageActions), measured on the bar as drawn, so the overflow button and the bar's
|
|
41
|
-
* items after the actions always stay on screen.
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* Folds a medium, expanded or large top app bar's page actions that don't fit beside its title into its overflow
|
|
43
|
+
* menu, the last first (resolveFoldedPageActions), measured on the bar as drawn, so the overflow button and the bar's
|
|
44
|
+
* own items after the actions always stay on screen. A medium bar keeps its whole title (`wholeTitle`); a wider one has
|
|
45
|
+
* room for its actions, so its title truncates first, down to WIDE_BAR_TITLE_FLOOR. It measures again when the bar's
|
|
46
|
+
* content changes (a new title, an action's label, a page's actions), when the bar is resized and when fonts load. A
|
|
47
|
+
* folded action keeps the width it had in the bar; a compact bar folds by its own rule (`enabled`).
|
|
44
48
|
* @param {object} options
|
|
45
49
|
* @param {import("vue").Ref<boolean>} options.enabled
|
|
50
|
+
* @param {import("vue").Ref<boolean>} options.wholeTitle Whether the actions fold to leave the title whole.
|
|
46
51
|
* @param {import("../support/pageActions.js").ShellPageActionsRegistry} options.registry The bar's page actions.
|
|
47
52
|
* @param {import("vue").Ref<HTMLElement | null>} options.target The actions' box, an item of the bar's row.
|
|
48
53
|
* @param {() => boolean} options.ownMenu Whether the overflow menu holds the bar's own items now.
|
|
49
54
|
*/
|
|
50
|
-
function useShellPageActionsFold({ enabled, registry, target, ownMenu }) {
|
|
55
|
+
function useShellPageActionsFold({ enabled, wholeTitle, registry, target, ownMenu }) {
|
|
51
56
|
const widths = new Map();
|
|
52
57
|
let menuButtonWidth = ICON_BUTTON_WIDTH;
|
|
53
58
|
let row = null;
|
|
@@ -85,7 +90,7 @@ function useShellPageActionsFold({ enabled, registry, target, ownMenu }) {
|
|
|
85
90
|
menuButtonWidth = widthInRow(menuButton);
|
|
86
91
|
}
|
|
87
92
|
registry.fold(resolveFoldedPageActions({
|
|
88
|
-
room: actionsRoom(row, targetElement, menuButton),
|
|
93
|
+
room: actionsRoom(row, targetElement, menuButton, wholeTitle.value),
|
|
89
94
|
fixed: widthOfChildren(targetElement) - inBar,
|
|
90
95
|
actions: foldable.map((entry) => widths.get(entry.id)),
|
|
91
96
|
menuButton: menuButtonWidth,
|
|
@@ -93,7 +98,7 @@ function useShellPageActionsFold({ enabled, registry, target, ownMenu }) {
|
|
|
93
98
|
}));
|
|
94
99
|
}
|
|
95
100
|
|
|
96
|
-
watch([enabled, () => registry.foldable.value.map((entry) => entry.id).join("\n")], fit, { flush: "post" });
|
|
101
|
+
watch([enabled, wholeTitle, () => registry.foldable.value.map((entry) => entry.id).join("\n")], fit, { flush: "post" });
|
|
97
102
|
|
|
98
103
|
onMounted(() => {
|
|
99
104
|
row = target.value.parentElement;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
// Material 3's icon button: the width of an item, or of the overflow button, that the bar has not drawn yet.
|
|
2
2
|
const ICON_BUTTON_WIDTH = 48;
|
|
3
|
+
// The least room an expanded or large top app bar leaves its page title before a page action folds, or the whole
|
|
4
|
+
// title when that is narrower: about fourteen characters of the title's type (title-large, 22px). The title truncates
|
|
5
|
+
// down to it.
|
|
6
|
+
const WIDE_BAR_TITLE_FLOOR = 200;
|
|
3
7
|
|
|
4
8
|
/**
|
|
5
9
|
* The title's whole width: its text, or what its slot draws, to the next pixel when it fits, else the text it clips,
|
|
@@ -35,4 +39,4 @@ function contentWidth(element) {
|
|
|
35
39
|
return element.clientWidth - Number.parseFloat(style.paddingInlineStart) - Number.parseFloat(style.paddingInlineEnd);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
|
-
export { ICON_BUTTON_WIDTH, contentWidth, wholeTitleWidth, widthInRow };
|
|
42
|
+
export { ICON_BUTTON_WIDTH, WIDE_BAR_TITLE_FLOOR, contentWidth, wholeTitleWidth, widthInRow };
|
|
@@ -145,11 +145,12 @@ function createShellPageActionsRegistry({ isCompact }) {
|
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
/**
|
|
148
|
-
* How many of a medium or
|
|
149
|
-
* fewest, the last first, that leave the rest, the bar's other actions and the overflow button within the
|
|
150
|
-
*
|
|
148
|
+
* How many of a medium, expanded or large top app bar's foldable page actions (in bar order) go into its overflow
|
|
149
|
+
* menu: the fewest, the last first, that leave the rest, the bar's other actions and the overflow button within the
|
|
150
|
+
* room the title leaves them (useShellPageActionsFold: a medium bar's whole title, a wider bar's up to its floor); all
|
|
151
|
+
* of them when even that is too wide, and the title is clipped beside what stays.
|
|
151
152
|
* @param {object} options
|
|
152
|
-
* @param {number} options.room The width the actions and the overflow button share beside the
|
|
153
|
+
* @param {number} options.room The width the actions and the overflow button share beside the title.
|
|
153
154
|
* @param {number} options.fixed The width of the actions that stay in the bar whatever room is left (the primary).
|
|
154
155
|
* @param {readonly number[]} options.actions Each foldable action's width with its margins, in bar order.
|
|
155
156
|
* @param {number} options.menuButton The overflow button's width.
|
|
@@ -1453,13 +1453,18 @@ const LONG_ACTIONS = Object.freeze([
|
|
|
1453
1453
|
"fixture-long-action-tags"
|
|
1454
1454
|
]);
|
|
1455
1455
|
const LONG_MENU_ONLY = Object.freeze(["fixture-long-action-delete", "fixture-long-action-tooling"]);
|
|
1456
|
-
// A title as wide as two of the long actions page's actions at 1280 px:
|
|
1456
|
+
// A title as wide as two of the long actions page's actions at 1280 px: wider than a large bar leaves it beside them
|
|
1457
|
+
// all, so it truncates there.
|
|
1457
1458
|
const LONG_TITLE = "Nightly backups for the billing database";
|
|
1459
|
+
// The least room an expanded or large bar leaves its page title before a page action folds, or the whole title when
|
|
1460
|
+
// that is narrower.
|
|
1461
|
+
const WIDE_TITLE_FLOOR = 200;
|
|
1458
1462
|
|
|
1459
1463
|
// The top app bar as drawn, ShellLayout's or a layout's own: whether the row that holds the page actions overflows,
|
|
1460
1464
|
// which long actions it shows, each item a person must reach (More actions and the bar's own items, by their names)
|
|
1461
1465
|
// that lies outside the window or under something else at its centre, whether the title is clipped, the room left
|
|
1462
|
-
// beside the title's text in its box, and
|
|
1466
|
+
// beside the title's text in its box, the width inside the title's box and of the title's whole text, and each shown
|
|
1467
|
+
// action's width with its margins.
|
|
1463
1468
|
function readLongActionsBar(page) {
|
|
1464
1469
|
return page.evaluate(() => {
|
|
1465
1470
|
const row = document.querySelector(".shell-page-actions-target").parentElement;
|
|
@@ -1487,6 +1492,8 @@ function readLongActionsBar(page) {
|
|
|
1487
1492
|
titleClipped: title.scrollWidth > title.clientWidth + 1,
|
|
1488
1493
|
slack: titleBox.clientWidth - Number.parseFloat(style.paddingInlineStart) -
|
|
1489
1494
|
Number.parseFloat(style.paddingInlineEnd) - text.getBoundingClientRect().width,
|
|
1495
|
+
titleBox: titleBox.clientWidth - Number.parseFloat(style.paddingInlineStart) - Number.parseFloat(style.paddingInlineEnd),
|
|
1496
|
+
wholeTitle: Math.max(title.scrollWidth, text.getBoundingClientRect().width),
|
|
1490
1497
|
widths: Object.fromEntries(actions.map((element) => {
|
|
1491
1498
|
const margins = window.getComputedStyle(element);
|
|
1492
1499
|
return [element.dataset.testid, element.getBoundingClientRect().width +
|
|
@@ -1526,6 +1533,33 @@ async function foldedByWidth(page, { bar, widths, at }) {
|
|
|
1526
1533
|
return folded;
|
|
1527
1534
|
}
|
|
1528
1535
|
|
|
1536
|
+
// What an expanded or large bar shows beside its title: nothing past the bar, every item a person must reach on screen
|
|
1537
|
+
// and on top; the first actions in bar order inline and the rest in More actions before the menu's own; the title's box
|
|
1538
|
+
// at least its floor (WIDE_TITLE_FLOOR, or the whole title when narrower), and as few folded as leave it that, so the
|
|
1539
|
+
// first folded action would have taken it under its floor, give or take the pixel the bar rounds to. A title wider than
|
|
1540
|
+
// its box truncates. Returns the folded actions.
|
|
1541
|
+
async function foldedBesideTitle(page, { bar, widths, at }) {
|
|
1542
|
+
const floor = Math.min(bar.wholeTitle, WIDE_TITLE_FLOOR);
|
|
1543
|
+
const folded = LONG_ACTIONS.slice(bar.inBar.length);
|
|
1544
|
+
const drawn = `${at}: ${JSON.stringify({ inBar: bar.inBar, titleBox: bar.titleBox, wholeTitle: bar.wholeTitle, widths })}`;
|
|
1545
|
+
assert.deepEqual({
|
|
1546
|
+
overflows: bar.overflows,
|
|
1547
|
+
unreachable: bar.unreachable,
|
|
1548
|
+
inBar: bar.inBar,
|
|
1549
|
+
titleKeepsItsFloor: bar.titleBox >= floor - 1
|
|
1550
|
+
}, {
|
|
1551
|
+
overflows: false,
|
|
1552
|
+
unreachable: [],
|
|
1553
|
+
inBar: LONG_ACTIONS.slice(0, bar.inBar.length),
|
|
1554
|
+
titleKeepsItsFloor: true
|
|
1555
|
+
}, drawn);
|
|
1556
|
+
assert.deepEqual(await readLongActionsMenu(page), [...folded, ...LONG_MENU_ONLY], `${at}: More actions holds the rest, in bar order`);
|
|
1557
|
+
if (folded.length > 0) {
|
|
1558
|
+
assert.ok(bar.titleBox - widths[folded[0]] < floor + 1, `${drawn}: ${folded[0]} folded, though the title kept its floor beside it`);
|
|
1559
|
+
}
|
|
1560
|
+
return folded;
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1529
1563
|
// A long action in the bar, not its item in More actions, which a menu that keeps its content mounted has too.
|
|
1530
1564
|
function barAction(page, testId) {
|
|
1531
1565
|
return page.locator(".shell-page-actions-target").getByTestId(testId);
|
|
@@ -1579,7 +1613,10 @@ test("a layout's own top app bar folds the page actions it has no room for the s
|
|
|
1579
1613
|
await checkMediumFold(browser, t, { baseURL: vite.baseURL, path: "/home/studio-actions" });
|
|
1580
1614
|
});
|
|
1581
1615
|
|
|
1582
|
-
|
|
1616
|
+
// An expanded or large bar has room for its page actions: a long title truncates before any of them folds, and they
|
|
1617
|
+
// fold, the last first, only when the title would have less than its floor beside them. Control's support case page
|
|
1618
|
+
// (28 Nov) folded its one action, Close the case, at 1280 px beside a 1356 px subject that was truncated anyway.
|
|
1619
|
+
test("an expanded or large window's bar keeps its page actions beside a long title, which truncates, and folds them, the last first, only to leave the title its floor", {
|
|
1583
1620
|
skip: RUN_BROWSER_TEST ? false : "set JSKIT_SHELL_WEB_BROWSER_INTEGRATION=1",
|
|
1584
1621
|
timeout: 90_000
|
|
1585
1622
|
}, async (t) => {
|
|
@@ -1595,8 +1632,15 @@ test("an expanded window's bar keeps every page action that fits beside the titl
|
|
|
1595
1632
|
await page.goto(`/home/long-actions?topRight=3&title=${encodeURIComponent(LONG_TITLE)}`);
|
|
1596
1633
|
await expect(page.getByTestId("jskit-shell-page-title")).toHaveText(LONG_TITLE);
|
|
1597
1634
|
const long = await readLongActionsBar(page);
|
|
1598
|
-
|
|
1599
|
-
assert.
|
|
1635
|
+
assert.deepEqual(await foldedBesideTitle(page, { bar: long, widths: ordinary.widths, at: "1280px, a long title" }), []);
|
|
1636
|
+
assert.equal(long.titleClipped, true, "1280px, a long title: the title truncates beside every action");
|
|
1637
|
+
|
|
1638
|
+
await page.setViewportSize({ width: 900, height: 900 });
|
|
1639
|
+
await expect(page.getByTestId("jskit-shell-app-bar")).toHaveAttribute("data-size-class", "expanded");
|
|
1640
|
+
await expect(barAction(page, "fixture-long-action-tags")).toHaveCount(0);
|
|
1641
|
+
const narrow = await readLongActionsBar(page);
|
|
1642
|
+
const folded = await foldedBesideTitle(page, { bar: narrow, widths: ordinary.widths, at: "900px, a long title" });
|
|
1643
|
+
assert.ok(folded.length > 0 && narrow.inBar.length > 0, `900px, a long title: some actions fold and some stay (${narrow.inBar.join(", ")})`);
|
|
1600
1644
|
});
|
|
1601
1645
|
|
|
1602
1646
|
test("a nested component's title gives the page's own title back, and Save returns to the list with its query", {
|