@truenas/ui-components 0.7.2 → 0.7.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenas/ui-components",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -929,6 +929,43 @@ tn-dialog-shell {
929
929
  line-height: 1.5;
930
930
  color: var(--tn-fg1, #000000);
931
931
  flex: 1; /* Take up remaining space */
932
+ /*
933
+ A title as long as a ZFS path has to WRAP, and `flex: 1` alone does not let
934
+ it (NAS-142530). A flex item's `min-width` defaults to `auto`, which floors
935
+ it at the widest unbreakable run of text inside it — for webui's delete-zvol
936
+ dialog, `dozer/TEST_ANOTHER_ZVOL_WITH_A_LONG_NAME` measures 613px against
937
+ the 320px the 400px-wide dialog's header can give it. The heading kept its
938
+ 613px, and the header and `.tn-dialog-panel` with it.
939
+
940
+ That overflow is not the harmless kind. `.tn-dialog-panel` sets
941
+ `overflow: hidden`, which clips but stays SCROLLABLE programmatically, and
942
+ the shell's close button — the first tabbable element in the dialog — is the
943
+ one CDK's `autoFocus` focuses on open. The browser scrolled it into view, so
944
+ every dialog with a long title opened at `scrollLeft: 277` with its whole
945
+ left edge cut off: heading, body copy, fields and footer buttons all sliced
946
+ down the same line. Tabbing to a control near the left edge scrolled it back
947
+ and the dialog abruptly looked correct, which is how the bug was reported.
948
+
949
+ `anywhere` and not `break-word`, which is the difference between one
950
+ declaration and two: `anywhere` contributes its break opportunities to
951
+ MIN-CONTENT sizing, so the `auto` floor lands at the widest character rather
952
+ than the widest word and the heading is free to shrink. `break-word` does
953
+ not, and leaves the floor at 613px — where the word already fits its own
954
+ line and there is nothing to wrap — so it needs an explicit `min-width: 0`
955
+ beside it to reach the same place. Neither touches max-content, so a dialog
956
+ opened without an explicit width still sizes itself to its title as before.
957
+
958
+ Measured on that dialog at 400px, `scrollWidth` / `scrollLeft` after
959
+ focusing close:
960
+ none 677 / 277 the reported bug
961
+ break-word 677 / 277 nothing breaks (see above)
962
+ min-width: 0 629 / 0 heading shrinks, but its unbroken
963
+ word still spills out of the
964
+ heading box and across the ✕
965
+ min-width: 0 + break-word 400 / 0
966
+ anywhere 400 / 0 what ships
967
+ */
968
+ overflow-wrap: anywhere;
932
969
  }
933
970
 
934
971
  /* Close button */
@@ -988,6 +1025,19 @@ tn-dialog-shell {
988
1025
  overflow-x: hidden;
989
1026
  box-sizing: border-box;
990
1027
  padding: var(--tn-content-padding, 16px);
1028
+ /*
1029
+ The body's half of NAS-142530, and a quieter failure than the heading's: the
1030
+ same dataset paths appear in the copy under the title, and `overflow-x:
1031
+ hidden` means a path too long for the dialog is simply CUT OFF mid-name with
1032
+ nothing on screen to say so — no scrollbar, no ellipsis. Unlike the header
1033
+ this never reached `.tn-dialog-panel` (a scroll container contains its own
1034
+ overflow), so it cost no layout, only the end of the name the dialog is
1035
+ asking the user to confirm.
1036
+
1037
+ `overflow-wrap` rather than `word-break: break-all`: it only breaks a word
1038
+ that cannot fit a line on its own, so ordinary prose wraps exactly as before.
1039
+ */
1040
+ overflow-wrap: break-word;
991
1041
  }
992
1042
 
993
1043
  /* Dialog actions */