fix: render legacy metadata icon names locally (#728)
This commit is contained in:
22 files changed
+5012
-25
No files matched your search
@@ -6,9 +6,9 @@ real-backend acceptance coverage (QRun-IO/qqq#649). See `tests/acceptance/README
|
||||
|
||||
Rows: 394. Required rows passing in the recorded runs: 391.
|
||||
|
||||
Recorded runs: `/Users/james.maes/Git.Local/QRunIO/qqq-frontend-next/test-results/visual-review/pivot-clear-full-chromium/gate.json` (2026-09-30T17:24:24.424Z).
|
||||
Recorded runs: `test-results/acceptance/gate.json` (2026-09-30T19:05:47.175Z).
|
||||
|
||||
Local RC5 candidate source fbe9d148ecd099b1970fe228dd7cec766a7f0f55; backend e0d57dd31b979b17215370546ef4e26cd8a38d21. Default Turbopack static export; node scripts/acceptance.mjs --skip-build, Chromium: 587 passed, zero failures/skips/flaky results/report errors, all 391 required rows passed. Three approved external-service exclusions remain. RC4 remains latest published; RC5 publication and hosted verification of this updated candidate are pending. Earlier browser failures remain open. Full compatibility and whole-product visual approval are not established; final 1.0 remains held for owner testing and approval.
|
||||
Local unpublished icon follow-up on ac22946, backend e0d57dd31b979b17215370546ef4e26cd8a38d21. Command: QQQ_ACCEPTANCE_BROWSERS=chromium node scripts/acceptance.mjs --skip-build (isolated port 18842). 589 tests passed; zero failures, skips, flaky outcomes or report errors. Three approved external-service exclusions remain. This does not establish other-browser or whole-product visual approval.
|
||||
|
||||
## Navigation, application structure, branding and icons
|
||||
|
||||
@@ -403,7 +403,7 @@ Local RC5 candidate source fbe9d148ecd099b1970fe228dd7cec766a7f0f55; backend e0d
|
||||
| WID-054 | widget permissions: a denied widget is absent from metadata, not rendered and not requested; the API denies it | admin sees it | noPets: no card, no request, GET /widget 403, renderer not called | tests/acceptance/fixture/WidgetsFixtures.java widgetPermissions/accDenied (pet.accDenied.hasAccess) with the noPets persona | pass (chromium) | |
|
||||
| WID-055 | parent widget TABS layout switches tabs and remembers the selected tab | tab click, arrow keys, stored tab restored after reload | | tests/acceptance/fixture/WidgetsFixtures.java widgetParents/accParentTabs | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) [#666](https://github.com/QRun-IO/qqq/issues/666) |
|
||||
| WID-056 | parent widget skips denied and unknown children without requests | allowed children render | noPets: denied child absent and not requested; unknown child skipped | tests/acceptance/fixture/WidgetsFixtures.java widgetParents/accParentDenied, accParentMissing | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) |
|
||||
| WID-057 | composite renders every block type with its values and styles | TEXT, BIG_NUMBER, UP_OR_DOWN_NUMBER, NUMBER_ICON_BADGE, ICON, TABLE_SUB_ROW_DETAIL_ROW, PROGRESS_BAR, DIVIDER, IMAGE, AUDIO, INPUT_FIELD, BUTTON | | tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocks | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) |
|
||||
| WID-057 | composite renders every block type with its values and styles | TEXT, BIG_NUMBER, UP_OR_DOWN_NUMBER, NUMBER_ICON_BADGE, ICON, TABLE_SUB_ROW_DETAIL_ROW, PROGRESS_BAR, DIVIDER, IMAGE, AUDIO, INPUT_FIELD, BUTTON; Unmapped legacy icon names render local glyphs in light/dark desktop/mobile modes; metadata navigation and main tiles preserve color, sizing, existing Lucide mappings and same-origin font delivery | | tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocks and accLegacyIcons | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) |
|
||||
| WID-058 | composite layouts and slot links/tooltips | FLEX_COLUMN, FLEX_ROW, BADGES_WRAPPER, TABLE_SUB_ROW_DETAILS, FLEX_ROW_SPACE_BETWEEN, FLEX_ROW_CENTER, FLEX_ROW_WRAPPED; link to /app/person with tooltip | | tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocks | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) |
|
||||
| WID-059 | unsupported block type shows a contained warning | Unsupported block type: OWNED_UNKNOWN; neighbor healthy | | tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocksUnknown | pass (chromium) | [#550](https://github.com/QRun-IO/qqq/issues/550) |
|
||||
| WID-060 | record-view section widgets receive the record context (id, tableName) | record 1 and 2 show their own values | renderer enforces the user's table read | tests/acceptance/fixture/WidgetsFixtures.java accWidgetHost sections accHostHtml, accHostFieldValues | pass (chromium) | |
|
||||
|
||||
@@ -797,7 +797,7 @@ Dashboard and record-view widgets: widget types, dashboard layout and data flow,
|
||||
| AUDIO (path, autoPlay, showControls) | material:src/qqq/components/widgets/blocks/AudioBlock.tsx:33-39 | src/components/widgets/blocks/QqqBlocks.tsx:AudioBlock | WID-057 | Done: autoPlay is not asserted |
|
||||
| IMAGE (path, alt, width, height, bordered) | material:src/qqq/components/widgets/blocks/ImageBlock.tsx:33-58 | src/components/widgets/blocks/QqqBlocks.tsx:ImageBlock | WID-057 | Done: Only width is asserted |
|
||||
| ICON (name, color, fontSize) | material:src/qqq/components/widgets/blocks/IconBlock.tsx:32-40 | src/components/widgets/blocks/QqqBlocks.tsx:IconBlock | WID-057 | Done |
|
||||
| Any Material icon name renders (MUI ligature) in blocks, multiStatistics, fieldValueList | material:src/qqq/components/widgets/blocks/IconBlock.tsx:37; material:src/qqq/components/widgets/statistics/MultiStatisticsCard.tsx:89; material:src/qqq/components/widgets/misc/FieldValueListWidget.tsx:90 | src/components/widgets/WidgetIcon.tsx:widgetGlyph; src/lib/utils/material-icons.ts | WID-057, WID-012, WID-005 (mapped names only) | Partial: widget and shared metadata maps are used; unsupported ligature names still fall back to a circle; #728 |
|
||||
| Any Material icon name renders (MUI ligature) in blocks, multiStatistics, fieldValueList | material:src/qqq/components/widgets/blocks/IconBlock.tsx:37; material:src/qqq/components/widgets/statistics/MultiStatisticsCard.tsx:89; material:src/qqq/components/widgets/misc/FieldValueListWidget.tsx:90 | src/components/widgets/WidgetIcon.tsx; src/components/ui/LegacyMaterialIcon.tsx; src/lib/utils/legacy-material-icons.ts | WID-057, WID-012, WID-005 | Partial pending integration: unpublished follow-up retains existing Lucide mappings and supplies the pinned 2,234-name legacy inventory through a local font. Six formerly unmapped names plus navigation and main-tile glyphs pass focused light/dark desktop/mobile checks; Full local Chromium verification passed 589 tests and all 391 required rows; the packaged development JAR passed four light/dark desktop/mobile workflows. Publication remains pending. Unknown names retain fallbacks; distinct font variants and arbitrary Material Symbols names are not claimed. RC5 retains the prior limitation; #728 |
|
||||
|
||||
### F. Statistics, stepper, fieldValueList, usaMap
|
||||
|
||||
|
||||
@@ -493,3 +493,10 @@ All **1,621 unique images** in the six canonical per-profile manifests are now a
|
||||
Verification: **1,857 unit tests**, 41 focused widget tests, 10 real-backend child-list scenarios across five profiles, production export/types/lint/license/diff checks and 1038.4KB/1050KB bundle budget pass. Final browser checks verify one header export aligned with Reload, CSV contents against independent SQL, exclusion of the undisplayed third row, record navigation and empty lists. Desktop and phone captures were directly inspected: the extra toolbar row is gone. The first geometry check compared title and button centers and failed on touch because native targets are 44px and the header uses items-start; the final assertion requires Export inside the header and aligned with Reload. Failed evidence is retained; no CSS or target size was changed to pass it. Independent review has no remaining blocker. Logs use `child-export-*`; final evidence is `child-export-final-evidence` in the ignored root directory.
|
||||
|
||||
Inventory completion is **not** whole-product visual approval. Fifty-two gallery/table images repeat near-top content and cannot establish lower-page coverage. Six original choice-open states are unsupported. Most historical images lack build fingerprints; dark widget coverage only includes sample/typed-input/choice states, and developer/miscellaneous has no dark captures. Previously recorded uncaptured shell variants, report pager and provenance limitations remain. The original Next reference remains `e42ad2b2`; Material supplies behavior only. The owner preview remains unchanged while the owner validates it. Final 1.0 is explicitly held.
|
||||
|
||||
|
||||
## September 30: unpublished legacy icon compatibility follow-up
|
||||
|
||||
Existing Next Lucide mappings, widget overrides and image priority are preserved. Additional legacy names use the pinned local Material Icons inventory. Six formerly unmapped block icons, navigation and the raised main tile were checked in light/dark desktop/mobile views. Four workflows passed against the actual development JAR; its font and exported files were verified byte-for-byte. Saved desktop/mobile tile regions contain identical light/dark glyph pixels; the earlier suspected blank tile was an inspection error, and no repaint workaround was introduced.
|
||||
|
||||
The full local Chromium suite passed 589 tests and all 391 required rows, with zero failures, skips, flaky outcomes or report errors and three approved external-service exclusions. Independent code review approved the change. Evidence is retained under `test-results/visual-review/icon-compatibility-investigation/` in the original checkout. This checkpoint covers the icon change; whole-product visual approval remains open. RC5 is immutable and does not include this follow-up.
|
||||
@@ -156,7 +156,7 @@ The developer guide's [widget configuration recipes](./next-ui-developer-guide.m
|
||||
- Compare theme properties with `THEME_PROPERTY_KINDS`, including generated typography and radius keys. Keep browser-public `environmentValues` separate from build variables and backend secrets.
|
||||
- Trace dropdown behavior through `ConnectedWidget`: lists pair by position, payload names are request keys, response defaults must be offered options, and `dropdownNeedsSelectedText` gates the body. The interface's `isRequired` and `defaultValue` fields do not by themselves implement those behaviors.
|
||||
- Preserve `gridCols:sizeClass:*` overrides in widget metadata defaults. Their Material breakpoint widths differ from ordinary Tailwind defaults; explicit overrides can keep widgets side by side on smaller screens.
|
||||
- Document `table` cell helper values and `subRows`, chart dataset/URL arrays, and host-specific composite behavior when changing these families. Modal control codes work locally; process `conditional` and interpolation depend on the composite host. Unknown icon names can still fall back to a circle.
|
||||
- Document `table` cell helper values and `subRows`, chart dataset/URL arrays, and host-specific composite behavior when changing these families. Modal control codes work locally; process `conditional` and interpolation depend on the composite host. The unpublished icon follow-up preserves existing Lucide mappings, then lazily resolves valid legacy names through `LegacyMaterialIcon` and the pinned local font. Unknown names retain their fallback. Keep the codepoint inventory, font and license together; verify real JAR font delivery, both themes, existing mapped icons, image precedence, and bundle budgets before integration. Do not attribute this follow-up to RC5 or claim support for every Material Symbols name/style.
|
||||
- Check both table-scoped aliases (`/app/{table}/{process}` and `/app/{table}/{report}`) before record GET behavior. Process aliases take precedence over reports; matching names can shadow record IDs. Preserve form hash presets, record tab/view/return parameters, process selection/default inputs, and safe return-path validation.
|
||||
- Preserve the distinction between a displayed preview, a host-form draft, and persisted data. A payload example demonstrates the contract shape; it does not establish backend acceptance for every combination of options.
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ A host evaluates `conditional` as the truthiness of the named host value and int
|
||||
{"type":"composite","blocks":[{"blockTypeName":"BUTTON","values":{"label":"Details","controlCode":"showModal:details"}},{"blockTypeName":"COMPOSITE","blockId":"details","modalMode":"dialog","blocks":[{"blockTypeName":"TEXT","values":{"text":"Details appear here."}}]}]}
|
||||
```
|
||||
|
||||
See [`QqqComposite`](../../src/components/widgets/blocks/QqqComposite.tsx), [`QqqBlocks`](../../src/components/widgets/blocks/QqqBlocks.tsx), and [`BlockSlot`](../../src/components/widgets/blocks/BlockSlot.tsx). Some Material icon names still fall back to a circle; do not promise arbitrary ligature support. The parity ledger also retains open INPUT_FIELD configuration and visual review work.
|
||||
See [`QqqComposite`](../../src/components/widgets/blocks/QqqComposite.tsx), [`QqqBlocks`](../../src/components/widgets/blocks/QqqBlocks.tsx), and [`BlockSlot`](../../src/components/widgets/blocks/BlockSlot.tsx). The unpublished icon compatibility follow-up preserves existing Lucide mappings and adds a locally served glyph for valid unmapped names from the pinned 2,234-name legacy Material Icons inventory. Examples include `3d_rotation`, `account_balance_wallet`, `battery_6_bar`, and `60fps`. Unknown names retain their fallback; this does not include every Material Symbols name or distinct outlined/rounded font variants. Metadata image paths still take precedence. The font and Apache license ship with the static export/JAR; no Google Fonts request is needed at runtime. See the [font provenance](../../public/fonts/material-icons/README.md). This behavior is not in RC5. The parity ledger also retains open INPUT_FIELD configuration and visual review work.
|
||||
|
||||
## 8. Theme, branding, and customization
|
||||
|
||||
|
||||
@@ -0,0 +1,202 @@
|
||||
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
File diff suppressed because it is too large.
Load diff
Binary file not shown.
@@ -0,0 +1,11 @@
|
||||
# Legacy Material Icons fallback
|
||||
|
||||
These unmodified upstream files are distributed under the adjacent Apache-2.0 LICENSE.
|
||||
Source: https://github.com/google/material-design-icons/tree/bd8cb85bd4bad964fe6918f79665bb40c3a8efef/font
|
||||
|
||||
- MaterialIcons-Regular.ttf SHA-256: ef149f08bdd2ff09a4e2c8573476b7b0f3fbb15b623954ade59899e7175bedda
|
||||
- MaterialIcons-Regular.codepoints SHA-256: 530f25bf7b2d71c8e1da9476d53f9a9bb6b7e187bff69bb7128bb679b8194894
|
||||
|
||||
The codepoint JSON in src/lib/utils/material-icon-codepoints.json maps every line of the upstream inventory to its Unicode character. Existing Lucide mappings take precedence. This font supplies only valid names that have no existing mapping; it does not replace Next UI's icon design or use Google Fonts at runtime.
|
||||
|
||||
The inventory contains 2,235 rows and 2,234 unique names: `flourescent` appears twice with identical glyph outlines. The JSON retains the last entry for that name.
|
||||
@@ -18,7 +18,7 @@
|
||||
|
||||
import React from 'react'
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { render } from '@testing-library/react'
|
||||
import { render, waitFor } from '@testing-library/react'
|
||||
|
||||
import { MetadataIcon, SectionIcon } from './MetadataIcon'
|
||||
import { materialIconComponent, normalizeMaterialIconName } from '@/lib/utils/material-icons'
|
||||
@@ -47,6 +47,24 @@ describe('MetadataIcon', () => {
|
||||
expect(svg).toHaveAttribute('aria-hidden', 'true')
|
||||
})
|
||||
|
||||
it.each([
|
||||
['3d_rotation', '\ue84d'],
|
||||
['account_balance_wallet', '\ue850'],
|
||||
['airline_seat_flat', '\ue630'],
|
||||
['battery_6_bar', '\uebd2'],
|
||||
['filter_9_plus', '\ue3da'],
|
||||
['60fps', '\uefd4'],
|
||||
])('renders the legacy glyph for unmapped name %s', async (name, glyph) => {
|
||||
const { container } = render(<MetadataIcon icon={{ name, color: '#b91c1c' }} qqqId="test-icon" />)
|
||||
await waitFor(() => expect(container.querySelector('text')).toHaveTextContent(glyph))
|
||||
const svg = container.firstElementChild as SVGElement
|
||||
expect(svg).not.toHaveAttribute('data-qqq-icon-fallback')
|
||||
expect(svg.querySelector('text')).toHaveTextContent(glyph)
|
||||
expect(svg).toHaveAttribute('aria-hidden', 'true')
|
||||
expect(svg).toHaveAttribute('data-qqq-id', 'test-icon')
|
||||
expect((svg as SVGElement).style.color).toBe('rgb(185, 28, 28)')
|
||||
})
|
||||
|
||||
it('applies the declared color', () => {
|
||||
expect((svgOf(<MetadataIcon icon={{ name: 'folder', color: '#b91c1c' }} />) as SVGElement).style.color).toBe('rgb(185, 28, 28)')
|
||||
})
|
||||
|
||||
@@ -18,13 +18,15 @@
|
||||
* @file MetadataIcon — renders a QQQ `QIcon` (name, path, color) declared in backend metadata.
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import React, { lazy, Suspense } from 'react'
|
||||
import { FileBarChart, FolderOpen, LayoutGrid, Table2, Workflow, type LucideIcon } from 'lucide-react'
|
||||
|
||||
import type { QIcon } from '@/types'
|
||||
import { cn } from '@/lib/utils/cn'
|
||||
import { materialIconComponent, normalizeMaterialIconName } from '@/lib/utils/material-icons'
|
||||
|
||||
const LegacyMaterialIcon = lazy(() => import('@/components/ui/LegacyMaterialIcon').then((module) => ({ default: module.LegacyMaterialIcon })))
|
||||
|
||||
/** Kind of metadata object the icon belongs to; selects the fallback glyph. */
|
||||
export type MetadataIconKind = 'app' | 'table' | 'process' | 'report' | 'section'
|
||||
|
||||
@@ -55,7 +57,8 @@ export interface MetadataIconProps {
|
||||
*
|
||||
* - `icon.path` renders an `<img>` (as Material Dashboard does).
|
||||
* - `icon.name` renders the matching Lucide glyph; `icon.color` sets its color.
|
||||
* - No icon, or a name without a mapping, renders the fallback for `kind`.
|
||||
* - Valid names without a Lucide mapping use a locally served legacy glyph.
|
||||
* - No icon, or an unknown name, renders the fallback for `kind`.
|
||||
*
|
||||
* The element is decorative (`aria-hidden`); the adjacent label names the item.
|
||||
* `data-qqq-icon` carries the declared name (or `path`/`none`), and
|
||||
@@ -92,6 +95,13 @@ export function MetadataIcon({ icon, iconName, kind = 'section', className, qqqI
|
||||
'data-qqq-icon-fallback': Icon ? undefined : 'true',
|
||||
'data-qqq-id': qqqId,
|
||||
}
|
||||
if (!Icon && name) {
|
||||
return (
|
||||
<Suspense fallback={React.createElement(FALLBACK[kind], props)}>
|
||||
<LegacyMaterialIcon name={name} fallback={FALLBACK[kind]} {...props} />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
return React.createElement(Icon ?? FALLBACK[kind], props)
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright 2026 QRun.IO, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file A locally served legacy glyph inside the same scalable box used by Lucide icons.
|
||||
*/
|
||||
import React, { type SVGProps } from 'react'
|
||||
import type { LucideIcon } from 'lucide-react'
|
||||
import { legacyMaterialIconCodepoint } from '@/lib/utils/legacy-material-icons'
|
||||
|
||||
/** Props for a legacy icon whose name has already been resolved. */
|
||||
interface LegacyMaterialIconProps extends SVGProps<SVGSVGElement> {
|
||||
/** Name from backend metadata, resolved only when this module is needed. */
|
||||
name: string
|
||||
/** Existing fallback for genuinely unknown names. */
|
||||
fallback: LucideIcon
|
||||
/** Preserved for unknown metadata names and removed for valid glyphs. */
|
||||
'data-qqq-icon-fallback'?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* Preserves SVG sizing, color and CSS hooks while drawing an unmapped legacy icon.
|
||||
* The bundled font has 512 units per em, ascent 512 and descent 0, so y=24 aligns
|
||||
* its full em with the 24px view box. Numeric glyphs avoid visible ligature names.
|
||||
* @param props - Glyph and standard SVG properties.
|
||||
* @returns A decorative, scalable icon.
|
||||
*/
|
||||
export function LegacyMaterialIcon({ name, fallback, ...props }: LegacyMaterialIconProps) {
|
||||
const codepoint = legacyMaterialIconCodepoint(name)
|
||||
if (!codepoint) return React.createElement(fallback, props)
|
||||
return (
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" aria-hidden="true" focusable="false" {...props} data-qqq-icon-fallback={undefined}>
|
||||
<text x="0" y="24" className="qqq-legacy-material-glyph" fill="currentColor" stroke="none">{codepoint}</text>
|
||||
</svg>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2026 QRun.IO, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import React from 'react'
|
||||
import { render, waitFor } from '@testing-library/react'
|
||||
import { describe, expect, it } from 'vitest'
|
||||
|
||||
import { WidgetIcon, WidgetIconTile } from './WidgetIcon'
|
||||
|
||||
const examples = [
|
||||
['3d_rotation', '\ue84d'], ['account_balance_wallet', '\ue850'],
|
||||
['airline_seat_flat', '\ue630'], ['battery_6_bar', '\uebd2'],
|
||||
['filter_9_plus', '\ue3da'], ['60fps', '\uefd4'],
|
||||
]
|
||||
|
||||
describe('legacy widget glyphs', () => {
|
||||
it.each(examples)('renders the requested icon %s in blocks and tiles', async (name, glyph) => {
|
||||
const { container } = render(<><WidgetIcon name={name} color="#b91c1c" qqqId="block-icon" /><WidgetIconTile name={name} qqqId="tile-icon" /></>)
|
||||
await waitFor(() => expect(container.querySelectorAll('svg text')).toHaveLength(2))
|
||||
for (const text of container.querySelectorAll('svg text')) expect(text).toHaveTextContent(glyph)
|
||||
expect(container.querySelector('[data-qqq-id="block-icon"]')).toHaveStyle({ color: '#b91c1c' })
|
||||
expect(container.querySelector('[data-qqq-id="tile-icon"]')).toHaveAttribute('data-icon-name', name)
|
||||
expect(container.querySelectorAll('.lucide-circle')).toHaveLength(0)
|
||||
})
|
||||
|
||||
it('retains widget-specific overrides and existing shared glyphs', () => {
|
||||
const { container } = render(<><WidgetIcon name="error" /><WidgetIconTile name="person" /></>)
|
||||
expect(container.querySelector('.lucide-triangle-alert')).not.toBeNull()
|
||||
expect(container.querySelector('.lucide-user')).not.toBeNull()
|
||||
expect(container.querySelector('text')).toBeNull()
|
||||
})
|
||||
|
||||
it('keeps custom-image priority over valid font names', () => {
|
||||
const { container } = render(<WidgetIconTile name="3d_rotation" path="/custom.svg" />)
|
||||
expect(container.querySelector('img')).toHaveAttribute('src', '/custom.svg')
|
||||
expect(container.querySelector('svg')).toBeNull()
|
||||
})
|
||||
|
||||
it.each(['not_a_real_icon', '__proto__', 'constructor'])('keeps a safe generic fallback for %s', async (name) => {
|
||||
const { container } = render(<><WidgetIcon name="3d_rotation" /><WidgetIcon name={name} /><WidgetIconTile name={name} /></>)
|
||||
// A known glyph proves the shared lazy resolver has loaded, beyond its circle fallback.
|
||||
await waitFor(() => expect(container.querySelector('svg text')).toHaveTextContent('\ue84d'))
|
||||
expect(container.querySelectorAll('.lucide-circle')).toHaveLength(2)
|
||||
})
|
||||
})
|
||||
@@ -19,7 +19,7 @@
|
||||
*/
|
||||
'use client'
|
||||
|
||||
import React from 'react'
|
||||
import React, { lazy, Suspense } from 'react'
|
||||
import {
|
||||
AlertTriangle, ArrowDown, ArrowUp, BarChart3, BadgeAlert, BellPlus, Blocks, Braces, Calendar, Check,
|
||||
Circle, Clock, FileText, Info, Lock, MapPin, Package, Settings, Star, Trophy, User, Users,
|
||||
@@ -29,6 +29,8 @@ import type { LucideIcon } from 'lucide-react'
|
||||
import { materialIconComponent } from '@/lib/utils/material-icons'
|
||||
import { cn } from '@/lib/utils/cn'
|
||||
|
||||
const LegacyMaterialIcon = lazy(() => import('@/components/ui/LegacyMaterialIcon').then((module) => ({ default: module.LegacyMaterialIcon })))
|
||||
|
||||
/** Material icon names used by QQQ widgets, mapped to the closest Lucide glyph. */
|
||||
const ICONS: Record<string, LucideIcon> = {
|
||||
add_alert: BellPlus,
|
||||
@@ -74,13 +76,30 @@ interface WidgetIconProps {
|
||||
|
||||
/**
|
||||
* The glyph for a Material Icons name: the widget map first, then the shared metadata
|
||||
* icon map (any name QQQ metadata uses), else a neutral circle.
|
||||
* icon map. The renderer handles legacy font names and genuinely unknown names.
|
||||
*
|
||||
* @param name - Material Icons name.
|
||||
* @returns The Lucide glyph.
|
||||
* @returns The existing Lucide glyph, or undefined when there is no mapping.
|
||||
*/
|
||||
export function widgetGlyph(name: string): LucideIcon {
|
||||
return ICONS[name] ?? materialIconComponent(name) ?? Circle
|
||||
export function widgetGlyph(name: string): LucideIcon | undefined {
|
||||
return Object.prototype.hasOwnProperty.call(ICONS, name) ? ICONS[name] : materialIconComponent(name)
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders an existing widget glyph, a valid legacy glyph, or the unknown-name circle.
|
||||
* @param props - Backend icon name and SVG sizing properties.
|
||||
* @returns A decorative widget glyph.
|
||||
*/
|
||||
function WidgetGlyph({ name, ...props }: React.SVGProps<SVGSVGElement> & { name: string }) {
|
||||
const Glyph = widgetGlyph(name)
|
||||
if (!Glyph && name) {
|
||||
return (
|
||||
<Suspense fallback={React.createElement(Circle, props)}>
|
||||
<LegacyMaterialIcon name={name} fallback={Circle} {...props} />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
return React.createElement(Glyph ?? Circle, props)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -91,7 +110,6 @@ export function widgetGlyph(name: string): LucideIcon {
|
||||
* @returns An `aria-hidden` span wrapping the glyph.
|
||||
*/
|
||||
export function WidgetIcon({ name, color, className, qqqId, style }: WidgetIconProps) {
|
||||
const Glyph = widgetGlyph(name)
|
||||
return (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
@@ -100,7 +118,7 @@ export function WidgetIcon({ name, color, className, qqqId, style }: WidgetIconP
|
||||
data-qqq-id={qqqId}
|
||||
style={{ color, display: 'inline-flex', alignItems: 'center', ...style }}
|
||||
>
|
||||
{React.createElement(Glyph, { className: 'h-full w-full', style: { width: '1em', height: '1em' } })}
|
||||
<WidgetGlyph name={name} className="h-full w-full" style={{ width: '1em', height: '1em' }} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -144,7 +162,6 @@ export function WidgetIconTile({ name, path, color, className, filled = true, qq
|
||||
</span>
|
||||
)
|
||||
}
|
||||
const Glyph = widgetGlyph(name ?? '')
|
||||
return (
|
||||
<span
|
||||
aria-hidden="true"
|
||||
@@ -153,7 +170,7 @@ export function WidgetIconTile({ name, path, color, className, filled = true, qq
|
||||
data-qqq-id={qqqId}
|
||||
data-icon-name={name}
|
||||
>
|
||||
{React.createElement(Glyph, { style: { width: '1em', height: '1em' } })}
|
||||
<WidgetGlyph name={name ?? ''} style={{ width: '1em', height: '1em' }} />
|
||||
</span>
|
||||
)
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright 2026 QRun.IO, Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file Resolves valid legacy Material names using the pinned, locally served icon font.
|
||||
*/
|
||||
import codepoints from './material-icon-codepoints.json'
|
||||
|
||||
const CODEPOINTS: Readonly<Record<string, string>> = codepoints
|
||||
|
||||
/**
|
||||
* Finds a legacy font glyph for an icon name, including existing style suffix aliases.
|
||||
* Exact names take precedence because names such as `filter_9_plus` are actual glyphs.
|
||||
* @param name - Backend-provided Material Icons name.
|
||||
* @returns The Unicode glyph, or undefined for an unknown name.
|
||||
*/
|
||||
export function legacyMaterialIconCodepoint(name: string | undefined | null): string | undefined {
|
||||
if (!name) return undefined
|
||||
const normalized = name.trim().toLowerCase()
|
||||
if (Object.prototype.hasOwnProperty.call(CODEPOINTS, normalized)) return CODEPOINTS[normalized]
|
||||
const base = normalized.replace(/_(outline|outlined|rounded|sharp|two_tone|icon)$/, '')
|
||||
return Object.prototype.hasOwnProperty.call(CODEPOINTS, base) ? CODEPOINTS[base] : undefined
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -312,9 +312,9 @@ const VARIANT_SUFFIX = /_(outline|outlined|rounded|sharp|two_tone|icon)$/
|
||||
*/
|
||||
export function normalizeMaterialIconName(name: string): string {
|
||||
const trimmed = name.trim().toLowerCase()
|
||||
if (MATERIAL_TO_LUCIDE[trimmed]) return trimmed
|
||||
if (Object.prototype.hasOwnProperty.call(MATERIAL_TO_LUCIDE, trimmed)) return trimmed
|
||||
const base = trimmed.replace(VARIANT_SUFFIX, '')
|
||||
return MATERIAL_TO_LUCIDE[base] ? base : trimmed
|
||||
return Object.prototype.hasOwnProperty.call(MATERIAL_TO_LUCIDE, base) ? base : trimmed
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -325,5 +325,6 @@ export function normalizeMaterialIconName(name: string): string {
|
||||
*/
|
||||
export function materialIconComponent(name: string | undefined | null): LucideIcon | undefined {
|
||||
if (!name) return undefined
|
||||
return MATERIAL_TO_LUCIDE[normalizeMaterialIconName(name)]
|
||||
const normalized = normalizeMaterialIconName(name)
|
||||
return Object.prototype.hasOwnProperty.call(MATERIAL_TO_LUCIDE, normalized) ? MATERIAL_TO_LUCIDE[normalized] : undefined
|
||||
}
|
||||
@@ -238,3 +238,22 @@
|
||||
color: CanvasText;
|
||||
}
|
||||
}
|
||||
|
||||
/* Legacy names absent from the Lucide map. Loaded only when a legacy glyph is used. */
|
||||
@font-face {
|
||||
font-family: 'QQQ Legacy Material Icons';
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
font-display: block;
|
||||
src: url('/fonts/material-icons/MaterialIcons-Regular.ttf') format('truetype');
|
||||
}
|
||||
|
||||
.qqq-legacy-material-glyph {
|
||||
font-family: 'QQQ Legacy Material Icons';
|
||||
font-size: 24px;
|
||||
font-style: normal;
|
||||
font-weight: 400;
|
||||
letter-spacing: normal;
|
||||
text-transform: none;
|
||||
direction: ltr;
|
||||
}
|
||||
@@ -487,8 +487,9 @@ final class WidgetsFixtures
|
||||
add(qInstance, widget("accBlocks", WidgetType.COMPOSITE, "Owned Blocks").withGridColumns(12));
|
||||
add(qInstance, widget("accBlocksUnknown", WidgetType.COMPOSITE, "Owned Unknown Block").withGridColumns(6));
|
||||
add(qInstance, widget("accLeafBlock", WidgetType.COMPOSITE, "Owned Leaf Block").withGridColumns(6));
|
||||
add(qInstance, widget("accLegacyIcons", WidgetType.COMPOSITE, "Owned Legacy Icons").withGridColumns(12).withIcon("account_balance_wallet"));
|
||||
qInstance.addApp(new QAppMetaData().withName(BLOCKS_APP).withLabel("Widget Blocks").withIcon(new QIcon("view_quilt"))
|
||||
.withWidgets(List.of("accBlocks", "accBlocksUnknown", "accLeafBlock", "accHealthy")));
|
||||
.withWidgets(List.of("accBlocks", "accBlocksUnknown", "accLeafBlock", "accHealthy", "accLegacyIcons")));
|
||||
}
|
||||
|
||||
|
||||
@@ -1067,6 +1068,7 @@ final class WidgetsFixtures
|
||||
yield (parent);
|
||||
}
|
||||
case "accBlocks" -> allBlocks();
|
||||
case "accLegacyIcons" -> legacyIcons();
|
||||
case "accBlocksUnknown" -> new CompositeWidgetData().withBlock(new BigNumberBlockData()
|
||||
{
|
||||
/*******************************************************************************
|
||||
@@ -1232,6 +1234,24 @@ final class WidgetsFixtures
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Valid legacy names absent from the Next Lucide map, supplied by real metadata.
|
||||
*******************************************************************************/
|
||||
private static CompositeWidgetData legacyIcons()
|
||||
{
|
||||
CompositeWidgetData data = new CompositeWidgetData().withLayout(CompositeWidgetData.Layout.FLEX_COLUMN);
|
||||
for(String name : List.of("3d_rotation", "account_balance_wallet", "airline_seat_flat", "battery_6_bar", "filter_9_plus", "60fps"))
|
||||
{
|
||||
data.addBlock(new CompositeWidgetData().withLayout(CompositeWidgetData.Layout.FLEX_ROW)
|
||||
.withBlock(new IconBlockData().withBlockId("legacy-" + name).withValues(new IconValues().withName(name))
|
||||
.withStyles(new IconStyles().withColor("#2563eb").withFontSize("24px")))
|
||||
.withBlock(new TextBlockData().withValues(new TextValues().withText(name))));
|
||||
}
|
||||
return (data);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
** Every canonical block type, arranged in every composite layout.
|
||||
*******************************************************************************/
|
||||
|
||||
@@ -1016,9 +1016,10 @@
|
||||
"qqq-frontend-material-dashboard/src/qqq/components/widgets/WidgetBlock.tsx",
|
||||
"qqq-backend-core/src/main/java/com/kingsrook/qqq/backend/core/model/dashboard/widgets/blocks/"
|
||||
],
|
||||
"fixture": "tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocks",
|
||||
"fixture": "tests/acceptance/fixture/WidgetsFixtures.java widgetBlocks/accBlocks and accLegacyIcons",
|
||||
"scenarios": [
|
||||
"TEXT, BIG_NUMBER, UP_OR_DOWN_NUMBER, NUMBER_ICON_BADGE, ICON, TABLE_SUB_ROW_DETAIL_ROW, PROGRESS_BAR, DIVIDER, IMAGE, AUDIO, INPUT_FIELD, BUTTON"
|
||||
"TEXT, BIG_NUMBER, UP_OR_DOWN_NUMBER, NUMBER_ICON_BADGE, ICON, TABLE_SUB_ROW_DETAIL_ROW, PROGRESS_BAR, DIVIDER, IMAGE, AUDIO, INPUT_FIELD, BUTTON",
|
||||
"Unmapped legacy icon names render local glyphs in light/dark desktop/mobile modes; metadata navigation and main tiles preserve color, sizing, existing Lucide mappings and same-origin font delivery"
|
||||
],
|
||||
"negative": [],
|
||||
"issues": [
|
||||
|
||||
@@ -76,10 +76,16 @@ test('[REC-062] inline possible values search locally, render chip options and p
|
||||
await expect(priority).toHaveText(/^Medium/)
|
||||
await priority.click()
|
||||
const list = page.getByRole('listbox', { name: 'Priority options' })
|
||||
await expect(list.getByRole('option')).toHaveText(['Low', 'Medium', 'High', 'Locked'])
|
||||
const options = list.getByRole('option')
|
||||
await expect(options).toHaveCount(4)
|
||||
// Decorative font glyphs are DOM text, but must not enter the option's accessible name.
|
||||
for (const [index, label] of ['Low', 'Medium', 'High', 'Locked'].entries()) {
|
||||
await expect(options.nth(index)).toHaveAccessibleName(label)
|
||||
}
|
||||
const highChip = list.getByRole('option', { name: 'High' }).locator('[data-chip-color]')
|
||||
await expect(highChip).toHaveAttribute('data-chip-color', 'error')
|
||||
await expect(highChip).toHaveAttribute('data-chip-icon', 'warning')
|
||||
await expect(highChip.locator('svg')).toHaveAttribute('aria-hidden', 'true')
|
||||
const search = page.getByRole('textbox', { name: 'Search Priority options' })
|
||||
await search.fill('lo')
|
||||
await expect(list.getByRole('option')).toHaveText(['Low', 'Locked'])
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* Copyright 2026 QRun.IO, Inc.
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0
|
||||
*/
|
||||
|
||||
import { createHash } from 'node:crypto'
|
||||
import { expect, open, test } from '../../support/fixtures'
|
||||
import { appNavigation } from '../navigation/nav-helpers'
|
||||
import { expectLoaded, widget } from './widget-support'
|
||||
|
||||
const glyphs = [
|
||||
['3d_rotation', '\ue84d'], ['account_balance_wallet', '\ue850'],
|
||||
['airline_seat_flat', '\ue630'], ['battery_6_bar', '\uebd2'],
|
||||
['filter_9_plus', '\ue3da'], ['60fps', '\uefd4'],
|
||||
]
|
||||
|
||||
for (const mode of ['light', 'dark']) {
|
||||
test(`[WID-057] legacy icon names render actual local glyphs in ${mode} mode @mobile`, async ({ page, backend, diagnostics }, testInfo) => {
|
||||
void diagnostics
|
||||
await page.addInitScript(dark => localStorage.setItem('qqq-dark-mode', String(dark)), mode === 'dark')
|
||||
await open(page, '/app/widgetBlocks')
|
||||
await expectLoaded(page, 'accLegacyIcons')
|
||||
await expect(page.locator('html')).toHaveClass(mode === 'dark' ? /dark/ : /^(?!.*\bdark\b)/)
|
||||
const card = widget(page, 'accLegacyIcons')
|
||||
for (const [name, glyph] of glyphs) {
|
||||
const icon = card.locator(`[data-block-id="legacy-${name}"] [data-icon-name="${name}"]`)
|
||||
await expect(icon.locator('svg text')).toHaveText(glyph)
|
||||
await expect(icon).toHaveCSS('color', 'rgb(37, 99, 235)')
|
||||
await expect(icon.locator('.lucide-circle')).toHaveCount(0)
|
||||
await expect(icon).toHaveAttribute('aria-hidden', 'true')
|
||||
const metrics = await icon.locator('svg').evaluate(svg => ({ width: svg.getBoundingClientRect().width, height: svg.getBoundingClientRect().height }))
|
||||
expect(metrics).toEqual({ width: 24, height: 24 })
|
||||
}
|
||||
const tile = card.locator('[data-qqq-id="widget-main-icon-accLegacyIcons"]')
|
||||
await expect(tile.locator('svg text')).toHaveText('\ue850')
|
||||
await expect(tile.locator('svg text')).toHaveCSS('fill', 'rgb(255, 255, 255)')
|
||||
await expect(page.locator('[data-block-type="ICON"] [data-icon-name="star"] svg')).toHaveClass(/lucide-star/)
|
||||
|
||||
const nav = await appNavigation(page)
|
||||
const navIcon = nav.locator('[data-qqq-id="sidebar-item-widgetBlocks"] svg')
|
||||
await expect(navIcon).toHaveAttribute('data-qqq-icon', 'view_quilt')
|
||||
await expect(navIcon.locator('text')).toHaveText('\ue8f1')
|
||||
await expect(navIcon).not.toHaveAttribute('data-qqq-icon-fallback')
|
||||
await expect(nav.locator('[data-qqq-id="sidebar-collapse-peopleApp"] svg')).toHaveClass(/lucide-user/)
|
||||
// The real server must serve the exact pinned font, and CSP must permit its use.
|
||||
const font = await backend.api.get('/fonts/material-icons/MaterialIcons-Regular.ttf')
|
||||
expect(font.status()).toBe(200)
|
||||
expect(createHash('sha256').update(await font.body()).digest('hex')).toBe('ef149f08bdd2ff09a4e2c8573476b7b0f3fbb15b623954ade59899e7175bedda')
|
||||
expect(await page.evaluate(async () => {
|
||||
await document.fonts.ready
|
||||
return document.fonts.check('24px "QQQ Legacy Material Icons"')
|
||||
})).toBe(true)
|
||||
await expect.poll(() => page.evaluate(() => performance.getEntriesByType('resource').some(entry => new URL(entry.name).pathname === '/fonts/material-icons/MaterialIcons-Regular.ttf'))).toBe(true)
|
||||
// Close the mobile drawer before retaining the actual widget appearance.
|
||||
if (await page.getByRole('button', { name: 'Close navigation', exact: true }).isVisible()) await page.getByRole('button', { name: 'Close navigation', exact: true }).click()
|
||||
await card.evaluate(node => node.scrollIntoView({ block: 'center' }))
|
||||
await testInfo.attach(`legacy-icons-${mode}`, { body: await page.screenshot(), contentType: 'image/png' })
|
||||
})
|
||||
}
|
||||
Reference in new issue
Block a user