Spaces:
Sleeping
Sleeping
Deploy Patch Testing Co-worker
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .claude/skills/frontend-design/LICENSE.txt +177 -0
- .claude/skills/frontend-design/SKILL.md +71 -0
- .claude/skills/frontend-design/SOURCE.md +3 -0
- docs/design/UI-REDESIGN.md +14 -0
- docs/design/UI-SIMPLIFY.md +408 -0
- web/src/agents.test.ts +2 -2
- web/src/agents.ts +2 -2
- web/src/chat/ChatCards.tsx +1 -1
- web/src/chat/ChatDock.tsx +1 -1
- web/src/components/GraphView.tsx +1 -1
- web/src/components/common.tsx +20 -9
- web/src/components/components.test.tsx +2 -2
- web/src/components/shell/AppSidebar.tsx +7 -10
- web/src/components/shell/EnvSwitcher.tsx +4 -5
- web/src/components/shell/RunListItem.tsx +11 -8
- web/src/components/shell/TopBar.tsx +1 -2
- web/src/components/shell/cockpit.tsx +12 -73
- web/src/components/shell/panelTabs.tsx +26 -21
- web/src/components/shell/shell.test.tsx +2 -2
- web/src/main.tsx +0 -1
- web/src/pages/AdminPages.tsx +19 -73
- web/src/pages/AgentTeamPage.tsx +7 -7
- web/src/pages/AssistantPage.tsx +9 -7
- web/src/pages/FailureReview.tsx +6 -8
- web/src/pages/LibraryPages.tsx +89 -52
- web/src/pages/LiveView.tsx +3 -3
- web/src/pages/LoginPage.tsx +2 -2
- web/src/pages/PasswordPages.tsx +5 -5
- web/src/pages/PodsPage.tsx +42 -40
- web/src/pages/QueuesPages.tsx +19 -13
- web/src/pages/ReadinessPage.tsx +94 -39
- web/src/pages/RegisterPage.tsx +3 -3
- web/src/pages/RunCases.tsx +1 -1
- web/src/pages/RunGuide.tsx +23 -25
- web/src/pages/RunPage.tsx +5 -5
- web/src/pages/RunStage.tsx +15 -21
- web/src/pages/RunTriage.tsx +1 -1
- web/src/pages/RunWorkspace.tsx +23 -25
- web/src/pages/RunsPage.tsx +70 -38
- web/src/pages/ScenarioReview.tsx +29 -21
- web/src/pages/ScheduledRunsPage.tsx +170 -0
- web/src/pages/SettingsPage.tsx +49 -17
- web/src/pages/SignOffReport.tsx +20 -10
- web/src/pages/StartRunWizard.tsx +4 -4
- web/src/pages/TeamBoard.tsx +20 -21
- web/src/pages/mustfix.test.tsx +52 -0
- web/src/pages/review3.test.tsx +1 -1
- web/src/pages/step4.test.tsx +1 -1
- web/src/pages/step5.test.tsx +34 -20
- web/src/pages/step67.test.tsx +76 -0
.claude/skills/frontend-design/LICENSE.txt
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
Apache License
|
| 3 |
+
Version 2.0, January 2004
|
| 4 |
+
http://www.apache.org/licenses/
|
| 5 |
+
|
| 6 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 7 |
+
|
| 8 |
+
1. Definitions.
|
| 9 |
+
|
| 10 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 11 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 12 |
+
|
| 13 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 14 |
+
the copyright owner that is granting the License.
|
| 15 |
+
|
| 16 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 17 |
+
other entities that control, are controlled by, or are under common
|
| 18 |
+
control with that entity. For the purposes of this definition,
|
| 19 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 20 |
+
direction or management of such entity, whether by contract or
|
| 21 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 22 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 23 |
+
|
| 24 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 25 |
+
exercising permissions granted by this License.
|
| 26 |
+
|
| 27 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 28 |
+
including but not limited to software source code, documentation
|
| 29 |
+
source, and configuration files.
|
| 30 |
+
|
| 31 |
+
"Object" form shall mean any form resulting from mechanical
|
| 32 |
+
transformation or translation of a Source form, including but
|
| 33 |
+
not limited to compiled object code, generated documentation,
|
| 34 |
+
and conversions to other media types.
|
| 35 |
+
|
| 36 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 37 |
+
Object form, made available under the License, as indicated by a
|
| 38 |
+
copyright notice that is included in or attached to the work
|
| 39 |
+
(an example is provided in the Appendix below).
|
| 40 |
+
|
| 41 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 42 |
+
form, that is based on (or derived from) the Work and for which the
|
| 43 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 44 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 45 |
+
of this License, Derivative Works shall not include works that remain
|
| 46 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 47 |
+
the Work and Derivative Works thereof.
|
| 48 |
+
|
| 49 |
+
"Contribution" shall mean any work of authorship, including
|
| 50 |
+
the original version of the Work and any modifications or additions
|
| 51 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 52 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 53 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 54 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 55 |
+
means any form of electronic, verbal, or written communication sent
|
| 56 |
+
to the Licensor or its representatives, including but not limited to
|
| 57 |
+
communication on electronic mailing lists, source code control systems,
|
| 58 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 59 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 60 |
+
excluding communication that is conspicuously marked or otherwise
|
| 61 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 62 |
+
|
| 63 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 64 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 65 |
+
subsequently incorporated within the Work.
|
| 66 |
+
|
| 67 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 68 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 69 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 70 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 71 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 72 |
+
Work and such Derivative Works in Source or Object form.
|
| 73 |
+
|
| 74 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 75 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 76 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 77 |
+
(except as stated in this section) patent license to make, have made,
|
| 78 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 79 |
+
where such license applies only to those patent claims licensable
|
| 80 |
+
by such Contributor that are necessarily infringed by their
|
| 81 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 82 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 83 |
+
institute patent litigation against any entity (including a
|
| 84 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 85 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 86 |
+
or contributory patent infringement, then any patent licenses
|
| 87 |
+
granted to You under this License for that Work shall terminate
|
| 88 |
+
as of the date such litigation is filed.
|
| 89 |
+
|
| 90 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 91 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 92 |
+
modifications, and in Source or Object form, provided that You
|
| 93 |
+
meet the following conditions:
|
| 94 |
+
|
| 95 |
+
(a) You must give any other recipients of the Work or
|
| 96 |
+
Derivative Works a copy of this License; and
|
| 97 |
+
|
| 98 |
+
(b) You must cause any modified files to carry prominent notices
|
| 99 |
+
stating that You changed the files; and
|
| 100 |
+
|
| 101 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 102 |
+
that You distribute, all copyright, patent, trademark, and
|
| 103 |
+
attribution notices from the Source form of the Work,
|
| 104 |
+
excluding those notices that do not pertain to any part of
|
| 105 |
+
the Derivative Works; and
|
| 106 |
+
|
| 107 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 108 |
+
distribution, then any Derivative Works that You distribute must
|
| 109 |
+
include a readable copy of the attribution notices contained
|
| 110 |
+
within such NOTICE file, excluding those notices that do not
|
| 111 |
+
pertain to any part of the Derivative Works, in at least one
|
| 112 |
+
of the following places: within a NOTICE text file distributed
|
| 113 |
+
as part of the Derivative Works; within the Source form or
|
| 114 |
+
documentation, if provided along with the Derivative Works; or,
|
| 115 |
+
within a display generated by the Derivative Works, if and
|
| 116 |
+
wherever such third-party notices normally appear. The contents
|
| 117 |
+
of the NOTICE file are for informational purposes only and
|
| 118 |
+
do not modify the License. You may add Your own attribution
|
| 119 |
+
notices within Derivative Works that You distribute, alongside
|
| 120 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 121 |
+
that such additional attribution notices cannot be construed
|
| 122 |
+
as modifying the License.
|
| 123 |
+
|
| 124 |
+
You may add Your own copyright statement to Your modifications and
|
| 125 |
+
may provide additional or different license terms and conditions
|
| 126 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 127 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 128 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 129 |
+
the conditions stated in this License.
|
| 130 |
+
|
| 131 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 132 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 133 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 134 |
+
this License, without any additional terms or conditions.
|
| 135 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 136 |
+
the terms of any separate license agreement you may have executed
|
| 137 |
+
with Licensor regarding such Contributions.
|
| 138 |
+
|
| 139 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 140 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 141 |
+
except as required for reasonable and customary use in describing the
|
| 142 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 143 |
+
|
| 144 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 145 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 146 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 147 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 148 |
+
implied, including, without limitation, any warranties or conditions
|
| 149 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 150 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 151 |
+
appropriateness of using or redistributing the Work and assume any
|
| 152 |
+
risks associated with Your exercise of permissions under this License.
|
| 153 |
+
|
| 154 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 155 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 156 |
+
unless required by applicable law (such as deliberate and grossly
|
| 157 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 158 |
+
liable to You for damages, including any direct, indirect, special,
|
| 159 |
+
incidental, or consequential damages of any character arising as a
|
| 160 |
+
result of this License or out of the use or inability to use the
|
| 161 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 162 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 163 |
+
other commercial damages or losses), even if such Contributor
|
| 164 |
+
has been advised of the possibility of such damages.
|
| 165 |
+
|
| 166 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 167 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 168 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 169 |
+
or other liability obligations and/or rights consistent with this
|
| 170 |
+
License. However, in accepting such obligations, You may act only
|
| 171 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 172 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 173 |
+
defend, and hold each Contributor harmless for any liability
|
| 174 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 175 |
+
of your accepting any such warranty or additional liability.
|
| 176 |
+
|
| 177 |
+
END OF TERMS AND CONDITIONS
|
.claude/skills/frontend-design/SKILL.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
name: frontend-design
|
| 3 |
+
description: Guidance for distinctive, intentional visual design when building new UI or reshaping an existing one. Helps with aesthetic direction, typography, and making choices that don't read as templated defaults.
|
| 4 |
+
license: Complete terms in LICENSE.txt
|
| 5 |
+
---
|
| 6 |
+
|
| 7 |
+
# Frontend Design
|
| 8 |
+
|
| 9 |
+
Approach this as the design lead at a design studio known for giving every client a distinct visual identity that is not mistaken for anyone else's. This client has already rejected proposals that felt cliché or templated, and is paying for a distinctive point of view: make deliberate, opinionated choices about palette, typography, and layout that are specific to this brief, and take aesthetic risk if justified.
|
| 10 |
+
|
| 11 |
+
## Ground your designs in the subject matter
|
| 12 |
+
|
| 13 |
+
If the brief does not identify what the product or subject matter is, identify it yourself before designing, and confirm with the client. You can come up with one concrete subject, the design's audience, and the design's primary job, as a proposal. If there's any information in your memory about the client's preferences or context about what they're building, use that as a hint. The subject's industry, subject matter, materials, and vernacular are where distinctive visual choices come from — a design for a toy for girls aged 8–11 will be very aesthetically different from a dashboard for financial analysts. Build with the brief's real content and subject matter throughout.
|
| 14 |
+
|
| 15 |
+
## Design principles
|
| 16 |
+
|
| 17 |
+
For web designs, the hero is the first thing viewers will see. Open with the most characteristic thing in the subject's world, in the form that is most appropriate: a headline, an image, an animation, a live demo, an interactive moment, or other treatments. Be deliberate with your choice: a big number with a small label, supporting stats, and a gradient accent is the default treatment, so only use it if that's truly the best option.
|
| 18 |
+
|
| 19 |
+
Typography carries the personality of the page. You don't need a different typeface for display or headline text and body content: use one family or two, and if two, make them clearly distinct.
|
| 20 |
+
|
| 21 |
+
Choose your typefaces deliberately, not the default families you would reach for on any other project, and set a clear type scale following the default guidance of The Elements of Typographic Style with intentional weights, widths, and spacing. When type is used as a headline or visual element, use the type treatment itself as an active part of the design, not a neutral delivery vehicle for the content.
|
| 22 |
+
|
| 23 |
+
Default to line lengths of less than 80 characters. Serif typefaces can have slightly longer line lengths; give serif body text slightly more line-height than a sans-serif.
|
| 24 |
+
|
| 25 |
+
Avoid these default typographic treatments; they are the commonest tells of a generated page:
|
| 26 |
+
- Accenting just a single word or phrase in a headline, like putting one word in italic/bold or a different color.
|
| 27 |
+
- Using all caps for labels.
|
| 28 |
+
- Adding unnecessary typographic labels above content.
|
| 29 |
+
|
| 30 |
+
Visual structure is information. Structural devices like outlines, borders, numbering, eyebrows, dividers, labels, etc., encode useful information about the content rather than decorate it. Many generic designs use numbered markers (01 / 02 / 03), but that's only appropriate if the content actually is a sequence — like a stepped process or a timeline. Before adding numbered markers, check the content really is a sequence.
|
| 31 |
+
|
| 32 |
+
Use non-user-triggered motion sparingly and deliberately, only to draw attention. A single orchestrated moment — one page-load sequence or one reveal — lands better than scattered effects; fade-and-slide-up entrances on each section and hover transitions on every card are the generic default and read as AI-generated. Motion that answers a person's action (opening, expanding, confirming) is welcome when it shows what changed.
|
| 33 |
+
|
| 34 |
+
Consider written content carefully. Often a design brief may not contain real content, and it's up to you to come up with copy and placeholder content. Copy can make a design feel as templated as the design itself. See the below section on writing for more guidance.
|
| 35 |
+
|
| 36 |
+
## Process: plan, review against the brief, build, critique
|
| 37 |
+
|
| 38 |
+
For calibration, AI-generated design right now clusters around some traits:
|
| 39 |
+
1. a warm cream background (near #F4F1EA) with a high-contrast serif display and a terracotta or warm-clay accent (often near #D97757 — Anthropic's own Claude-interaction accent, so on a user's brief it reads as a tell);
|
| 40 |
+
2. a near-black background with a single bright acid-green or vermilion accent;
|
| 41 |
+
3. a broadsheet-style layout with hairline rules, zero border-radius, and dense newspaper-like columns;
|
| 42 |
+
4. the SaaS-card kit: content chopped into identical rounded cards, one border-radius on everything regardless of hierarchy, the same soft grey shadow (rgba(0,0,0,.1)) under each, and gradient washes as decoration;
|
| 43 |
+
5. template chrome that appears whatever the subject: a tracked-out ALL-CAPS eyebrow label above every heading; meta strings joined with middle dots ('A · B · C'); labels built as 'WORD — fragment' with a spaced em dash; tinted near-black (#0B0B0B, #111) standing in for black; a monospace face for small data labels; a '→' appended to link and button text.
|
| 44 |
+
|
| 45 |
+
All traits are legitimate for some briefs, but they are defaults rather than choices, and they appear regardless of subject. Where the brief pins down a visual direction, follow it exactly — the brief's own words always win, including when it asks for one of these looks. Where it leaves an axis free, don't spend that freedom on one of these defaults. As with a hired human designer, there's often a careful balance between doing what you're good at and taking each project as a chance to experiment and learn.
|
| 46 |
+
|
| 47 |
+
Work in two passes. First, brainstorm a short design plan based on the client's design brief: create a compact token system with color, type, layout, and principles.
|
| 48 |
+
- Color: describe the core base palette as 4–6 named hex values.
|
| 49 |
+
- Type: the typefaces and their roles.
|
| 50 |
+
- Layout: a layout concept, using one-sentence prose descriptions and ASCII wireframes to ideate and compare. Include alignment guidance; should the content be left aligned, center aligned, justified?
|
| 51 |
+
- Principles: the high-level guidance for what makes this page unique.
|
| 52 |
+
|
| 53 |
+
Then review that plan against the brief before building: if any part of it reads like the generic default you would produce for any similar page (work through a similar prompt to see if you arrive somewhere similar) rather than a choice made for this specific brief — revise that part, say what you changed and why. Only after you've confirmed the relative uniqueness of your design plan should you start to write the code, following the revised plan.
|
| 54 |
+
|
| 55 |
+
When writing the code, be careful of structuring your CSS selector specificities. It's easy to generate CSS classes that cancel each other out (especially with a type-based selector like .section and an element-based selector like .cta). This can happen often with padding/margin between sections.
|
| 56 |
+
|
| 57 |
+
## Restraint and self-critique
|
| 58 |
+
|
| 59 |
+
Spend your boldness in one place. Let one element be the memorable thing, keep everything around it quiet and disciplined, and cut any decoration that does not serve the brief. Build to a quality floor without announcing it: responsive down to mobile, visible keyboard focus, reduced motion respected, visually accessible, harmonious color palettes. Critique your own work as you build, taking screenshots to review if your environment supports it — a picture is worth 1000 tokens. Consider Chanel's advice: before leaving the house, take a look in the mirror and remove one accessory. Human creatives have memory and always try to do something new, so if you have a space to quickly jot down notes about what you've tried, it can help you in future passes.
|
| 60 |
+
|
| 61 |
+
## More on writing in design
|
| 62 |
+
|
| 63 |
+
Words appear in a design for one reason: to make it easier to understand and use. They are design content, not decoration. Bring the same intentionality and minimalism to copywriting that you would bring to spacing and color. Before writing anything, ask what the design needs to say, and how it can best be said to help the person navigate the experience.
|
| 64 |
+
|
| 65 |
+
Write from the end user's perspective. Name things by what users will understand in simple language, not by how the system is built. A user manages notifications, not webhook config. Describe what something is or does in plain terms rather than selling it. Being specific and legible to new users is always better than being clever.
|
| 66 |
+
|
| 67 |
+
Use active voice as default. A CTA says exactly what happens when it is used: "Save changes," not "Submit." An action keeps the same name through the whole flow, so the button that says "Publish" produces a toast that says "Published." The vocabulary of an interface is the signposting for someone navigating the product. Cohesion and consistency are how people learn their way around.
|
| 68 |
+
|
| 69 |
+
Treat failure and emptiness as moments for direction, not mood. Explain what went wrong and how to fix it, in the interface's voice rather than a person's. Errors don't apologize, and they are never vague about what happened. An empty screen is an invitation to act.
|
| 70 |
+
|
| 71 |
+
Keep the tone conversational: plain verbs, sentence case, no filler, with tone matched to the brand and the audience. Let each written element do exactly one job.
|
.claude/skills/frontend-design/SOURCE.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Source
|
| 2 |
+
|
| 3 |
+
Copied unmodified from https://github.com/anthropics/skills (skills/frontend-design), Apache License 2.0 (LICENSE.txt).
|
docs/design/UI-REDESIGN.md
CHANGED
|
@@ -8,6 +8,8 @@ This is a **redesign of layout and look only**. Every current function stays ava
|
|
| 8 |
the checklist). No route is removed. No new backend endpoint is needed for steps 1 to 7. Step 8 (scheduled runs "once" / "cron",
|
| 9 |
pause, edit) needs the small backend additions listed in section 7.1, and the UI for those parts stays hidden until they exist.
|
| 10 |
|
|
|
|
|
|
|
| 11 |
Contents
|
| 12 |
|
| 13 |
0. What the current app does well and where it hurts
|
|
@@ -237,6 +239,8 @@ Phone panel sheet (opened from [panel] or from "See the failed screen"):
|
|
| 237 |
|
| 238 |
### 2.4 Sidebar spec (`AppSidebar`)
|
| 239 |
|
|
|
|
|
|
|
| 240 |
Top to bottom, 264px wide, padding 12px 10px, background `--fpt-sidebar`:
|
| 241 |
|
| 242 |
1. **Brand row** (48px): the existing `.fpt-mark` initials + product name (`useBrand`), org name small below. `data-testid="brand"` stays.
|
|
@@ -408,6 +412,8 @@ TOP BAR: Procure-to-Pay · 26C · 17 Oct 11:24 | Practice environment · Quick s
|
|
| 408 |
|
| 409 |
#### 3.1.2 Conversation content
|
| 410 |
|
|
|
|
|
|
|
| 411 |
The thread is the current `Conversation` component (AssistantPage.tsx) with these changes:
|
| 412 |
|
| 413 |
1. **Stage progress line** replaces the Mantine `Stepper` (which breaks at 390px): a 4-segment bar in the current-stage card header,
|
|
@@ -483,6 +489,8 @@ changes · Activity log · label "Engineering views (admin)" · Coverage map ·
|
|
| 483 |
|
| 484 |
### 3.2 Team board (upgrade of the Workflow tab, `/runs/:id/workflow`)
|
| 485 |
|
|
|
|
|
|
|
| 486 |
Purpose: the 15 agents as teammates of a team lead ("Coordinator"), each with live state, last action, and flags for failed or silent ones.
|
| 487 |
|
| 488 |
```
|
|
@@ -658,6 +666,8 @@ Report & sign-off
|
|
| 658 |
|
| 659 |
### 3.6 Patch readiness home ("release cockpit", `/`)
|
| 660 |
|
|
|
|
|
|
|
| 661 |
```
|
| 662 |
TOP BAR: Patch readiness [Environment: Local mock pod v] [Patch: latest v] [+ New test run]
|
| 663 |
-------------------------------------------------------------------------------------------------------
|
|
@@ -845,6 +855,8 @@ tokens below. All text pairs verified (WCAG 2.1 contrast, computed):
|
|
| 845 |
|
| 846 |
### 4.1 Colour
|
| 847 |
|
|
|
|
|
|
|
| 848 |
| Token | Light | Dark | Use / contrast |
|
| 849 |
|---|---|---|---|
|
| 850 |
| `--fpt-page` | #e9f0ee (unchanged) | #0c1110 | app background behind panels (now only visible in gaps) |
|
|
@@ -870,6 +882,8 @@ Status is never conveyed by colour alone: every dot has an icon or words next to
|
|
| 870 |
|
| 871 |
### 4.2 Type (Poppins stays; sizes nudged up for readability)
|
| 872 |
|
|
|
|
|
|
|
| 873 |
| Mantine size | Old | New | Use |
|
| 874 |
|---|---|---|---|
|
| 875 |
| `xs` | 11px | 11.5px | meta, pills |
|
|
|
|
| 8 |
the checklist). No route is removed. No new backend endpoint is needed for steps 1 to 7. Step 8 (scheduled runs "once" / "cron",
|
| 9 |
pause, edit) needs the small backend additions listed in section 7.1, and the UI for those parts stays hidden until they exist.
|
| 10 |
|
| 11 |
+
> **Amended 20 Oct 2026 by `UI-SIMPLIFY.md`** (calm palette, one accent, colour only for states, no caps labels, readiness shows the last finished verdict). Where the two disagree, `UI-SIMPLIFY.md` wins. Sections marked *Superseded* below point to it. Sections 9 and 10 are unchanged and still binding.
|
| 12 |
+
|
| 13 |
Contents
|
| 14 |
|
| 15 |
0. What the current app does well and where it hurts
|
|
|
|
| 239 |
|
| 240 |
### 2.4 Sidebar spec (`AppSidebar`)
|
| 241 |
|
| 242 |
+
> *Amended by UI-SIMPLIFY 3.1:* grey sidebar, sentence-case group headings, status as dot + word (no badge pills). The env cue is amber text for practice and neutral text for Fusion. "New test run" is a secondary button.
|
| 243 |
+
|
| 244 |
Top to bottom, 264px wide, padding 12px 10px, background `--fpt-sidebar`:
|
| 245 |
|
| 246 |
1. **Brand row** (48px): the existing `.fpt-mark` initials + product name (`useBrand`), org name small below. `data-testid="brand"` stays.
|
|
|
|
| 412 |
|
| 413 |
#### 3.1.2 Conversation content
|
| 414 |
|
| 415 |
+
> *Amended by UI-SIMPLIFY 3.2:* the kicker becomes the sentence-case line "Step 2 of 4: approve the scenarios"; the progress bar is neutral with an accent current segment; phase separators are sentence case; the result card has no filled verdict band.
|
| 416 |
+
|
| 417 |
The thread is the current `Conversation` component (AssistantPage.tsx) with these changes:
|
| 418 |
|
| 419 |
1. **Stage progress line** replaces the Mantine `Stepper` (which breaks at 390px): a 4-segment bar in the current-stage card header,
|
|
|
|
| 489 |
|
| 490 |
### 3.2 Team board (upgrade of the Workflow tab, `/runs/:id/workflow`)
|
| 491 |
|
| 492 |
+
> *Amended by UI-SIMPLIFY 3.4 and UI-REVIEW-2:* neutral avatars, no coloured phase borders, colour only on waiting / failed / paused cards. The engine label is what actually ran. Columns follow the container width.
|
| 493 |
+
|
| 494 |
Purpose: the 15 agents as teammates of a team lead ("Coordinator"), each with live state, last action, and flags for failed or silent ones.
|
| 495 |
|
| 496 |
```
|
|
|
|
| 666 |
|
| 667 |
### 3.6 Patch readiness home ("release cockpit", `/`)
|
| 668 |
|
| 669 |
+
> *Superseded by UI-SIMPLIFY 3.8:* no KPI tiles, no tinted release band, no separate Needs-you box. Each area shows its **last finished verdict** plus a line for a newer in-progress run.
|
| 670 |
+
|
| 671 |
```
|
| 672 |
TOP BAR: Patch readiness [Environment: Local mock pod v] [Patch: latest v] [+ New test run]
|
| 673 |
-------------------------------------------------------------------------------------------------------
|
|
|
|
| 855 |
|
| 856 |
### 4.1 Colour
|
| 857 |
|
| 858 |
+
> *Superseded by UI-SIMPLIFY.md section 2:* neutral greys, a single blue accent `#2b59c3` / `#8ea8f0`, and status colours only for verdicts, waiting-for-you, failures and the practice warning. "Running" is neutral. The Fusion pod cue is neutral, not blue.
|
| 859 |
+
|
| 860 |
| Token | Light | Dark | Use / contrast |
|
| 861 |
|---|---|---|---|
|
| 862 |
| `--fpt-page` | #e9f0ee (unchanged) | #0c1110 | app background behind panels (now only visible in gaps) |
|
|
|
|
| 882 |
|
| 883 |
### 4.2 Type (Poppins stays; sizes nudged up for readability)
|
| 884 |
|
| 885 |
+
> *Amended:* weights 400 and 600 only; no uppercase or letter-spaced labels anywhere (UI-SIMPLIFY 2.4).
|
| 886 |
+
|
| 887 |
| Mantine size | Old | New | Use |
|
| 888 |
|---|---|---|---|
|
| 889 |
| `xs` | 11px | 11.5px | meta, pills |
|
docs/design/UI-SIMPLIFY.md
ADDED
|
@@ -0,0 +1,408 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Make the UI calm and simple
|
| 2 |
+
|
| 3 |
+
Status: binding for every UI step from now on. Where this file and `UI-REDESIGN.md` disagree, this file wins; `UI-REDESIGN.md`
|
| 4 |
+
carries notes pointing here. It also contains the review of step 5 (`d82d618`) and of the review-3 fixes (`bdd5b0e`), which was
|
| 5 |
+
cut off earlier (section 6).
|
| 6 |
+
|
| 7 |
+
Why: the person using the product said the screens use too many colours and should be simple and easy to understand. Looking at the
|
| 8 |
+
step-5 screenshots with the `frontend-design` skill (`.claude/skills/frontend-design/SKILL.md`) in hand, they are right. A single
|
| 9 |
+
readiness screen (`shots/step5/readiness-desktop-light.png`) shows:
|
| 10 |
+
- a mint-tinted band;
|
| 11 |
+
- five tiles with five coloured left borders;
|
| 12 |
+
- an amber caps "NEEDS YOU" box;
|
| 13 |
+
- seven blue process chips and one amber one;
|
| 14 |
+
- an amber verdict pill;
|
| 15 |
+
- three black buttons;
|
| 16 |
+
- an amber sidebar footer and amber sidebar badges;
|
| 17 |
+
- a red dot.
|
| 18 |
+
|
| 19 |
+
Nothing tells the eye where to look first.
|
| 20 |
+
|
| 21 |
+
What stays the same: every function, route, test id, accessible name and permission check (`UI-REDESIGN.md` sections 9 and 10). The
|
| 22 |
+
honesty cues stay too:
|
| 23 |
+
- practice environment versus Oracle Fusion;
|
| 24 |
+
- engine labels that say what actually ran;
|
| 25 |
+
- human approval kept prominent.
|
| 26 |
+
|
| 27 |
+
This is a change of colour, emphasis and wording, not of features.
|
| 28 |
+
|
| 29 |
+
---
|
| 30 |
+
|
| 31 |
+
## 1. Principles
|
| 32 |
+
|
| 33 |
+
1. **Neutral by default.** Backgrounds, surfaces, text, borders, tables, chips and avatars are greys. A screen in its resting state is
|
| 34 |
+
black text on white with grey lines.
|
| 35 |
+
2. **One accent, two jobs.** The brand accent (blue) is used only for:
|
| 36 |
+
- the **primary action** of the screen (one per screen);
|
| 37 |
+
- the **current selection** (active nav item, active tab, selected run, focus ring).
|
| 38 |
+
|
| 39 |
+
It is never a background for decoration, never a chart colour and never a status.
|
| 40 |
+
3. **Colour means "look at this".** Green, amber and red appear only where a person must notice a state:
|
| 41 |
+
- a verdict: Ready, Not ready, On hold;
|
| 42 |
+
- something waiting for you;
|
| 43 |
+
- a failure or a stopped run;
|
| 44 |
+
- the practice-environment warning.
|
| 45 |
+
|
| 46 |
+
If removing the colour would not make anyone miss something, remove it.
|
| 47 |
+
4. **One loud thing per screen.** On each screen, pick the single element that matters (usually the verdict or the waiting action). It
|
| 48 |
+
gets the colour and the weight; everything around it is quiet.
|
| 49 |
+
5. **Structure only where it carries meaning.**
|
| 50 |
+
- Borders, cards, numbering, dividers and labels exist only when they separate or order real content.
|
| 51 |
+
- Numbering is used only for true sequences (the 4 run stages, the 6 workflow phases).
|
| 52 |
+
- No ALL-CAPS eyebrow labels anywhere.
|
| 53 |
+
- No middle-dot meta strings longer than two parts.
|
| 54 |
+
- No tinted bands.
|
| 55 |
+
- No identical shadowed cards stacked for every block.
|
| 56 |
+
6. **Plain words, sentence case, one job per element.**
|
| 57 |
+
- Headings are short sentences ("Waiting for you", "Business areas").
|
| 58 |
+
- An action keeps the same name across the flow. "Approve", for example, everywhere: the button, the toast "Approved" and the run
|
| 59 |
+
state "Approved".
|
| 60 |
+
- Text that repeats the heading or a neighbouring element is cut.
|
| 61 |
+
7. **Status is never colour alone.** Every coloured state also has a word or icon. This is unchanged.
|
| 62 |
+
|
| 63 |
+
---
|
| 64 |
+
|
| 65 |
+
## 2. Palette (exact tokens, light and dark)
|
| 66 |
+
|
| 67 |
+
All text pairs are WCAG AA (computed). Non-text graphics (dots, focus ring, active-tab underline) are at least 3:1. Existing token
|
| 68 |
+
names are kept; their values change.
|
| 69 |
+
|
| 70 |
+
### 2.1 Neutrals and accent
|
| 71 |
+
|
| 72 |
+
| Token | Light | Dark | Use | Contrast |
|
| 73 |
+
|---|---|---|---|---|
|
| 74 |
+
| `--fpt-page` | `#ffffff` | `#121314` | app background (was mint `#e9f0ee`) | — |
|
| 75 |
+
| `--fpt-surface` | `#ffffff` | `#17181a` | center, panel, menus | — |
|
| 76 |
+
| `--fpt-surface-2` | `#f6f7f8` | `#1e1f22` | hover rows, table header, inset areas | — |
|
| 77 |
+
| `--fpt-sidebar` | `#f6f7f8` | `#151618` | sidebar (was mint-tinted) | text 15.7:1 / 14.4:1 |
|
| 78 |
+
| `--fpt-border` | `#e4e5e8` | `#2c2e31` | all 1px lines | — |
|
| 79 |
+
| `--fpt-line` | `#d4d6da` | `#3a3c40` | stronger dividers (rare) | — |
|
| 80 |
+
| `--fpt-text` | `#1c1d1f` | `#e6e7e9` | body text | 16.9:1 / 14.4:1 |
|
| 81 |
+
| `--fpt-dim` | `#5c6066` | `#a0a4aa` | secondary text | 6.3:1 on white, 5.9:1 on sidebar / 7.1:1 |
|
| 82 |
+
| `--fpt-accent` (new) | `#2b59c3` | `#8ea8f0` | primary button fill, active nav/tab, links, focus | white on it 6.3:1 / `#121314` on it 8.0:1 |
|
| 83 |
+
| `--fpt-accent-text` (new) | `#ffffff` | `#121314` | text on accent fill | as above |
|
| 84 |
+
| `--fpt-selected` (new) | `#eef2fb` | `#232a3a` | background of the selected nav item / run row | text 15.0:1 / 11.6:1; accent 5.6:1 |
|
| 85 |
+
| `--fpt-focus` | `#2b59c3` | `#8ea8f0` | focus ring (same as accent) | 6.3:1 / 7.6:1 |
|
| 86 |
+
| `--fpt-ink` / `--fpt-ink-text` | **aliases of** `--fpt-accent` / `--fpt-accent-text` | | kept so existing CSS keeps working | |
|
| 87 |
+
| `--fpt-band`, `--fpt-mint-card`, `--fpt-lav-card` | `transparent` | `transparent` | retired: tinted bands are removed; keep the names to avoid breakage | |
|
| 88 |
+
|
| 89 |
+
Mantine: change `primaryColor` from `ink` to a new `accent` tuple whose shade 6 is `#2b59c3`:
|
| 90 |
+
|
| 91 |
+
```ts
|
| 92 |
+
['#eef2fb', '#d9e2f6', '#b3c4ec', '#8ea8f0', '#5f80db', '#4469cf', '#2b59c3', '#234aa6', '#1c3c88', '#152d66']
|
| 93 |
+
```
|
| 94 |
+
|
| 95 |
+
Delete the dark-mode `--mantine-color-ink-*` overrides and the button/checkbox/radio colour hacks. Instead, in dark mode set
|
| 96 |
+
`--mantine-color-accent-filled: #8ea8f0` and `--mantine-color-accent-filled-hover: #a9bdf4`, with a button text colour of `#121314`, under
|
| 97 |
+
`:root[data-mantine-color-scheme='dark']`. Keep `mint` and `lavender` tuples only if still referenced; no new usage.
|
| 98 |
+
|
| 99 |
+
**Secondary buttons** are `variant="default"`: surface background, `--fpt-border` 1px, `--fpt-text` label. **Tertiary** actions are
|
| 100 |
+
`variant="subtle"` text buttons in `--fpt-text` (not accent), so the accent stays rare.
|
| 101 |
+
|
| 102 |
+
### 2.2 Status colours (only for states a person must notice)
|
| 103 |
+
|
| 104 |
+
| State | Token (fg / bg) light | Dark | Where it is allowed |
|
| 105 |
+
|---|---|---|---|
|
| 106 |
+
| Ready / passed | `--pill-green-fg #1e6b34` / `--pill-green-bg #e9f5ec` (5.8:1) | `#7ccf92` / `#1b2a20` (8.0:1) | verdict word, passed count in a result |
|
| 107 |
+
| Waiting for you / paused | `--pill-amber-fg #8a4b00` / `--pill-amber-bg #fdf3e1` (6.2:1) | `#f0b44c` / `#2e2615` (8.1:1) | the waiting chip, the action card's 3px left edge, sidebar "Needs you" dot |
|
| 108 |
+
| Not ready / failed / stopped with error | `--pill-red-fg #b42318` / `--pill-red-bg #fdecea` (5.8:1) | `#f39a92` / `#33201f` (7.2:1) | verdict word, failure count, "What happened" |
|
| 109 |
+
| Status dots (graphics) | green `#2e8540` 4.6:1, amber `#c26a00` 3.9:1, red `#c62828` 5.6:1, idle `#8a8f98` 3.3:1 | `#7ccf92`, `#f0b44c`, `#f39a92`, `#8a8f98` (5.5:1) | sidebar runs, run state chip |
|
| 110 |
+
| Running | **no colour**: `--fpt-dim` spinner/pulse | same | running is not a call to action |
|
| 111 |
+
|
| 112 |
+
The existing names `--fpt-status-running / waiting / done / failed / idle` map onto these: `running` becomes `--fpt-dim`.
|
| 113 |
+
`--pill-blue-*`, `--pill-lav-*`, `--pill-mint-*` remain defined for backward compatibility but are not used by new or simplified UI:
|
| 114 |
+
- "testing" uses neutral;
|
| 115 |
+
- "Written by the AI model" uses neutral with an icon;
|
| 116 |
+
- the engine labels use neutral.
|
| 117 |
+
|
| 118 |
+
### 2.3 Environment cue (honesty)
|
| 119 |
+
|
| 120 |
+
- **Practice environment** is the warning case: amber **text** with a shield icon, no fill, in exactly two places:
|
| 121 |
+
- the sidebar footer;
|
| 122 |
+
- the run top bar sub-line (and the readiness top bar when the rail hides the sidebar).
|
| 123 |
+
|
| 124 |
+
Wording: "Practice environment: mock app, not Oracle Fusion". `data-testid="mock-banner"` stays on the sidebar one. The text "Mock
|
| 125 |
+
app, not Oracle Fusion" (case per `MOCK_TEXT`) must remain visible on every page.
|
| 126 |
+
- **Oracle Fusion pod** is the normal case: neutral text with a cloud icon, "Oracle Fusion pod: <name>". It is not blue. A test pod is
|
| 127 |
+
real but still a test; the neutral styling avoids implying "production".
|
| 128 |
+
- Report and screen footers keep their one-line honesty sentence in `--fpt-dim`.
|
| 129 |
+
|
| 130 |
+
### 2.4 Shape, depth, type
|
| 131 |
+
|
| 132 |
+
- **Radii:** 8px for inputs, buttons and small items; 12px for the few real containers (stage card, side panel sections, dialogs). Pills
|
| 133 |
+
are kept only for the status chip (999px).
|
| 134 |
+
- **Shadows:** none on cards. Use `--fpt-shadow-2` only on floating layers (menus, popovers, sticky bars) and `--fpt-shadow-3` on drawers.
|
| 135 |
+
- **Cards:** a block gets a border only if it must be separated from a neighbour of the same kind. Otherwise sections are separated by
|
| 136 |
+
24px space and a sentence-case heading.
|
| 137 |
+
- **Type:** Poppins stays (brand continuity, no new dependency), with weights **400 and 600 only** (drop 500).
|
| 138 |
+
- Headings: 600, sentence case.
|
| 139 |
+
- No letter-spaced caps, no uppercase transforms anywhere. Remove `text-transform: uppercase` from `.fpt-tree-title`,
|
| 140 |
+
`.fpt-chat-phase`, `.fpt-stage-kicker`, the sidebar group headings, `.fpt-flow-you`, the board phase titles and the "NOT READY"
|
| 141 |
+
badge.
|
| 142 |
+
- The monospace face only for the run reference id.
|
| 143 |
+
- **Motion:** only the running spinner and the "Latest" jump. No hover lifts.
|
| 144 |
+
|
| 145 |
+
---
|
| 146 |
+
|
| 147 |
+
## 3. Screen by screen: remove / merge / keep
|
| 148 |
+
|
| 149 |
+
Notation: **Remove** (delete from the UI; the function remains reachable where noted), **Merge** (combine into one element),
|
| 150 |
+
**Keep** (stays, maybe restyled). "Primary" names the one accent button on the screen.
|
| 151 |
+
|
| 152 |
+
### 3.1 Shell: sidebar and top bar
|
| 153 |
+
|
| 154 |
+
| | |
|
| 155 |
+
|---|---|
|
| 156 |
+
| **Remove** | mint sidebar tint (use `--fpt-sidebar` grey); the "PT" black mark tile (show a 24px neutral outlined monogram); caps headings "RUNS", "NEEDS YOU", "RECENT"; amber "Review"/"Decide" badge **pills** in run rows; the red "Not ready" pill in run rows; the run-row sub-line's third part ("· Practice"); the filter icon button next to the Runs heading (move "Only mine" into a small "Show: All / Mine" text toggle at the bottom of the list); amber fill of the env switcher block; the black filled "New test run" button. |
|
| 157 |
+
| **Merge** | run-row right badge + dot become **one** status line: dot + word at the end of the sub-line ("18 Oct 23:52 · Needs your approval" with an amber dot; "Not ready" with a red dot; "Testing" with a grey pulse). Waiting rows also get the word in 600 weight. |
|
| 158 |
+
| **Keep** | New test run (secondary style: `default` button with a plus icon, full width; the screen's primary lives in the page); nav labels; the Test runs count (neutral grey number, amber only when > 0 runs wait for you); grouping order (waiting first, then running, then recent), with sentence-case headings "Waiting for you", "Running", "Recent"; env switcher as amber text + shield (2.3); kill indicator (red, it is an emergency); user row. Active nav item = `--fpt-selected` background + accent text and icon. |
|
| 159 |
+
|
| 160 |
+
Top bar (run pages):
|
| 161 |
+
|
| 162 |
+
| | |
|
| 163 |
+
|---|---|
|
| 164 |
+
| **Remove** | the "Finished" chip when a decision exists (the verdict says it); the uppercase red "NOT READY" filled badge; the env **pill** fill; "Quick simulation" (move into the run-type tooltip on the title, and into the panel Live tab text). |
|
| 165 |
+
| **Merge** | the status chip and the decision into one element: neutral chip with a dot and a word. "Waiting for you" (amber dot), "Testing" (grey pulse), "Ready" (green dot, green word), "Not ready" (red dot, red word), "On hold" (amber), "Paused" (amber), "Stopped" (red), "Cancelled" (grey). `data-testid="decision-badge"` and `data-rule` move onto this chip when decided (render it through `DecisionBadge` so unit tests still find it); `StatusBadge`'s test id stays on it otherwise. The chip's text content must be exactly the verdict words ("Not ready"): the dot is `aria-hidden`, because e2e asserts `toHaveText('Not ready')` on the first `decision-badge`. |
|
| 166 |
+
| **Keep** | title; second line = env cue text (2.3) + `ref` (neutral, monospace); All details; Resume (primary when shown); panel toggle; glossary. |
|
| 167 |
+
|
| 168 |
+
### 3.2 Run workspace (conversation)
|
| 169 |
+
|
| 170 |
+
| | |
|
| 171 |
+
|---|---|
|
| 172 |
+
| **Remove** | caps phase separators ("YOUR APPROVAL", "TESTING", "RESULT") → sentence-case dim text "Your approval" with the hairline; caps stage kicker "STAGE 2 OF 4 · APPROVE"; the coloured 4-segment bar (green/blue/amber); "AI" black avatar circles on every bot message (keep one small neutral avatar on the **first** bot message of each phase only); the "TEAM" caps label; the green check chip "4 done" colour; the amber left border on stage cards except approve/judge; black user bubbles (use `--fpt-surface-2` with `--fpt-text`; right-aligned); "That is the whole process. What next?" bubble (its two actions move into the result card as text links). |
|
| 173 |
+
| **Merge** | stage kicker + progress into one dim line "Step 2 of 4: approve the scenarios" (the progress bar becomes 4 neutral segments, the current one accent, done ones `--fpt-text` at 40% opacity; no green/amber); the suggestion chips + composer mode toggle → keep the chips, they are the command help, but render them as plain text buttons. |
|
| 174 |
+
| **Keep** | the current stage card (`run-guide`, `data-stage`) as the only bordered card in the thread; **approve and judge cards keep the amber 3px left edge** (human approval prominent); the primary button inside the stage card is the screen's only accent button ("Approve all 79 and start testing", "Submit my decision", "Open the report and sign off"); Excel download as a `default` button; team strip as one neutral line of text with icons ("4 of 15 steps done. Approval is waiting for you." + link "Open the team board"). |
|
| 175 |
+
|
| 176 |
+
Result card (stage 4):
|
| 177 |
+
|
| 178 |
+
| | |
|
| 179 |
+
|---|---|
|
| 180 |
+
| **Remove** | the full red/green filled verdict band; the bullet "•" list with five facts; "Results come from…" sentence duplicated by the top bar cue (keep one: in the result card, dim). |
|
| 181 |
+
| **Merge** | verdict + sentence: a 22px 600 verdict word **in the status colour** ("Not ready" in red), followed by one sentence in `--fpt-text`. Facts become a 4-column inline summary without borders: "65 tested · 1 failing · 14 not run · 1 defect" (one middle-dot string is acceptable here because it is a single row of numbers; each number links where useful). |
|
| 182 |
+
| **Keep** | primary "Open the report and sign off"; secondary "Download the results (Excel)"; "See the screens" (browser runs only); `guide-result` test id on the verdict block. |
|
| 183 |
+
|
| 184 |
+
### 3.3 Side panel
|
| 185 |
+
|
| 186 |
+
| | |
|
| 187 |
+
|---|---|
|
| 188 |
+
| **Remove** | red dot on the Report tab label (use a neutral count/marker only when something is new: a 6px accent dot means "updated since you looked", not "bad"); the red filled "NOT READY" pill in the Report tab; the tinted Steps id pill on the tab. |
|
| 189 |
+
| **Merge** | Report tab: verdict word (status colour) + the one-line reason + a 2-column numbers list (already plain) + actions. Only one accent button: "Open the full report and sign off". "Download PDF", "Share", "Download the results (Excel)" are `default` buttons in one row. |
|
| 190 |
+
| **Keep** | tabs (active = accent underline); Live, Screens (with Failed filter count in neutral), Excel, Steps; honesty footers. |
|
| 191 |
+
|
| 192 |
+
Check (from review): the Steps tab for `P2P-APR-001` stays on its loading skeleton in four screenshots taken across three reviews
|
| 193 |
+
(`step4/failures-detail`, `review2-fixes/steps-loading-skeleton`, `review3-fixes/judge-quicksim-stacked`, `review3-fixes/scenarios`). The
|
| 194 |
+
10-second error fallback never appears. **Must-fix:** verify the scenario lookup resolves when the run's scenario list is still loading,
|
| 195 |
+
or when the selected id is a pending gate item. Show the error line after 10 s as specified.
|
| 196 |
+
|
| 197 |
+
### 3.4 Team board
|
| 198 |
+
|
| 199 |
+
| | |
|
| 200 |
+
|---|---|
|
| 201 |
+
| **Remove** | coloured agent avatars (initials on mint/lav/blue/amber) → a neutral 24px initials circle (`--fpt-surface-2`, `--fpt-dim` text); coloured phase top borders (green/blue/red); the per-card "Done" green check line when the whole phase is done (the phase heading carries "Done"); caps phase titles "UNDERSTAND" → "1. Understand" sentence case (the numbering stays, it is a real sequence); "took 21 s · finished 01:07 · Built-in rules" triple meta → two lines: "Took 21 s" and the engine label; the "YOU" pill → the word "You" in 600 weight after the name. |
|
| 202 |
+
| **Merge** | Coordinator card counters + state sentence into one sentence: "All 15 steps finished in 2 min 28 s. AI on this run: none, built-in rules only." |
|
| 203 |
+
| **Keep** | state words and icons per card; colour **only** for: the waiting card (amber left edge + "Waiting for you"), a failed card (red left edge + "Stopped"), a paused card (amber). Done and not-started cards are neutral. Engine labels = what actually ran (unchanged rule, R2-M1). |
|
| 204 |
+
|
| 205 |
+
### 3.5 Approvals (scenario review)
|
| 206 |
+
|
| 207 |
+
| | |
|
| 208 |
+
|---|---|
|
| 209 |
+
| **Remove** | blue/lav tinted pills: "Written by the AI model" (→ neutral text with a sparkle-free `IconRobot` 14px, dim), "Critical" red pill and "High" amber pill (→ plain text "Critical" in 600 weight; priority is not a state to act on); green "dry run passed" pill (→ the dry-run sentence with a green check icon only, text neutral); the coloured left borders on AI cards (lav undecided, green approved) → neutral border, and the decision is shown by the pressed button; the dashed-underline "Read the scenarios" `Term` styling in the intro (keep the tooltip, drop the underline in body copy). |
|
| 210 |
+
| **Merge** | the intro paragraph + filter row: one line "79 scenarios to review. Approve them, or skip some for this patch." Then filters. The NextStep banner on this view is a single line (already done) with no colour fill: amber text only. |
|
| 211 |
+
| **Keep** | filter chips as neutral segmented buttons (active = accent outline); step groups with "Approve all N" as `default` buttons; the sticky bar; **primary = "Submit review"** (accent) and "Approve the remaining N" as `default`; one decision order (Approve, then Skip for this patch); all accessible names. |
|
| 212 |
+
|
| 213 |
+
Must-fix found in `review3-fixes/scenarios-phone-*`: all 79 scenarios sit in one group named "Other". This happens when the gate's
|
| 214 |
+
pending list renders before the run's scenario list (stubs have no `step`). **Do not render groups until `useRunScenarios` has
|
| 215 |
+
loaded.** Show the skeleton instead. If a scenario truly has no step, label the group "No process step". Re-shoot `scenarios-phone-*`
|
| 216 |
+
after the fix: the developer's "data not loaded" explanation is the bug itself, not a capture accident.
|
| 217 |
+
|
| 218 |
+
### 3.6 Failure decision (Judge card and Failures view)
|
| 219 |
+
|
| 220 |
+
| | |
|
| 221 |
+
|---|---|
|
| 222 |
+
| **Remove** | the red-filled "What happened" box (→ neutral box with the label "What happened" and the value in `--pill-red-fg`); the "1 of 1" amber pill when there is only one failure; tinted "failed at: Requisition" / "failed" / "Critical" pills on the Failures view (→ one dim line "Failed at Requisition. Critical."). |
|
| 223 |
+
| **Keep** | amber left edge on the Judge card; three choices as radio cards with neutral borders, selected = accent border + accent radio; "suggested" as dim text; primary "Submit my decision" (or "Next"); screen column; "Show the steps". |
|
| 224 |
+
|
| 225 |
+
### 3.7 Report and sign-off
|
| 226 |
+
|
| 227 |
+
| | |
|
| 228 |
+
|---|---|
|
| 229 |
+
| **Remove** | the red NextStep banner on top of the report (the report's own verdict header says it); the red "NOT READY" filled pill; "no coverage" amber pills inside the table (→ the cell text "No scenario" in dim italic is enough; the gap is listed below); the green-filled sign-off confirmation (→ a line with a green check icon, neutral text); the amber/red "rule result: NO-GO" pill in Audit details (→ plain text "Rule result: NO-GO", it is audit data). |
|
| 230 |
+
| **Merge** | header: area name, verdict word (status colour), and one row of actions: **primary "Go to sign-off"** (scrolls to and focuses the sign-off form). It must not be named "Sign off this report": e2e clicks that exact name and two matches would fail. Once signed off, this button disappears, then `default` "Download PDF", "Share", "Downloads". |
|
| 231 |
+
| **Keep** | the results table (neutral, zebra off, header in `--fpt-surface-2`); open defects; not covered yet; sign-off form; audit details collapsed; iframe; all test ids. |
|
| 232 |
+
|
| 233 |
+
### 3.8 Patch readiness
|
| 234 |
+
|
| 235 |
+
This also rules on the lead's observation in `readiness-desktop-light.png`: the "0 Not ready" tile next to a sidebar run marked "Not
|
| 236 |
+
ready".
|
| 237 |
+
|
| 238 |
+
**Ruling:** yes, consultants will read it as a contradiction. The tiles count each area's **newest** run, which is waiting for approval,
|
| 239 |
+
while the sidebar shows an older **finished** verdict. A consultant asks "is Procure-to-Pay ready or not?", and the screen gives two
|
| 240 |
+
answers. Fix:
|
| 241 |
+
- the verdict an area shows is always the **last finished** verdict;
|
| 242 |
+
- an in-progress run is a second, clearly-labelled line.
|
| 243 |
+
|
| 244 |
+
| | |
|
| 245 |
+
|---|---|
|
| 246 |
+
| **Remove** | the five KPI tiles (coloured borders, big zeros); the mint "ORACLE UPDATE 26C" band and its caps label; the duplicate honesty pill inside the band (the top bar cue covers it); the caps "NEEDS YOU" and "BUSINESS AREAS" labels; the seven blue process chips' fills; "Show details and 12 more process areas" as a grey button (→ a text link). |
|
| 247 |
+
| **Merge** | release info into the page sub-title: "Patch 26C. Pod release 26C, checked 18 Oct 23:53." (plus "Next Oracle update: <date>" only when the API provides it). "Needs you" + area cards become **one list of areas**; each area row says what it needs. |
|
| 248 |
+
| **Keep** | top bar env select, patch select, **primary "New test run"** (accessible name unchanged, inside `main`); area cards (one bordered card per area, no tint); "What this patch changes" collapsed (button name unchanged); glossary link. |
|
| 249 |
+
|
| 250 |
+
Area card content (exact):
|
| 251 |
+
|
| 252 |
+
```
|
| 253 |
+
Procure-to-Pay Not ready <- last finished verdict, status colour
|
| 254 |
+
Last result 18 Oct 23:51, signed off by admin. 1 scenario failing in Requisition.
|
| 255 |
+
(!) A newer test run is waiting for your approval. [Open your review] <- amber icon + text, primary button
|
| 256 |
+
Requisition 6/7 → Sourcing (no scenario) → Purchase order 9/9 → Receiving 3/3 → ... <- neutral text chips; only failing steps red, gaps dim italic
|
| 257 |
+
[Open the test run] [Report] Show details
|
| 258 |
+
```
|
| 259 |
+
|
| 260 |
+
- **Verdict** = `decisions[area]` of the newest **completed** run for that area on the selected environment and patch. Source:
|
| 261 |
+
`useRuns` items filtered by `status === 'completed'`, `modules.includes(area)`, `pod_id`. That data is already loaded; no new
|
| 262 |
+
endpoint. If no finished run exists: "Not tested yet" in dim.
|
| 263 |
+
- **In-progress line** only when a newer run exists and is not finished. Wording by state:
|
| 264 |
+
- "A newer test run is waiting for your approval."
|
| 265 |
+
- "A newer test run is waiting for your decision on failures."
|
| 266 |
+
- "A newer test run is testing now."
|
| 267 |
+
|
| 268 |
+
Only the two waiting states get amber; testing is neutral.
|
| 269 |
+
- `verdict-<MOD>` test id stays on the verdict word. `summary-<MOD>` stays on the "Last result…" line. e2e asserts `summary-P2P` contains `/scenario|Not tested yet/`, so that line always includes a scenario count ("1 scenario failing", "All 65 scenarios passed") or the words "Not tested yet". The readiness API's `verdict`
|
| 270 |
+
field (current-state verdict such as "Waiting for you") moves to the in-progress line.
|
| 271 |
+
- Primary button per card only when the area waits for you. Otherwise "Open the test run" is `default`.
|
| 272 |
+
- If more than one area waits for you, order them first. No separate "Needs you" box.
|
| 273 |
+
|
| 274 |
+
### 3.9 Runs list
|
| 275 |
+
|
| 276 |
+
| | |
|
| 277 |
+
|---|---|
|
| 278 |
+
| **Remove** | per-row pill clutter: date pill with calendar icon, lav "quick simulation" pill, tinted status pill, amber "your review" link pill, per-area decision badges in a row of chips; "Getting started" coloured check icons (→ neutral checks). |
|
| 279 |
+
| **Merge** | each row = two lines: line 1 = run name (link) + status (dot + word, as in the sidebar); line 2 (dim) = "Practice environment" or "Oracle Fusion pod: <name>", run type, started by. The row menu stays. Waiting rows get "Open your review" as a `default` button at the right. |
|
| 280 |
+
| **Keep** | quick filters as a neutral segmented control (active = accent); status select; pager; `run-row-<id>`; row menu items. Primary = "New test run". |
|
| 281 |
+
|
| 282 |
+
### 3.10 Sign-in, register, forgot, reset
|
| 283 |
+
|
| 284 |
+
| | |
|
| 285 |
+
|---|---|
|
| 286 |
+
| **Remove** | the dark green gradient brand panel → a quiet `--fpt-surface-2` panel with the product name, one sentence and the three points in `--fpt-text` (icons neutral). The amber honesty banner above the form becomes amber text with a shield (2.3), still `data-testid="mock-banner"`. |
|
| 287 |
+
| **Keep** | split layout (collapses to the form on phone); labels and button names; primary = "Sign in" / "Create account" / "Send the reset link" / "Save the new password". |
|
| 288 |
+
|
| 289 |
+
---
|
| 290 |
+
|
| 291 |
+
## 4. Rules for steps 6 and 7 screens
|
| 292 |
+
|
| 293 |
+
Applies to Runs list (3.9), Scenarios library, Test environments, Settings, Defects, Reports, Scheduled runs:
|
| 294 |
+
|
| 295 |
+
1. **Page anatomy:**
|
| 296 |
+
- the top bar title;
|
| 297 |
+
- an optional one-line dim description (only if the page needs explaining);
|
| 298 |
+
- the content;
|
| 299 |
+
- one primary action in the top bar (accent).
|
| 300 |
+
|
| 301 |
+
No header bands and no KPI tiles.
|
| 302 |
+
2. **Lists and tables:**
|
| 303 |
+
- neutral rows with 1px dividers and no zebra stripes;
|
| 304 |
+
- a status column shown as dot + word, never a filled pill;
|
| 305 |
+
- text actions or `default` buttons at the row end;
|
| 306 |
+
- a "..." menu for the rest.
|
| 307 |
+
3. **Filters:** a neutral segmented control or selects. The active one has an accent outline. Counts are plain dim numbers.
|
| 308 |
+
4. **Scenarios library:** priority as plain text ("Critical"). Origin as dim text with an icon ("Library", "Written by the AI model"). The
|
| 309 |
+
verification note stays dim text. The selected row uses `--fpt-selected`.
|
| 310 |
+
5. **Test environments:**
|
| 311 |
+
- one card per environment, with neutral borders;
|
| 312 |
+
- the practice pod shows the amber honesty line (2.3); a Fusion pod shows its neutral "Oracle Fusion pod" line;
|
| 313 |
+
- connection state as dot + words ("Connected, checked 2 h ago" green dot; "Not checked yet" grey; "Connection failed" red dot +
|
| 314 |
+
reason);
|
| 315 |
+
- primary = "Add test environment" (aria-label "Add pod" kept);
|
| 316 |
+
- per-card actions "Test connection" and "Sign-in details" as `default` buttons.
|
| 317 |
+
6. **Settings:**
|
| 318 |
+
- vertical tabs with neutral styling; the active tab uses `--fpt-selected` + accent text;
|
| 319 |
+
- each tab has one primary (for example "Save local model");
|
| 320 |
+
- Emergency stop is the only red area: "Engage kill switch" is the red filled button; nothing else on the page is red;
|
| 321 |
+
- the "What goes where" and "Which agent uses which model" tables are neutral.
|
| 322 |
+
7. **Defects:** the status as dot + word. "Open" is red only for defects that are open **and** confirmed real; everything else is
|
| 323 |
+
neutral.
|
| 324 |
+
8. **Reports:** the verdict word in status colour per row (it is the point of the page) and the environment as text. Nothing else is
|
| 325 |
+
coloured.
|
| 326 |
+
9. **Scheduled runs:**
|
| 327 |
+
- rows read as sentences ("Every day at 02:00 UTC. Procure-to-Pay, full browser run.");
|
| 328 |
+
- "Next run 18 Oct 07:30" in dim;
|
| 329 |
+
- the enable switch uses the accent when on;
|
| 330 |
+
- patch watch is a plain section with a heading, not a tinted card;
|
| 331 |
+
- primary = "New scheduled run".
|
| 332 |
+
10. **Empty states:** one sentence that says what to do and one button. No illustrations, no coloured icons.
|
| 333 |
+
11. **Wording:** sentence case everywhere, no caps eyebrows, no "→" appended to buttons, consistent verbs:
|
| 334 |
+
- "Approve" / "Approved";
|
| 335 |
+
- "Sign off" / "Signed off";
|
| 336 |
+
- "Start test run" in the dialog, and "Test run started" in the toast.
|
| 337 |
+
|
| 338 |
+
---
|
| 339 |
+
|
| 340 |
+
## 5. Hard constraints (unchanged)
|
| 341 |
+
|
| 342 |
+
- `UI-REDESIGN.md` section 9 (functionality preservation checklist) and section 10 (routes, test ids, accessible names) remain binding.
|
| 343 |
+
Visible text may get shorter, but every accessible name listed in section 10 stays exact (use `aria-label` where the visible label
|
| 344 |
+
shortens).
|
| 345 |
+
- Honesty:
|
| 346 |
+
- practice versus Oracle Fusion is always visible (2.3);
|
| 347 |
+
- engine labels state what actually ran on that run (UI-REVIEW-2 R2-M1);
|
| 348 |
+
- "Mock app, not Oracle Fusion" stays visible on every page with a practice pod.
|
| 349 |
+
- Human approval stays prominent. Waiting-for-you is the **only** amber call to action. It appears in the sidebar row, the top-bar chip
|
| 350 |
+
and the stage card's left edge plus primary button.
|
| 351 |
+
- Dark mode is a first-class target. Every token above has a dark value; check every screen in both themes.
|
| 352 |
+
|
| 353 |
+
---
|
| 354 |
+
|
| 355 |
+
## 6. Review of step 5 and the review-3 fixes
|
| 356 |
+
|
| 357 |
+
These were cut off earlier. Most step-5 findings are superseded by section 3; the remaining specific items are below.
|
| 358 |
+
|
| 359 |
+
**Review-3 fixes (`bdd5b0e`):**
|
| 360 |
+
- **Accepted:** R3-S1 (designed-engine list honest), R3-S2 (local dry-run times), R3-S3 (one order), R3-S4 (no self-link, one-line
|
| 361 |
+
banner), R3-S5 (`judge-quicksim-stacked`: one dim line), R3-S6 (failed-agent plain sentence + Technical details).
|
| 362 |
+
- **Open must-fix:** the Steps tab stuck on its skeleton (3.3) and the scenarios grouped under "Other" (3.5). **Re-shoot
|
| 363 |
+
`scenarios-phone-*` after the fix.**
|
| 364 |
+
|
| 365 |
+
**Step 5 (`d82d618`):**
|
| 366 |
+
- **M (must):** readiness verdict contradiction. Ruled in 3.8; implement the last-finished verdict + in-progress line.
|
| 367 |
+
- **S (should):** the report view repeats the verdict four times on one screen (top-bar badge, red NextStep banner, report header pill,
|
| 368 |
+
panel Report pill). After section 3.1 / 3.7 it appears twice: the top-bar chip and the report header. The panel's Report tab shows it
|
| 369 |
+
only when the panel is on another view.
|
| 370 |
+
- **S:** "Open the report" in `result-desktop-dark` (signed-off state) vs "Open the report and sign off". Keep one name per state:
|
| 371 |
+
"Open the report and sign off" before sign-off, "Open the report" after. The panel button follows the same rule (it still says "Open
|
| 372 |
+
the full report and sign-off" after sign-off).
|
| 373 |
+
- **S:** `report-desktop-light` table header "Not run" wraps onto two lines and "Changed by this patch" onto two. Use "Not run" with
|
| 374 |
+
`white-space: nowrap`, and shorten the last column to "In patch" (yes/no). The full words go in the header `title`.
|
| 375 |
+
- **N:** `readiness-phone-dark` shows the honesty cue three times: top bar pill, band pill, band sentence. Section 3.8 leaves one.
|
| 376 |
+
|
| 377 |
+
**Accepted as not verified with real data (carry as open visual checks before release):**
|
| 378 |
+
- "Start a test run" on an untested area;
|
| 379 |
+
- the Screens "Failed n" count;
|
| 380 |
+
- the Judge card with a real screenshot;
|
| 381 |
+
- AI approval cards (fixtures only);
|
| 382 |
+
- "Next update" date (no API field; correctly hidden).
|
| 383 |
+
|
| 384 |
+
---
|
| 385 |
+
|
| 386 |
+
## 7. Order of work for the developer
|
| 387 |
+
|
| 388 |
+
1. **Tokens and Mantine theme (2.1-2.4):**
|
| 389 |
+
- the new palette;
|
| 390 |
+
- accent as the primary colour;
|
| 391 |
+
- remove the ink hacks;
|
| 392 |
+
- caps removed globally;
|
| 393 |
+
- weights 400/600.
|
| 394 |
+
|
| 395 |
+
Screenshot all existing screens light/dark; nothing functional changes.
|
| 396 |
+
2. **Shell and run workspace (3.1-3.3).**
|
| 397 |
+
3. **Team board, approvals, failure decision (3.4-3.6)**, plus the two open must-fixes (Steps skeleton, "Other" group).
|
| 398 |
+
4. **Report and readiness (3.7-3.8)**, including the last-finished verdict.
|
| 399 |
+
5. **Runs list and auth (3.9-3.10).**
|
| 400 |
+
6. **Steps 6 and 7 screens, built directly in this style (section 4).**
|
| 401 |
+
|
| 402 |
+
Acceptance for each: e2e and unit suites pass, and the same screenshot set at 1440x900, 1100x800 and 390x844, light and dark. The
|
| 403 |
+
reviewer checks each screen for:
|
| 404 |
+
- one accent button;
|
| 405 |
+
- no caps labels;
|
| 406 |
+
- no tinted bands or coloured tiles;
|
| 407 |
+
- colour only on states listed in 2.2;
|
| 408 |
+
- the honesty cue present.
|
web/src/agents.test.ts
CHANGED
|
@@ -23,7 +23,7 @@ describe('engine on this run (honesty)', () => {
|
|
| 23 |
|
| 24 |
it('sums the run up for the Coordinator', () => {
|
| 25 |
expect(aiOnRun([])).toBe('AI on this run: none');
|
| 26 |
-
expect(aiOnRun([call('synthesizer', 'stub')])).toBe('AI on this run: none
|
| 27 |
-
expect(aiOnRun([call('triage', 'local'), call('reporter', 'frontier'), call('x', 'stub')])).toBe('AI on this run: local model llava-phi3
|
| 28 |
});
|
| 29 |
});
|
|
|
|
| 23 |
|
| 24 |
it('sums the run up for the Coordinator', () => {
|
| 25 |
expect(aiOnRun([])).toBe('AI on this run: none');
|
| 26 |
+
expect(aiOnRun([call('synthesizer', 'stub')])).toBe('AI on this run: none, built-in rules only.');
|
| 27 |
+
expect(aiOnRun([call('triage', 'local'), call('reporter', 'frontier'), call('x', 'stub')])).toBe('AI on this run: local model llava-phi3 and external model mistral-large (2 calls).');
|
| 28 |
});
|
| 29 |
});
|
web/src/agents.ts
CHANGED
|
@@ -122,7 +122,7 @@ export function aiOnRun(llmCalls: LlmCall[] | null | undefined): string {
|
|
| 122 |
const calls = llmCalls ?? [];
|
| 123 |
const local = calls.filter((c) => c.route === 'local');
|
| 124 |
const frontier = calls.filter((c) => c.route === 'frontier');
|
| 125 |
-
if (!local.length && !frontier.length) return calls.length ? 'AI on this run: none
|
| 126 |
const parts = [local.length ? `local model ${mostUsed(local)?.model ?? ''}`.trim() : '', frontier.length ? `external model ${mostUsed(frontier)?.model ?? ''}`.trim() : ''].filter(Boolean);
|
| 127 |
-
return `AI on this run: ${parts.join('
|
| 128 |
}
|
|
|
|
| 122 |
const calls = llmCalls ?? [];
|
| 123 |
const local = calls.filter((c) => c.route === 'local');
|
| 124 |
const frontier = calls.filter((c) => c.route === 'frontier');
|
| 125 |
+
if (!local.length && !frontier.length) return calls.length ? 'AI on this run: none, built-in rules only.' : 'AI on this run: none';
|
| 126 |
const parts = [local.length ? `local model ${mostUsed(local)?.model ?? ''}`.trim() : '', frontier.length ? `external model ${mostUsed(frontier)?.model ?? ''}`.trim() : ''].filter(Boolean);
|
| 127 |
+
return `AI on this run: ${parts.join(' and ')} (${callsWord(local.length + frontier.length)}).`;
|
| 128 |
}
|
web/src/chat/ChatCards.tsx
CHANGED
|
@@ -199,7 +199,7 @@ export function ConfirmCard({ action, onChange }: { action: ChatAction; onChange
|
|
| 199 |
)}
|
| 200 |
{error && <Text size="xs" c="red" role="alert">{error}</Text>}
|
| 201 |
<Group gap={6} mt={8} wrap="wrap">
|
| 202 |
-
<Button size="compact-sm" onClick={() => void confirm()} loading={busy} data-testid="chat-confirm-button">{action.verb}</Button>
|
| 203 |
{action.review && <Button size="compact-sm" variant="default" component={Link} to={action.review.to}>{action.review.label}</Button>}
|
| 204 |
<Button size="compact-sm" variant="default" ref={cancelRef} onClick={() => void cancel()} disabled={busy}>Cancel</Button>
|
| 205 |
</Group>
|
|
|
|
| 199 |
)}
|
| 200 |
{error && <Text size="xs" c="red" role="alert">{error}</Text>}
|
| 201 |
<Group gap={6} mt={8} wrap="wrap">
|
| 202 |
+
<Button size="compact-sm" variant="filled" onClick={() => void confirm()} loading={busy} data-testid="chat-confirm-button">{action.verb}</Button>
|
| 203 |
{action.review && <Button size="compact-sm" variant="default" component={Link} to={action.review.to}>{action.review.label}</Button>}
|
| 204 |
<Button size="compact-sm" variant="default" ref={cancelRef} onClick={() => void cancel()} disabled={busy}>Cancel</Button>
|
| 205 |
</Group>
|
web/src/chat/ChatDock.tsx
CHANGED
|
@@ -178,7 +178,7 @@ function ChatPanel({ dock, onClose }: { dock: ChatDockState; onClose: () => void
|
|
| 178 |
<div className="fpt-chat-input">
|
| 179 |
<Textarea ref={inputRef} aria-label="Ask the co-worker" placeholder="Ask about this patch… (Ctrl+K)" autosize minRows={1} maxRows={5} value={text} maxLength={2000}
|
| 180 |
onChange={(e) => setText(e.currentTarget.value)} onKeyDown={onKeyDown} style={{ flex: 1 }} />
|
| 181 |
-
<Button size="sm" px={10} aria-label="Send" onClick={() => void send(text)} loading={busy} disabled={!text.trim()}><IconSend size={14} /></Button>
|
| 182 |
</div>
|
| 183 |
</div>
|
| 184 |
</div>
|
|
|
|
| 178 |
<div className="fpt-chat-input">
|
| 179 |
<Textarea ref={inputRef} aria-label="Ask the co-worker" placeholder="Ask about this patch… (Ctrl+K)" autosize minRows={1} maxRows={5} value={text} maxLength={2000}
|
| 180 |
onChange={(e) => setText(e.currentTarget.value)} onKeyDown={onKeyDown} style={{ flex: 1 }} />
|
| 181 |
+
<Button size="sm" px={10} variant="filled" aria-label="Send" onClick={() => void send(text)} loading={busy} disabled={!text.trim()}><IconSend size={14} /></Button>
|
| 182 |
</div>
|
| 183 |
</div>
|
| 184 |
</div>
|
web/src/components/GraphView.tsx
CHANGED
|
@@ -34,7 +34,7 @@ export function GraphView({ states, compact = false, nowFor }: { states?: States
|
|
| 34 |
<div style={{ display: 'flex', alignItems: 'center', gap: 8, justifyContent: 'space-between' }}>
|
| 35 |
<span style={{ display: 'flex', alignItems: 'center', gap: 8, minWidth: 0 }}>
|
| 36 |
<span className="fpt-dot" style={{ background: `var(--pill-${a?.tone ?? 'neutral'}-fg)` }} aria-hidden />
|
| 37 |
-
<Text size="sm" fw={
|
| 38 |
{s.count > 1 && <Pill tone="lav">x{s.count}</Pill>}
|
| 39 |
</span>
|
| 40 |
{states ? <Pill tone={STATE_TONE[s.state]}>{STATE_LABEL[s.state]}</Pill>
|
|
|
|
| 34 |
<div style={{ display: 'flex', alignItems: 'center', gap: 8, justifyContent: 'space-between' }}>
|
| 35 |
<span style={{ display: 'flex', alignItems: 'center', gap: 8, minWidth: 0 }}>
|
| 36 |
<span className="fpt-dot" style={{ background: `var(--pill-${a?.tone ?? 'neutral'}-fg)` }} aria-hidden />
|
| 37 |
+
<Text size="sm" fw={600} truncate title={`graph node: ${n}`}>{compact ? stepName(n) : a?.name ?? n}</Text>
|
| 38 |
{s.count > 1 && <Pill tone="lav">x{s.count}</Pill>}
|
| 39 |
</span>
|
| 40 |
{states ? <Pill tone={STATE_TONE[s.state]}>{STATE_LABEL[s.state]}</Pill>
|
web/src/components/common.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
-
import { Alert,
|
| 2 |
-
import { IconChevronRight, IconHelp, IconShieldLock } from '@tabler/icons-react';
|
| 3 |
import type { ReactNode } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import { errorMessage } from '../api/client';
|
|
@@ -15,7 +15,7 @@ export function MockBanner({ fusion = false }: { fusion?: boolean }) {
|
|
| 15 |
title={fusion ? 'Runs target either the practice app or a connected Oracle Fusion test pod; every run says which.'
|
| 16 |
: 'Every test run targets the local mock app. Results say nothing about a real Oracle Fusion pod.'}>
|
| 17 |
<IconShieldLock size={13} aria-hidden />
|
| 18 |
-
<span>{fusion ?
|
| 19 |
</div>
|
| 20 |
);
|
| 21 |
}
|
|
@@ -27,6 +27,16 @@ export function Pill({ tone = 'neutral', icon, children, testId, title, outline
|
|
| 27 |
return <span className="fpt-pill" data-tone={tone} data-outline={outline || undefined} data-testid={testId} title={title}>{icon}{children}</span>;
|
| 28 |
}
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
/** Page header with the same props as before; it renders the app's top bar (title, sub-line with the breadcrumb and
|
| 31 |
* the extra pills, page actions on the right). */
|
| 32 |
export function PageHeader({ crumbs, title, children, extra }: { crumbs: { label: string; to?: string }[]; title: ReactNode; children?: ReactNode; extra?: ReactNode }) {
|
|
@@ -64,27 +74,28 @@ export function StatusBadge({ status }: { status?: string | null }) {
|
|
| 64 |
/** Decision in consultant words ("Ready" / "Not ready" / "On hold"); the exact rule result stays on the element
|
| 65 |
* (data-rule) and in the tooltip, and RuleResult shows it in reports for audit. */
|
| 66 |
export function DecisionBadge({ decision, size = 'md' }: { decision?: string | null; size?: 'sm' | 'md' | 'lg' | 'xl' }) {
|
| 67 |
-
if (!decision) return <
|
| 68 |
-
const
|
|
|
|
| 69 |
return (
|
| 70 |
<Tooltip label="Decided by the QA rule from this test run's results. The exact rule result is under Audit details in the report.">
|
| 71 |
-
<
|
| 72 |
</Tooltip>
|
| 73 |
);
|
| 74 |
}
|
| 75 |
|
| 76 |
/** The exact go/no-go rule result, for audit. */
|
| 77 |
export function RuleResult({ decision }: { decision?: string | null }) {
|
| 78 |
-
return <
|
| 79 |
}
|
| 80 |
|
| 81 |
/** A consultant word with its meaning (and the technical term) on hover/focus. */
|
| 82 |
-
export function Term({ children, k }: { children: ReactNode; k?: string }) {
|
| 83 |
const g = GLOSSARY.find((x) => x.term.toLowerCase() === String(k ?? children).toLowerCase());
|
| 84 |
if (!g) return <>{children}</>;
|
| 85 |
return (
|
| 86 |
<Tooltip label={`${g.means} (technical name: ${g.technical})`} multiline w={300} withArrow>
|
| 87 |
-
<span tabIndex={0} style={{ borderBottom: '1px dotted currentColor', cursor: 'help' }}>{children}</span>
|
| 88 |
</Tooltip>
|
| 89 |
);
|
| 90 |
}
|
|
|
|
| 1 |
+
import { Alert, Code, Group, Pagination, Popover, Text, Tooltip } from '@mantine/core';
|
| 2 |
+
import { IconChevronRight, IconHelp, IconRobot, IconShieldLock } from '@tabler/icons-react';
|
| 3 |
import type { ReactNode } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import { errorMessage } from '../api/client';
|
|
|
|
| 15 |
title={fusion ? 'Runs target either the practice app or a connected Oracle Fusion test pod; every run says which.'
|
| 16 |
: 'Every test run targets the local mock app. Results say nothing about a real Oracle Fusion pod.'}>
|
| 17 |
<IconShieldLock size={13} aria-hidden />
|
| 18 |
+
<span>{fusion ? 'Test environments: practice app and Oracle Fusion test pod' : `Practice environment: ${MOCK_TEXT}`}</span>
|
| 19 |
</div>
|
| 20 |
);
|
| 21 |
}
|
|
|
|
| 27 |
return <span className="fpt-pill" data-tone={tone} data-outline={outline || undefined} data-testid={testId} title={title}>{icon}{children}</span>;
|
| 28 |
}
|
| 29 |
|
| 30 |
+
/** "Written by the AI model" as dim text with a robot icon (not a coloured pill). */
|
| 31 |
+
export function AiText({ children = 'Written by the AI model' }: { children?: ReactNode }) {
|
| 32 |
+
return <span className="fpt-aitext"><IconRobot size={14} aria-hidden />{children}</span>;
|
| 33 |
+
}
|
| 34 |
+
|
| 35 |
+
/** A priority word ("Critical") as plain 600-weight text: priority is not a state to act on. */
|
| 36 |
+
export function Prio({ words }: { words: string }) {
|
| 37 |
+
return <span className="fpt-prio">{words}</span>;
|
| 38 |
+
}
|
| 39 |
+
|
| 40 |
/** Page header with the same props as before; it renders the app's top bar (title, sub-line with the breadcrumb and
|
| 41 |
* the extra pills, page actions on the right). */
|
| 42 |
export function PageHeader({ crumbs, title, children, extra }: { crumbs: { label: string; to?: string }[]; title: ReactNode; children?: ReactNode; extra?: ReactNode }) {
|
|
|
|
| 74 |
/** Decision in consultant words ("Ready" / "Not ready" / "On hold"); the exact rule result stays on the element
|
| 75 |
* (data-rule) and in the tooltip, and RuleResult shows it in reports for audit. */
|
| 76 |
export function DecisionBadge({ decision, size = 'md' }: { decision?: string | null; size?: 'sm' | 'md' | 'lg' | 'xl' }) {
|
| 77 |
+
if (!decision) return <span className="fpt-dchip" data-tone="neutral" data-size={size}>Not decided yet</span>;
|
| 78 |
+
const tone = decision === 'GO' ? 'green' : decision === 'HELD' ? 'amber' : 'red';
|
| 79 |
+
// the text content is exactly the verdict words: the dot carries no text
|
| 80 |
return (
|
| 81 |
<Tooltip label="Decided by the QA rule from this test run's results. The exact rule result is under Audit details in the report.">
|
| 82 |
+
<span className="fpt-dchip" data-tone={tone} data-size={size} data-testid="decision-badge" data-rule={decision}><span className="fpt-dchip-dot" aria-hidden />{decisionWords(decision)}</span>
|
| 83 |
</Tooltip>
|
| 84 |
);
|
| 85 |
}
|
| 86 |
|
| 87 |
/** The exact go/no-go rule result, for audit. */
|
| 88 |
export function RuleResult({ decision }: { decision?: string | null }) {
|
| 89 |
+
return <span className="fpt-ruleresult" data-testid="rule-result" title="exact result of the QA rule (C1-C6)">Rule result: {decision ?? 'none'}</span>;
|
| 90 |
}
|
| 91 |
|
| 92 |
/** A consultant word with its meaning (and the technical term) on hover/focus. */
|
| 93 |
+
export function Term({ children, k, plain }: { children: ReactNode; k?: string; plain?: boolean }) {
|
| 94 |
const g = GLOSSARY.find((x) => x.term.toLowerCase() === String(k ?? children).toLowerCase());
|
| 95 |
if (!g) return <>{children}</>;
|
| 96 |
return (
|
| 97 |
<Tooltip label={`${g.means} (technical name: ${g.technical})`} multiline w={300} withArrow>
|
| 98 |
+
<span tabIndex={0} style={plain ? { cursor: 'help' } : { borderBottom: '1px dotted currentColor', cursor: 'help' }}>{children}</span>
|
| 99 |
</Tooltip>
|
| 100 |
);
|
| 101 |
}
|
web/src/components/components.test.tsx
CHANGED
|
@@ -28,7 +28,7 @@ describe('components', () => {
|
|
| 28 |
renderUi(<><DecisionBadge decision="NO-GO" /><RuleResult decision="NO-GO" /></>);
|
| 29 |
expect(screen.getByTestId('decision-badge')).toHaveTextContent('Not ready');
|
| 30 |
expect(screen.getByTestId('decision-badge')).toHaveAttribute('data-rule', 'NO-GO');
|
| 31 |
-
expect(screen.getByTestId('rule-result')).toHaveTextContent('
|
| 32 |
});
|
| 33 |
|
| 34 |
it('failure review choices map onto the unchanged human_review answer format', () => {
|
|
@@ -78,7 +78,7 @@ describe('components', () => {
|
|
| 78 |
fireEvent.click(screen.getByRole('button', { name: 'Skip Rejected requisition for this patch', hidden: true }));
|
| 79 |
fireEvent.click(screen.getByRole('button', { name: 'Approve all 1 Invoice scenarios' }));
|
| 80 |
fireEvent.click(screen.getByRole('button', { name: 'Approve all 1 unchanged' }));
|
| 81 |
-
expect(screen.getByTestId('review-count')).toHaveTextContent('3 of 4 approved
|
| 82 |
fireEvent.click(screen.getByRole('button', { name: 'Submit review' }));
|
| 83 |
await waitFor(() => expect(posts).toHaveLength(1));
|
| 84 |
expect(posts[0]).toEqual({ approved: ['P2P-APR-001', 'P2P-INV-001', 'P2P-PAY-001'], rejected: ['P2P-APR-002'], comments: {} });
|
|
|
|
| 28 |
renderUi(<><DecisionBadge decision="NO-GO" /><RuleResult decision="NO-GO" /></>);
|
| 29 |
expect(screen.getByTestId('decision-badge')).toHaveTextContent('Not ready');
|
| 30 |
expect(screen.getByTestId('decision-badge')).toHaveAttribute('data-rule', 'NO-GO');
|
| 31 |
+
expect(screen.getByTestId('rule-result')).toHaveTextContent('Rule result: NO-GO');
|
| 32 |
});
|
| 33 |
|
| 34 |
it('failure review choices map onto the unchanged human_review answer format', () => {
|
|
|
|
| 78 |
fireEvent.click(screen.getByRole('button', { name: 'Skip Rejected requisition for this patch', hidden: true }));
|
| 79 |
fireEvent.click(screen.getByRole('button', { name: 'Approve all 1 Invoice scenarios' }));
|
| 80 |
fireEvent.click(screen.getByRole('button', { name: 'Approve all 1 unchanged' }));
|
| 81 |
+
expect(screen.getByTestId('review-count')).toHaveTextContent('3 of 4 approved, 1 skipped');
|
| 82 |
fireEvent.click(screen.getByRole('button', { name: 'Submit review' }));
|
| 83 |
await waitFor(() => expect(posts).toHaveLength(1));
|
| 84 |
expect(posts[0]).toEqual({ approved: ['P2P-APR-001', 'P2P-INV-001', 'P2P-PAY-001'], rejected: ['P2P-APR-002'], comments: {} });
|
web/src/components/shell/AppSidebar.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import { Badge, Button, Menu, Tooltip, UnstyledButton, useComputedColorScheme, useMantineColorScheme } from '@mantine/core';
|
| 2 |
import {
|
| 3 |
-
IconCalendarTime, IconFileReport,
|
| 4 |
IconMessageChatbot, IconMoon, IconPlayerPlay, IconPlus, IconServer, IconSettings, IconSun, IconTicket,
|
| 5 |
} from '@tabler/icons-react';
|
| 6 |
import { useMemo, useState, type ReactNode } from 'react';
|
|
@@ -58,7 +58,7 @@ export function groupRuns(items: RunSummary[], max = 12): Group[] {
|
|
| 58 |
let room = Math.max(0, max - needs.length);
|
| 59 |
const run2 = running.slice(0, room); room -= run2.length;
|
| 60 |
const rec2 = recent.slice(0, room);
|
| 61 |
-
return [{ key: 'needs', title: '
|
| 62 |
.filter((g) => g.runs.length);
|
| 63 |
}
|
| 64 |
|
|
@@ -82,14 +82,6 @@ function RunsSection({ rail, onNavigate }: { rail: boolean; onNavigate?: () => v
|
|
| 82 |
}
|
| 83 |
return (
|
| 84 |
<section className="fpt-sb-runs" aria-label="Test runs in the menu">
|
| 85 |
-
<div className="fpt-sb-head">
|
| 86 |
-
<span>Runs</span>
|
| 87 |
-
<Tooltip label={mine ? 'Showing only test runs you started' : 'Show only test runs you started'}>
|
| 88 |
-
<button type="button" className="fpt-iconbtn fpt-iconbtn-sm" aria-pressed={mine} aria-label="Only mine" data-active={mine} onClick={() => setMine((v) => !v)}>
|
| 89 |
-
<IconFilter size={13} />
|
| 90 |
-
</button>
|
| 91 |
-
</Tooltip>
|
| 92 |
-
</div>
|
| 93 |
<div className="fpt-sb-runs-list">
|
| 94 |
{groups.length === 0 && <div className="fpt-sb-empty">{runs.isLoading ? 'Loading…' : mine ? 'You have not started a test run yet.' : 'No test runs yet.'}</div>}
|
| 95 |
{groups.map((g) => (
|
|
@@ -100,6 +92,11 @@ function RunsSection({ rail, onNavigate }: { rail: boolean; onNavigate?: () => v
|
|
| 100 |
))}
|
| 101 |
<Link to="/runs" className="fpt-sb-all" onClick={onNavigate}>Show all test runs</Link>
|
| 102 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 103 |
</section>
|
| 104 |
);
|
| 105 |
}
|
|
|
|
| 1 |
import { Badge, Button, Menu, Tooltip, UnstyledButton, useComputedColorScheme, useMantineColorScheme } from '@mantine/core';
|
| 2 |
import {
|
| 3 |
+
IconCalendarTime, IconFileReport, IconHome, IconLayoutSidebarLeftCollapse, IconLayoutSidebarLeftExpand, IconListCheck, IconLogout,
|
| 4 |
IconMessageChatbot, IconMoon, IconPlayerPlay, IconPlus, IconServer, IconSettings, IconSun, IconTicket,
|
| 5 |
} from '@tabler/icons-react';
|
| 6 |
import { useMemo, useState, type ReactNode } from 'react';
|
|
|
|
| 58 |
let room = Math.max(0, max - needs.length);
|
| 59 |
const run2 = running.slice(0, room); room -= run2.length;
|
| 60 |
const rec2 = recent.slice(0, room);
|
| 61 |
+
return [{ key: 'needs', title: 'Waiting for you', runs: needs }, { key: 'running', title: 'Running', runs: run2 }, { key: 'recent', title: 'Recent', runs: rec2 }]
|
| 62 |
.filter((g) => g.runs.length);
|
| 63 |
}
|
| 64 |
|
|
|
|
| 82 |
}
|
| 83 |
return (
|
| 84 |
<section className="fpt-sb-runs" aria-label="Test runs in the menu">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 85 |
<div className="fpt-sb-runs-list">
|
| 86 |
{groups.length === 0 && <div className="fpt-sb-empty">{runs.isLoading ? 'Loading…' : mine ? 'You have not started a test run yet.' : 'No test runs yet.'}</div>}
|
| 87 |
{groups.map((g) => (
|
|
|
|
| 92 |
))}
|
| 93 |
<Link to="/runs" className="fpt-sb-all" onClick={onNavigate}>Show all test runs</Link>
|
| 94 |
</div>
|
| 95 |
+
<div className="fpt-sb-show" role="group" aria-label="Show test runs">
|
| 96 |
+
<span>Show:</span>
|
| 97 |
+
<button type="button" aria-pressed={!mine} onClick={() => setMine(false)}>All</button>
|
| 98 |
+
<button type="button" aria-pressed={mine} onClick={() => setMine(true)} aria-label="Only mine">Mine</button>
|
| 99 |
+
</div>
|
| 100 |
</section>
|
| 101 |
);
|
| 102 |
}
|
web/src/components/shell/EnvSwitcher.tsx
CHANGED
|
@@ -14,8 +14,8 @@ export function EnvBadge({ kind, name, size = 'xs' }: { kind: EnvKind; name?: st
|
|
| 14 |
return (
|
| 15 |
<span className="fpt-pill fpt-envbadge" data-tone={fusion ? 'blue' : 'amber'} data-size={size}
|
| 16 |
title={fusion ? `Oracle Fusion pod${name ? `: ${name}` : ''}` : `Practice environment${name ? `: ${name}` : ''} (${MOCK_TEXT})`}>
|
| 17 |
-
{fusion ? <IconCloud size={
|
| 18 |
-
{fusion ?
|
| 19 |
</span>
|
| 20 |
);
|
| 21 |
}
|
|
@@ -51,9 +51,8 @@ export function EnvSwitcher({ compact = false }: { compact?: boolean }) {
|
|
| 51 |
const tip = fusion ? `Oracle Fusion pod: ${name}` : `Practice environment: ${name} (${MOCK_TEXT})`;
|
| 52 |
const label = (
|
| 53 |
<span role="note" aria-label="target system" data-testid="mock-banner" className={compact ? 'fpt-sr-only' : 'fpt-env-label'}>
|
| 54 |
-
<
|
| 55 |
-
<span>{name}</span>
|
| 56 |
-
{!fusion && <span>{MOCK_TEXT}</span>}
|
| 57 |
</span>
|
| 58 |
);
|
| 59 |
const groups: [string, Pod[]][] = [['Practice', pods.filter((p) => envKind(p.kind) === 'mock')], ['Oracle Fusion', pods.filter((p) => envKind(p.kind) === 'fusion')]];
|
|
|
|
| 14 |
return (
|
| 15 |
<span className="fpt-pill fpt-envbadge" data-tone={fusion ? 'blue' : 'amber'} data-size={size}
|
| 16 |
title={fusion ? `Oracle Fusion pod${name ? `: ${name}` : ''}` : `Practice environment${name ? `: ${name}` : ''} (${MOCK_TEXT})`}>
|
| 17 |
+
{fusion ? <IconCloud size={13} aria-hidden /> : <IconShieldLock size={13} aria-hidden />}
|
| 18 |
+
{fusion ? `Oracle Fusion pod${name ? `: ${name}` : ''}` : <><span className="fpt-env-long">Practice environment: </span>{MOCK_TEXT}</>}
|
| 19 |
</span>
|
| 20 |
);
|
| 21 |
}
|
|
|
|
| 51 |
const tip = fusion ? `Oracle Fusion pod: ${name}` : `Practice environment: ${name} (${MOCK_TEXT})`;
|
| 52 |
const label = (
|
| 53 |
<span role="note" aria-label="target system" data-testid="mock-banner" className={compact ? 'fpt-sr-only' : 'fpt-env-label'}>
|
| 54 |
+
<span>{fusion ? `Oracle Fusion pod: ${name}` : `Practice environment: ${MOCK_TEXT}`}</span>
|
| 55 |
+
{!fusion && <span className="fpt-env-name">{name}</span>}
|
|
|
|
| 56 |
</span>
|
| 57 |
);
|
| 58 |
const groups: [string, Pod[]][] = [['Practice', pods.filter((p) => envKind(p.kind) === 'mock')], ['Oracle Fusion', pods.filter((p) => envKind(p.kind) === 'fusion')]];
|
web/src/components/shell/RunListItem.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import { Tooltip } from '@mantine/core';
|
|
| 2 |
import { Link } from 'react-router-dom';
|
| 3 |
import type { Schemas } from '../../api/client';
|
| 4 |
import { decisionWords, RUN_STATUS_WORDS } from '../../glossary';
|
| 5 |
-
import { runAreas,
|
| 6 |
import type { EnvKind } from './EnvSwitcher';
|
| 7 |
import { runState, StatusDot } from './StatusDot';
|
| 8 |
|
|
@@ -15,7 +15,12 @@ export const runStatusWords = (r: Pick<RunSummary, 'status' | 'pending_gate'>) =
|
|
| 15 |
: r.status === 'waiting_approval' || r.status === 'waiting_review' ? 'waiting for you'
|
| 16 |
: RUN_STATUS_WORDS[r.status] ?? r.status.replace('_', ' ');
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
/** A test run in the sidebar, like a conversation: state dot, business area, when, where, and what it needs from you. */
|
| 21 |
export function RunListItem({ run, active, compact = false, envKind }: { run: RunSummary; active: boolean; compact?: boolean; envKind?: EnvKind }) {
|
|
@@ -33,18 +38,16 @@ export function RunListItem({ run, active, compact = false, envKind }: { run: Ru
|
|
| 33 |
</Tooltip>
|
| 34 |
);
|
| 35 |
}
|
| 36 |
-
|
| 37 |
-
: run.pending_gate === 'human_review' ? { tone: 'amber', text: 'Decide' }
|
| 38 |
-
: run.status === 'completed' && d ? { tone: DECISION_TONE[d] ?? 'neutral', text: decisionWords(d) } : null;
|
| 39 |
return (
|
| 40 |
<Link to={`/runs/${run.run_id}`} className="fpt-runitem" data-state={state} data-testid={`side-run-${run.run_id}`}
|
| 41 |
aria-current={active ? 'page' : undefined} aria-label={label} title={label}>
|
| 42 |
-
<StatusDot state={state} label={words} decorative />
|
| 43 |
<span className="fpt-runitem-text">
|
| 44 |
<span className="fpt-runitem-title">{runAreas(run)}</span>
|
| 45 |
-
<span className="fpt-runitem-sub">{
|
|
|
|
|
|
|
| 46 |
</span>
|
| 47 |
-
{badge && <span className="fpt-pill" data-tone={badge.tone}>{badge.text}</span>}
|
| 48 |
</Link>
|
| 49 |
);
|
| 50 |
}
|
|
|
|
| 2 |
import { Link } from 'react-router-dom';
|
| 3 |
import type { Schemas } from '../../api/client';
|
| 4 |
import { decisionWords, RUN_STATUS_WORDS } from '../../glossary';
|
| 5 |
+
import { runAreas, runTitle, shortWhen } from '../../runName';
|
| 6 |
import type { EnvKind } from './EnvSwitcher';
|
| 7 |
import { runState, StatusDot } from './StatusDot';
|
| 8 |
|
|
|
|
| 15 |
: r.status === 'waiting_approval' || r.status === 'waiting_review' ? 'waiting for you'
|
| 16 |
: RUN_STATUS_WORDS[r.status] ?? r.status.replace('_', ' ');
|
| 17 |
|
| 18 |
+
/** One short status for a run row: dot + word (UI-SIMPLIFY 3.1). */
|
| 19 |
+
export const rowWords = (r: Pick<RunSummary, 'status' | 'pending_gate'>, decision?: string | null) =>
|
| 20 |
+
r.pending_gate === 'approve_cases' ? 'Needs your approval' : r.pending_gate === 'human_review' ? 'Needs your decision'
|
| 21 |
+
: r.status === 'queued' ? 'Starting' : r.status === 'running' ? 'Testing'
|
| 22 |
+
: r.status === 'completed' ? (decision ? decisionWords(decision) : 'Finished')
|
| 23 |
+
: r.status === 'interrupted' ? 'Paused' : r.status === 'cancelled' ? 'Cancelled' : 'Stopped';
|
| 24 |
|
| 25 |
/** A test run in the sidebar, like a conversation: state dot, business area, when, where, and what it needs from you. */
|
| 26 |
export function RunListItem({ run, active, compact = false, envKind }: { run: RunSummary; active: boolean; compact?: boolean; envKind?: EnvKind }) {
|
|
|
|
| 38 |
</Tooltip>
|
| 39 |
);
|
| 40 |
}
|
| 41 |
+
void envKind;
|
|
|
|
|
|
|
| 42 |
return (
|
| 43 |
<Link to={`/runs/${run.run_id}`} className="fpt-runitem" data-state={state} data-testid={`side-run-${run.run_id}`}
|
| 44 |
aria-current={active ? 'page' : undefined} aria-label={label} title={label}>
|
|
|
|
| 45 |
<span className="fpt-runitem-text">
|
| 46 |
<span className="fpt-runitem-title">{runAreas(run)}</span>
|
| 47 |
+
<span className="fpt-runitem-sub">{shortWhen(run.created_at)}<span aria-hidden> · </span>
|
| 48 |
+
<span className="fpt-runitem-state" data-state={state}><StatusDot state={state} label={words} decorative size={8} />{rowWords(run, d)}</span>
|
| 49 |
+
</span>
|
| 50 |
</span>
|
|
|
|
| 51 |
</Link>
|
| 52 |
);
|
| 53 |
}
|
web/src/components/shell/TopBar.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
| 1 |
import { Button } from '@mantine/core';
|
| 2 |
import { IconMenu2, IconMessageChatbot } from '@tabler/icons-react';
|
| 3 |
import type { ReactNode } from 'react';
|
| 4 |
-
import { MOCK_TEXT } from '../common';
|
| 5 |
import { EnvBadge, envKind, useChosenEnv } from './EnvSwitcher';
|
| 6 |
import { useShell } from './prefs';
|
| 7 |
|
|
@@ -14,7 +13,7 @@ export function TopBar({ title, sub, middle, actions, titleTestId, honesty = tru
|
|
| 14 |
const { pod } = useChosenEnv();
|
| 15 |
const narrow = size === 'tablet'; // phones have Ask in the bottom bar
|
| 16 |
const cue = honesty && !sidebarExpanded && pod && envKind(pod.kind) === 'mock'
|
| 17 |
-
? <span className="fpt-topbar-cue"><EnvBadge kind="mock" />
|
| 18 |
return (
|
| 19 |
<header className="fpt-topbar" data-size={size}>
|
| 20 |
{size === 'tablet' && (
|
|
|
|
| 1 |
import { Button } from '@mantine/core';
|
| 2 |
import { IconMenu2, IconMessageChatbot } from '@tabler/icons-react';
|
| 3 |
import type { ReactNode } from 'react';
|
|
|
|
| 4 |
import { EnvBadge, envKind, useChosenEnv } from './EnvSwitcher';
|
| 5 |
import { useShell } from './prefs';
|
| 6 |
|
|
|
|
| 13 |
const { pod } = useChosenEnv();
|
| 14 |
const narrow = size === 'tablet'; // phones have Ask in the bottom bar
|
| 15 |
const cue = honesty && !sidebarExpanded && pod && envKind(pod.kind) === 'mock'
|
| 16 |
+
? <span className="fpt-topbar-cue"><EnvBadge kind="mock" /></span> : null;
|
| 17 |
return (
|
| 18 |
<header className="fpt-topbar" data-size={size}>
|
| 19 |
{size === 'tablet' && (
|
web/src/components/shell/cockpit.tsx
CHANGED
|
@@ -1,81 +1,20 @@
|
|
| 1 |
-
import {
|
| 2 |
-
import {
|
| 3 |
-
import { usePatchWatch, usePodProfile, usePods, useRuns } from '../../api/hooks';
|
| 4 |
-
import type { ModuleReadiness } from '../../api/types';
|
| 5 |
-
import { runTitle, shortWhen } from '../../runName';
|
| 6 |
-
import { Can } from '../common';
|
| 7 |
-
import { EnvBadge, envKind } from './EnvSwitcher';
|
| 8 |
-
import { runState, StatusDot } from './StatusDot';
|
| 9 |
|
| 10 |
-
/** The
|
| 11 |
-
* "Next update" is shown only when the API gives a date; it is never guessed. */
|
| 12 |
-
export function
|
| 13 |
const pods = usePods().data ?? [];
|
| 14 |
const pod = pods.find((p) => p.id === podId);
|
| 15 |
const profile = usePodProfile();
|
| 16 |
const watch = usePatchWatch();
|
| 17 |
const release = profile.data?.about?.release ?? pod?.release ?? null;
|
| 18 |
const checked = watch.data?.last_checked_at ?? profile.data?.scanned_at ?? null;
|
| 19 |
-
const
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
<EnvBadge kind={fusion ? 'fusion' : 'mock'} name={pod?.name} />
|
| 27 |
-
</div>
|
| 28 |
-
<Text size="sm" mt={4}>
|
| 29 |
-
{fusion ? `Results come from the Oracle Fusion pod ${pod?.name ?? ''}.` : 'Practice environment: results say nothing about a real Oracle Fusion pod.'}
|
| 30 |
-
</Text>
|
| 31 |
-
</section>
|
| 32 |
-
);
|
| 33 |
-
}
|
| 34 |
-
|
| 35 |
-
export const KPI_VERDICTS = ['Ready', 'Not ready', 'Waiting for you', 'Testing', 'Not tested yet'] as const;
|
| 36 |
-
const KPI_TONE: Record<string, string> = { Ready: 'green', 'Not ready': 'red', 'Waiting for you': 'amber', Testing: 'blue', 'Not tested yet': 'neutral' };
|
| 37 |
-
|
| 38 |
-
/** Counts of business-area verdicts; each tile is a toggle that filters the cards below (client side). */
|
| 39 |
-
export function KpiTiles({ modules, value, onChange }: { modules: ModuleReadiness[]; value: string | null; onChange: (verdict: string | null) => void }) {
|
| 40 |
-
return (
|
| 41 |
-
<div className="fpt-kpis" role="group" aria-label="Business areas by verdict">
|
| 42 |
-
{KPI_VERDICTS.map((v) => {
|
| 43 |
-
const n = modules.filter((m) => m.verdict === v).length;
|
| 44 |
-
const on = value === v;
|
| 45 |
-
return (
|
| 46 |
-
<button key={v} type="button" className="fpt-kpi" data-tone={KPI_TONE[v]} data-zero={n === 0 || undefined} aria-pressed={on} data-testid={`kpi-${v.toLowerCase().replace(/ /g, '-')}`}
|
| 47 |
-
onClick={() => onChange(on ? null : v)}>
|
| 48 |
-
<span className="fpt-kpi-n fpt-num">{n}</span><span className="fpt-kpi-label">{v}</span>
|
| 49 |
-
</button>
|
| 50 |
-
);
|
| 51 |
-
})}
|
| 52 |
-
</div>
|
| 53 |
-
);
|
| 54 |
-
}
|
| 55 |
-
|
| 56 |
-
/** Test runs waiting for a person, with the gate in words and the way to it. Hidden when nothing waits. */
|
| 57 |
-
export function NeedsYouList({ limit = 5 }: { limit?: number }) {
|
| 58 |
-
const runs = useRuns(40, 0);
|
| 59 |
-
const waiting = (runs.data?.items ?? []).filter((r) => r.pending_gate && !['completed', 'failed', 'killed', 'cancelled'].includes(r.status)).slice(0, limit);
|
| 60 |
-
if (!waiting.length) return null;
|
| 61 |
-
return (
|
| 62 |
-
<section className="fpt-card fpt-needs" aria-label="Needs you">
|
| 63 |
-
<div className="fpt-needs-head">Needs you</div>
|
| 64 |
-
{waiting.map((r) => {
|
| 65 |
-
const approve = r.pending_gate === 'approve_cases';
|
| 66 |
-
return (
|
| 67 |
-
<div key={r.run_id} className="fpt-needs-row" data-testid={`needs-${r.run_id}`}>
|
| 68 |
-
<StatusDot state={runState(r)} label={approve ? 'waiting for you to approve the scenarios' : 'waiting for your decision on failures'} decorative />
|
| 69 |
-
<div style={{ flex: '1 1 auto', minWidth: 0 }}>
|
| 70 |
-
<Text size="sm" fw={500} truncate>{runTitle(r)}</Text>
|
| 71 |
-
<Text size="xs" c="dimmed">{approve ? 'Scenarios waiting for your approval' : 'Failed scenarios waiting for your decision'}</Text>
|
| 72 |
-
</div>
|
| 73 |
-
<Can perm={approve ? 'gate.approve_cases' : 'gate.human_review'} fallback={<Button size="compact-xs" variant="default" component={Link} to={`/runs/${r.run_id}`}>Open the test run</Button>}>
|
| 74 |
-
<Button size="compact-xs" component={Link} to={`/runs/${r.run_id}/${approve ? 'scenarios' : 'failures'}`}>{approve ? 'Open your review' : 'Open failure review'}</Button>
|
| 75 |
-
</Can>
|
| 76 |
-
</div>
|
| 77 |
-
);
|
| 78 |
-
})}
|
| 79 |
-
</section>
|
| 80 |
-
);
|
| 81 |
}
|
|
|
|
| 1 |
+
import { usePatchWatch, usePodProfile, usePods } from '../../api/hooks';
|
| 2 |
+
import { shortWhen } from '../../runName';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
|
| 4 |
+
/** The release the readiness is about, as the page's one-line sub-title: "Patch 26C. Pod release 26C, checked 18 Oct 23:53."
|
| 5 |
+
* "Next Oracle update" is shown only when the API gives a date; it is never guessed. The environment cue lives in the top bar. */
|
| 6 |
+
export function ReleaseLine({ podId, patch, nextUpdate }: { podId: number | null; patch: string | null; nextUpdate?: string | null }) {
|
| 7 |
const pods = usePods().data ?? [];
|
| 8 |
const pod = pods.find((p) => p.id === podId);
|
| 9 |
const profile = usePodProfile();
|
| 10 |
const watch = usePatchWatch();
|
| 11 |
const release = profile.data?.about?.release ?? pod?.release ?? null;
|
| 12 |
const checked = watch.data?.last_checked_at ?? profile.data?.scanned_at ?? null;
|
| 13 |
+
const parts = [
|
| 14 |
+
patch ? `Patch ${patch}.` : '',
|
| 15 |
+
release ? `Pod release ${release}${checked ? `, checked ${shortWhen(checked)}` : ''}.` : '',
|
| 16 |
+
nextUpdate ? `Next Oracle update: ${shortWhen(nextUpdate).replace(/ \d\d:\d\d$/, '')}.` : '',
|
| 17 |
+
].filter(Boolean);
|
| 18 |
+
if (!parts.length) return null;
|
| 19 |
+
return <span className="fpt-release-line" data-testid="release-line">{parts.join(' ')}</span>;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
}
|
web/src/components/shell/panelTabs.tsx
CHANGED
|
@@ -7,9 +7,9 @@ import { useGate, useReport, useRun, useRunReadiness, useRunScenarios, useScenar
|
|
| 7 |
import type { ApproveGate } from '../../api/types';
|
| 8 |
import { scriptUrl } from '../../pages/RunGuide';
|
| 9 |
import { RunScripts } from '../../pages/RunData';
|
| 10 |
-
import { OUTCOME,
|
| 11 |
import { decisionSentence } from '../../pages/SignOffReport';
|
| 12 |
-
import { Can, DecisionBadge, ErrorAlert,
|
| 13 |
import { EmptyState } from './EmptyState';
|
| 14 |
|
| 15 |
const ORIGIN: Record<string, { label: string; tone: string }> = {
|
|
@@ -17,7 +17,7 @@ const ORIGIN: Record<string, { label: string; tone: string }> = {
|
|
| 17 |
};
|
| 18 |
|
| 19 |
/** Panel Report tab: the verdict per business area, the counts, the downloads and the way to the full report. */
|
| 20 |
-
export function ReportSummary({ runId }: { runId: string }) {
|
| 21 |
const run = useRun(runId);
|
| 22 |
const done = run.data?.status === 'completed';
|
| 23 |
const rep = useReport(runId);
|
|
@@ -38,15 +38,17 @@ export function ReportSummary({ runId }: { runId: string }) {
|
|
| 38 |
<Stack gap="sm">
|
| 39 |
<ErrorAlert error={rep.error} />
|
| 40 |
{Object.entries(decisions).map(([m, d]) => (
|
| 41 |
-
<div key={m}
|
| 42 |
-
|
| 43 |
-
<
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
|
|
|
|
|
|
| 47 |
{rep.data?.files?.[m]?.pdf && (
|
| 48 |
<Button component="a" href={`/api/runs/${encodeURIComponent(runId)}/report/${m}/pdf`} download variant="default" size="xs" mt={8}
|
| 49 |
-
leftSection={<IconFileTypePdf size={13} />} data-testid="panel-pdf-link">Download PDF</Button>
|
| 50 |
)}
|
| 51 |
</div>
|
| 52 |
))}
|
|
@@ -61,7 +63,7 @@ export function ReportSummary({ runId }: { runId: string }) {
|
|
| 61 |
<CopyButton value={link}>{({ copied, copy }) => <Button size="xs" variant="default" onClick={copy} leftSection={copied ? <IconCheck size={13} /> : <IconLink size={13} />}>{copied ? 'Link copied' : 'Share'}</Button>}</CopyButton>
|
| 62 |
<Button component="a" href={scriptUrl(runId)} download variant="default" size="xs" leftSection={<IconFileSpreadsheet size={13} />} data-testid="panel-results-excel">Download the results (Excel)</Button>
|
| 63 |
</Group>
|
| 64 |
-
<Button component={Link} to={`/runs/${runId}/report`} leftSection={<IconFileReport size={14} />}>Open the full report and sign
|
| 65 |
</Stack>
|
| 66 |
);
|
| 67 |
}
|
|
@@ -103,11 +105,14 @@ export function ExcelPanel({ runId, finished }: { runId: string; finished: boole
|
|
| 103 |
|
| 104 |
/** Panel Steps tab: one scenario, in the words of the review rows, for the selected `?scenario=`. */
|
| 105 |
export function ScenarioSteps({ runId, scenarioId }: { runId?: string; scenarioId: string | null }) {
|
|
|
|
|
|
|
| 106 |
const sc = useRunScenarios(runId ?? '');
|
| 107 |
const gate = useGate(runId ?? '', !!runId);
|
| 108 |
const inRun = (sc.data?.scenarios ?? []).find((x) => x.id === scenarioId);
|
| 109 |
-
const lib = useScenario(scenarioId && !inRun
|
| 110 |
-
const
|
|
|
|
| 111 |
// a scenario that has not loaded in 10 s gets an error line with Try again (never an endless spinner)
|
| 112 |
const [slow, setSlow] = useState(false);
|
| 113 |
useEffect(() => {
|
|
@@ -116,10 +121,10 @@ export function ScenarioSteps({ runId, scenarioId }: { runId?: string; scenarioI
|
|
| 116 |
const t = window.setTimeout(() => setSlow(true), 10_000);
|
| 117 |
return () => window.clearTimeout(t);
|
| 118 |
}, [loading, scenarioId]);
|
| 119 |
-
const retry = () => { setSlow(false);
|
| 120 |
if (!scenarioId) return <EmptyState icon={<IconListNumbers size={28} />} title="Pick a scenario to see its steps here" body="Use “Show steps” on a scenario or a screen." />;
|
| 121 |
-
const s =
|
| 122 |
-
if (loading && slow || (!loading && !s &&
|
| 123 |
return (
|
| 124 |
<Stack gap={8} role="alert">
|
| 125 |
<Text size="sm">{slow ? 'The scenario is taking too long to load.' : 'The scenario could not be loaded.'}</Text>
|
|
@@ -141,12 +146,12 @@ export function ScenarioSteps({ runId, scenarioId }: { runId?: string; scenarioI
|
|
| 141 |
const out = s.outcome ? OUTCOME[s.outcome] : undefined;
|
| 142 |
return (
|
| 143 |
<Stack gap={8}>
|
| 144 |
-
<Text size="xs" c="dimmed"
|
| 145 |
<Text fw={600}>{s.title}</Text>
|
| 146 |
-
<Group gap={
|
| 147 |
-
<
|
| 148 |
-
|
| 149 |
-
{out && <
|
| 150 |
</Group>
|
| 151 |
<ScenarioBody s={s} p={p} />
|
| 152 |
</Stack>
|
|
|
|
| 7 |
import type { ApproveGate } from '../../api/types';
|
| 8 |
import { scriptUrl } from '../../pages/RunGuide';
|
| 9 |
import { RunScripts } from '../../pages/RunData';
|
| 10 |
+
import { OUTCOME, ScenarioBody } from '../../pages/ScenarioReview';
|
| 11 |
import { decisionSentence } from '../../pages/SignOffReport';
|
| 12 |
+
import { AiText, Can, DecisionBadge, ErrorAlert, Prio } from '../common';
|
| 13 |
import { EmptyState } from './EmptyState';
|
| 14 |
|
| 15 |
const ORIGIN: Record<string, { label: string; tone: string }> = {
|
|
|
|
| 17 |
};
|
| 18 |
|
| 19 |
/** Panel Report tab: the verdict per business area, the counts, the downloads and the way to the full report. */
|
| 20 |
+
export function ReportSummary({ runId, hideVerdict = false }: { runId: string; hideVerdict?: boolean }) {
|
| 21 |
const run = useRun(runId);
|
| 22 |
const done = run.data?.status === 'completed';
|
| 23 |
const rep = useReport(runId);
|
|
|
|
| 38 |
<Stack gap="sm">
|
| 39 |
<ErrorAlert error={rep.error} />
|
| 40 |
{Object.entries(decisions).map(([m, d]) => (
|
| 41 |
+
<div key={m}>
|
| 42 |
+
{!hideVerdict && (
|
| 43 |
+
<Group justify="space-between" wrap="nowrap" gap={8}>
|
| 44 |
+
<Text fw={600} size="sm">{MODULE_NAMES[m] ?? m}</Text>
|
| 45 |
+
<DecisionBadge decision={d} size="sm" />
|
| 46 |
+
</Group>
|
| 47 |
+
)}
|
| 48 |
+
{!hideVerdict && <Text size="sm" mt={6}>{decisionSentence(d, rep.data?.criteria?.[m] ?? {}, rep.data?.target)}</Text>}
|
| 49 |
{rep.data?.files?.[m]?.pdf && (
|
| 50 |
<Button component="a" href={`/api/runs/${encodeURIComponent(runId)}/report/${m}/pdf`} download variant="default" size="xs" mt={8}
|
| 51 |
+
leftSection={<IconFileTypePdf size={13} />} data-testid="panel-pdf-link">Download PDF{Object.keys(decisions).length > 1 ? ` (${m})` : ''}</Button>
|
| 52 |
)}
|
| 53 |
</div>
|
| 54 |
))}
|
|
|
|
| 63 |
<CopyButton value={link}>{({ copied, copy }) => <Button size="xs" variant="default" onClick={copy} leftSection={copied ? <IconCheck size={13} /> : <IconLink size={13} />}>{copied ? 'Link copied' : 'Share'}</Button>}</CopyButton>
|
| 64 |
<Button component="a" href={scriptUrl(runId)} download variant="default" size="xs" leftSection={<IconFileSpreadsheet size={13} />} data-testid="panel-results-excel">Download the results (Excel)</Button>
|
| 65 |
</Group>
|
| 66 |
+
<Button component={Link} to={`/runs/${runId}/report`} leftSection={<IconFileReport size={14} />}>{rd.data?.signoff ? 'Open the full report' : 'Open the full report and sign off'}</Button>
|
| 67 |
</Stack>
|
| 68 |
);
|
| 69 |
}
|
|
|
|
| 105 |
|
| 106 |
/** Panel Steps tab: one scenario, in the words of the review rows, for the selected `?scenario=`. */
|
| 107 |
export function ScenarioSteps({ runId, scenarioId }: { runId?: string; scenarioId: string | null }) {
|
| 108 |
+
// The run's full scenario list is large (~250 KB) and slow on a busy machine; the Steps tab must not wait for it.
|
| 109 |
+
// Use it when it is already loaded, and otherwise fetch the one selected scenario directly (a few KB).
|
| 110 |
const sc = useRunScenarios(runId ?? '');
|
| 111 |
const gate = useGate(runId ?? '', !!runId);
|
| 112 |
const inRun = (sc.data?.scenarios ?? []).find((x) => x.id === scenarioId);
|
| 113 |
+
const lib = useScenario(scenarioId && !inRun ? scenarioId : null, runId);
|
| 114 |
+
const found = inRun ?? lib.data;
|
| 115 |
+
const loading = !!scenarioId && !found && !lib.isError;
|
| 116 |
// a scenario that has not loaded in 10 s gets an error line with Try again (never an endless spinner)
|
| 117 |
const [slow, setSlow] = useState(false);
|
| 118 |
useEffect(() => {
|
|
|
|
| 121 |
const t = window.setTimeout(() => setSlow(true), 10_000);
|
| 122 |
return () => window.clearTimeout(t);
|
| 123 |
}, [loading, scenarioId]);
|
| 124 |
+
const retry = () => { setSlow(false); if (scenarioId && !inRun) void lib.refetch(); };
|
| 125 |
if (!scenarioId) return <EmptyState icon={<IconListNumbers size={28} />} title="Pick a scenario to see its steps here" body="Use “Show steps” on a scenario or a screen." />;
|
| 126 |
+
const s = found;
|
| 127 |
+
if ((loading && slow) || (!loading && !s && lib.isError)) {
|
| 128 |
return (
|
| 129 |
<Stack gap={8} role="alert">
|
| 130 |
<Text size="sm">{slow ? 'The scenario is taking too long to load.' : 'The scenario could not be loaded.'}</Text>
|
|
|
|
| 146 |
const out = s.outcome ? OUTCOME[s.outcome] : undefined;
|
| 147 |
return (
|
| 148 |
<Stack gap={8}>
|
| 149 |
+
<Text size="xs" c="dimmed">Steps of <span className="fpt-idpill">{s.id}</span></Text>
|
| 150 |
<Text fw={600}>{s.title}</Text>
|
| 151 |
+
<Group gap={10} wrap="wrap">
|
| 152 |
+
<Prio words={s.priority_words} />
|
| 153 |
+
{origin.tone === 'lav' && origin.label !== 'New' ? <AiText>{origin.label}</AiText> : <span className="fpt-dimtext">{origin.label}</span>}
|
| 154 |
+
{out && <span className="fpt-dimtext">In this run: <span className="fpt-statustext" data-tone={out.tone}>{out.label}</span></span>}
|
| 155 |
</Group>
|
| 156 |
<ScenarioBody s={s} p={p} />
|
| 157 |
</Stack>
|
web/src/components/shell/shell.test.tsx
CHANGED
|
@@ -35,7 +35,7 @@ describe('shell', () => {
|
|
| 35 |
run('4', 'waiting_review', { pending_gate: 'human_review' }),
|
| 36 |
];
|
| 37 |
const g = groupRuns(items, 12);
|
| 38 |
-
expect(g.map((x) => x.title)).toEqual(['
|
| 39 |
expect(g[0].runs.map((r) => r.run_id)).toEqual(['2', '4']);
|
| 40 |
expect(g[1].runs.map((r) => r.run_id)).toEqual(['1', '3']);
|
| 41 |
expect(g.flatMap((x) => x.runs)).toHaveLength(12);
|
|
@@ -60,7 +60,7 @@ describe('run stage card', () => {
|
|
| 60 |
const { screen } = await import('@testing-library/react');
|
| 61 |
renderUi(<StageCard stage="judge"><p>body</p></StageCard>);
|
| 62 |
expect(screen.getByTestId('run-guide')).toHaveAttribute('data-stage', 'judge');
|
| 63 |
-
expect(screen.getByText('
|
| 64 |
expect(screen.getByRole('img', { name: 'Progress of this test run: stage 3 of 4, Your decision' })).toBeInTheDocument();
|
| 65 |
});
|
| 66 |
});
|
|
|
|
| 35 |
run('4', 'waiting_review', { pending_gate: 'human_review' }),
|
| 36 |
];
|
| 37 |
const g = groupRuns(items, 12);
|
| 38 |
+
expect(g.map((x) => x.title)).toEqual(['Waiting for you', 'Running', 'Recent']);
|
| 39 |
expect(g[0].runs.map((r) => r.run_id)).toEqual(['2', '4']);
|
| 40 |
expect(g[1].runs.map((r) => r.run_id)).toEqual(['1', '3']);
|
| 41 |
expect(g.flatMap((x) => x.runs)).toHaveLength(12);
|
|
|
|
| 60 |
const { screen } = await import('@testing-library/react');
|
| 61 |
renderUi(<StageCard stage="judge"><p>body</p></StageCard>);
|
| 62 |
expect(screen.getByTestId('run-guide')).toHaveAttribute('data-stage', 'judge');
|
| 63 |
+
expect(screen.getByText('Step 3 of 4: your decision')).toBeInTheDocument();
|
| 64 |
expect(screen.getByRole('img', { name: 'Progress of this test run: stage 3 of 4, Your decision' })).toBeInTheDocument();
|
| 65 |
});
|
| 66 |
});
|
web/src/main.tsx
CHANGED
|
@@ -1,5 +1,4 @@
|
|
| 1 |
import '@fontsource/poppins/400.css';
|
| 2 |
-
import '@fontsource/poppins/500.css';
|
| 3 |
import '@fontsource/poppins/600.css';
|
| 4 |
import '@mantine/core/styles.css';
|
| 5 |
import '@mantine/notifications/styles.css';
|
|
|
|
| 1 |
import '@fontsource/poppins/400.css';
|
|
|
|
| 2 |
import '@fontsource/poppins/600.css';
|
| 3 |
import '@mantine/core/styles.css';
|
| 4 |
import '@mantine/notifications/styles.css';
|
web/src/pages/AdminPages.tsx
CHANGED
|
@@ -1,12 +1,10 @@
|
|
| 1 |
-
import { Alert,
|
| 2 |
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { api, unwrap } from '../api/client';
|
| 5 |
-
import { useAutonomy, useConfig, useHealth, useKill,
|
| 6 |
import { Can, ErrorAlert, fmtTs, pct, PageHeader } from '../components/common';
|
| 7 |
|
| 8 |
-
const MODULES = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP'];
|
| 9 |
-
|
| 10 |
export function KillSwitchPage() {
|
| 11 |
const kill = useKill();
|
| 12 |
const health = useHealth();
|
|
@@ -22,29 +20,30 @@ export function KillSwitchPage() {
|
|
| 22 |
return (
|
| 23 |
<Stack>
|
| 24 |
<PageHeader crumbs={[{ label: 'Home', to: '/runs' }, { label: 'Administration' }, { label: 'Kill switch' }]} title="Kill switch" />
|
| 25 |
-
<
|
| 26 |
-
<
|
| 27 |
-
|
| 28 |
-
|
|
|
|
| 29 |
{k?.engaged && <Text size="sm">{k.reason} - by {k.actor} since {fmtTs(k.since)}</Text>}
|
| 30 |
<Text size="xs" c="dimmed">Engaging stops the active run and its Playwright process tree, blocks all egress (pod, web, LLM, tickets) and refuses new runs. Also settable by creating var/KILL.</Text>
|
| 31 |
</div>
|
| 32 |
-
<Can perm="admin" fallback={<
|
| 33 |
<Stack gap="xs">
|
| 34 |
<TextInput label="Reason" value={reason} onChange={(e) => setReason(e.currentTarget.value)} />
|
| 35 |
{k?.engaged
|
| 36 |
? <Button onClick={() => m.mutate(false)} loading={m.isPending}>Release</Button>
|
| 37 |
-
: <Button color="red" onClick={() => m.mutate(true)} loading={m.isPending}>Engage kill switch</Button>}
|
| 38 |
</Stack>
|
| 39 |
</Can>
|
| 40 |
</Group>
|
| 41 |
<ErrorAlert error={m.error} />
|
| 42 |
-
</
|
| 43 |
-
<
|
| 44 |
-
<
|
| 45 |
<Text size="sm">Mock app: {health.data?.mock_up ? 'up' : 'DOWN'} - Ollama: {health.data?.ollama_up ? 'up' : 'off/down'} - frontier: {health.data?.frontier_configured ? 'configured' : 'not configured'}</Text>
|
| 46 |
<Text size="sm">LLM routing: stub (always) - local: {String(providers.local ?? 'none')} - frontier: {String(providers.frontier ?? 'off')} - local model {String(cfg.data?.ollama_model ?? '')}</Text>
|
| 47 |
-
</
|
| 48 |
</Stack>
|
| 49 |
);
|
| 50 |
}
|
|
@@ -62,12 +61,12 @@ export function AutonomyPage() {
|
|
| 62 |
<Text size="sm" c="dimmed">L0: humans approve every new/changed/generated case. L1: approved library cases and patch-touched cases auto-approve. L2: generated drafts too. Real-defect confirmation and tickets are never autonomous. Promotion is refused unless the metrics meet the thresholds; demotion is always allowed.</Text>
|
| 63 |
<ErrorAlert error={q.error || m.error} title="Change refused" />
|
| 64 |
<Table.ScrollContainer minWidth={760}>
|
| 65 |
-
<Table
|
| 66 |
<Table.Thead><Table.Tr><Table.Th>Module</Table.Th><Table.Th>Level</Table.Th><Table.Th>Approval decisions</Table.Th><Table.Th>Approval rate</Table.Th><Table.Th>Defect recall</Table.Th><Table.Th>Can promote</Table.Th><Table.Th>Set</Table.Th></Table.Tr></Table.Thead>
|
| 67 |
<Table.Tbody>
|
| 68 |
{Object.entries(q.data ?? {}).map(([mod, a]) => (
|
| 69 |
<Table.Tr key={mod}>
|
| 70 |
-
<Table.Td>{mod}</Table.Td><Table.Td><
|
| 71 |
<Table.Td>{a.metrics.n_approval_decisions} / {a.thresholds.min_labels}</Table.Td>
|
| 72 |
<Table.Td>{pct(a.metrics.case_approval_rate)} (min {pct(a.thresholds.min_agreement)})</Table.Td>
|
| 73 |
<Table.Td>{pct(a.metrics.real_defect_recall)} (min {pct(a.thresholds.min_recall)})</Table.Td>
|
|
@@ -84,61 +83,8 @@ export function AutonomyPage() {
|
|
| 84 |
);
|
| 85 |
}
|
| 86 |
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
const pw = usePatchWatch();
|
| 90 |
-
const qc = useQueryClient();
|
| 91 |
-
const [kind, setKind] = useState<'interval' | 'daily'>('daily');
|
| 92 |
-
const [every, setEvery] = useState<number | string>(1440);
|
| 93 |
-
const [at, setAt] = useState('02:00');
|
| 94 |
-
const [mods, setMods] = useState<string[]>(['P2P']);
|
| 95 |
-
const [mode, setMode] = useState<'live' | 'stub'>('live');
|
| 96 |
-
const create = useMutation({
|
| 97 |
-
mutationFn: () => unwrap(api.POST('/api/schedules', { body: { kind, every_minutes: kind === 'interval' ? Number(every) : null, at: kind === 'daily' ? at : null, modules: mods, include_p2: false, playwright_mode: mode, enabled: true } })),
|
| 98 |
-
onSuccess: () => qc.invalidateQueries({ queryKey: ['schedules'] }),
|
| 99 |
-
});
|
| 100 |
-
const del = useMutation({ mutationFn: (sid: number) => unwrap(api.DELETE('/api/schedules/{sid}', { params: { path: { sid } } })), onSuccess: () => qc.invalidateQueries({ queryKey: ['schedules'] }) });
|
| 101 |
-
const setPw = useMutation({
|
| 102 |
-
mutationFn: (body: { enabled?: boolean; autostart?: boolean; interval_s?: number; modules?: string[] }) => unwrap(api.PUT('/api/patch-watch', { body })),
|
| 103 |
-
onSuccess: () => qc.invalidateQueries({ queryKey: ['patchwatch'] }),
|
| 104 |
-
});
|
| 105 |
-
const check = useMutation({ mutationFn: () => unwrap(api.POST('/api/patch-watch/check')), onSuccess: () => qc.invalidateQueries({ queryKey: ['patchwatch'] }) });
|
| 106 |
-
return (
|
| 107 |
-
<Stack>
|
| 108 |
-
<PageHeader crumbs={[{ label: 'Home', to: '/runs' }, { label: 'Administration' }, { label: 'Scheduler and patch watch' }]} title="Scheduler and patch watch" />
|
| 109 |
-
<ErrorAlert error={s.error || create.error || del.error || setPw.error || check.error} />
|
| 110 |
-
<Card withBorder>
|
| 111 |
-
<Title order={5}>Patch watch</Title>
|
| 112 |
-
<Text size="sm">Polls the pod's release (mock: /api/pod/about). Last seen <b>{pw.data?.last_seen_release ?? '-'}</b> at {fmtTs(pw.data?.last_checked_at)}{pw.data?.last_error ? ` - error: ${pw.data.last_error}` : ''}</Text>
|
| 113 |
-
<Can perm="admin" fallback={<Text size="xs">Enabled: {String(pw.data?.enabled)} - autostart: {String(pw.data?.autostart)}</Text>}>
|
| 114 |
-
<Group mt="xs" align="flex-end" wrap="wrap">
|
| 115 |
-
<Switch label="Enabled" checked={!!pw.data?.enabled} onChange={(e) => setPw.mutate({ enabled: e.currentTarget.checked })} />
|
| 116 |
-
<Switch label="Auto-start a run on a new release" checked={!!pw.data?.autostart} onChange={(e) => setPw.mutate({ autostart: e.currentTarget.checked })} />
|
| 117 |
-
<NumberInput label="Interval (s)" min={30} max={86400} w={140} value={pw.data?.interval_s ?? 300} onBlur={(e) => setPw.mutate({ interval_s: Number(e.currentTarget.value) })} />
|
| 118 |
-
<Button variant="light" onClick={() => check.mutate()} loading={check.isPending}>Check now</Button>
|
| 119 |
-
</Group>
|
| 120 |
-
</Can>
|
| 121 |
-
</Card>
|
| 122 |
-
<Card withBorder>
|
| 123 |
-
<Title order={5}>Schedules (UTC)</Title>
|
| 124 |
-
<Table fz="sm" aria-label="schedules"><Table.Thead><Table.Tr><Table.Th>Id</Table.Th><Table.Th>When</Table.Th><Table.Th>Modules</Table.Th><Table.Th>Mode</Table.Th><Table.Th>Next run</Table.Th><Table.Th /></Table.Tr></Table.Thead>
|
| 125 |
-
<Table.Tbody>{(s.data ?? []).map((x) => (
|
| 126 |
-
<Table.Tr key={x.id}><Table.Td>{x.id}</Table.Td><Table.Td>{x.kind === 'daily' ? `daily ${x.at}` : `every ${x.every_minutes} min`}</Table.Td><Table.Td>{x.modules.join(', ') || 'all'}</Table.Td><Table.Td>{x.playwright_mode}</Table.Td><Table.Td>{fmtTs(x.next_run_at)}</Table.Td>
|
| 127 |
-
<Table.Td><Can perm="admin"><Button size="compact-xs" color="red" variant="light" onClick={() => del.mutate(x.id)}>Delete</Button></Can></Table.Td></Table.Tr>))}
|
| 128 |
-
</Table.Tbody></Table>
|
| 129 |
-
<Can perm="admin">
|
| 130 |
-
<Group mt="sm" align="flex-end" wrap="wrap">
|
| 131 |
-
<Select label="Kind" w={120} data={['daily', 'interval']} value={kind} onChange={(v) => setKind((v as 'daily' | 'interval') ?? 'daily')} />
|
| 132 |
-
{kind === 'daily' ? <TextInput label="At (HH:MM UTC)" w={130} value={at} onChange={(e) => setAt(e.currentTarget.value)} /> : <NumberInput label="Every (min)" w={130} min={1} value={every} onChange={setEvery} />}
|
| 133 |
-
<MultiSelect label="Modules" data={MODULES} value={mods} onChange={setMods} w={260} />
|
| 134 |
-
<Select label="Mode" w={110} data={['live', 'stub']} value={mode} onChange={(v) => setMode((v as 'live' | 'stub') ?? 'live')} />
|
| 135 |
-
<Button onClick={() => create.mutate()} loading={create.isPending}>Add schedule</Button>
|
| 136 |
-
</Group>
|
| 137 |
-
</Can>
|
| 138 |
-
</Card>
|
| 139 |
-
</Stack>
|
| 140 |
-
);
|
| 141 |
-
}
|
| 142 |
|
| 143 |
export function UsersPage() {
|
| 144 |
const q = useUsers();
|
|
@@ -160,7 +106,7 @@ export function UsersPage() {
|
|
| 160 |
<Alert color="gray">Local accounts (argon2id). Roles: viewer (read), consultant (approve cases, self-heal fixes, drafts), qa_approver (confirm defects, waivers, flaky owners), admin (everything incl. kill switch, autonomy, scheduler, users). OIDC sign-in is a stub hook in this pilot.</Alert>
|
| 161 |
<ErrorAlert error={q.error || create.error || update.error} />
|
| 162 |
<Table.ScrollContainer minWidth={640}>
|
| 163 |
-
<Table
|
| 164 |
<Table.Thead><Table.Tr><Table.Th>User</Table.Th><Table.Th>Role</Table.Th><Table.Th>Active</Table.Th><Table.Th>Last login</Table.Th><Table.Th>Created</Table.Th></Table.Tr></Table.Thead>
|
| 165 |
<Table.Tbody>
|
| 166 |
{(q.data ?? []).map((u) => (
|
|
@@ -178,7 +124,7 @@ export function UsersPage() {
|
|
| 178 |
<TextInput label="Username" required value={username} onChange={(e) => setUsername(e.currentTarget.value)} />
|
| 179 |
<PasswordInput label="Password (min 12)" required value={password} onChange={(e) => setPassword(e.currentTarget.value)} w={220} />
|
| 180 |
<Select label="Role" w={160} data={['viewer', 'consultant', 'qa_approver', 'admin']} value={role} onChange={(v) => setRole((v as typeof role) ?? 'viewer')} />
|
| 181 |
-
<Button type="submit" loading={create.isPending}>Create</Button>
|
| 182 |
</Group>
|
| 183 |
</Card>
|
| 184 |
</Stack>
|
|
|
|
| 1 |
+
import { Alert, Button, Card, Checkbox, Group, PasswordInput, SegmentedControl, Select, Stack, Table, Text, TextInput, Title } from '@mantine/core';
|
| 2 |
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { api, unwrap } from '../api/client';
|
| 5 |
+
import { useAutonomy, useConfig, useHealth, useKill, useUsers } from '../api/hooks';
|
| 6 |
import { Can, ErrorAlert, fmtTs, pct, PageHeader } from '../components/common';
|
| 7 |
|
|
|
|
|
|
|
| 8 |
export function KillSwitchPage() {
|
| 9 |
const kill = useKill();
|
| 10 |
const health = useHealth();
|
|
|
|
| 20 |
return (
|
| 21 |
<Stack>
|
| 22 |
<PageHeader crumbs={[{ label: 'Home', to: '/runs' }, { label: 'Administration' }, { label: 'Kill switch' }]} title="Kill switch" />
|
| 23 |
+
<section className="fpt-card fpt-danger" aria-label="Emergency stop" data-engaged={k?.engaged || undefined}>
|
| 24 |
+
<Text fw={600} mb={6}>Emergency stop</Text>
|
| 25 |
+
<Group justify="space-between" wrap="wrap" align="flex-start">
|
| 26 |
+
<div style={{ flex: '1 1 300px' }}>
|
| 27 |
+
<Text size="lg" fw={600} c={k?.engaged ? 'red' : undefined} data-testid="kill-state">{k?.engaged ? 'ENGAGED' : 'released'}</Text>
|
| 28 |
{k?.engaged && <Text size="sm">{k.reason} - by {k.actor} since {fmtTs(k.since)}</Text>}
|
| 29 |
<Text size="xs" c="dimmed">Engaging stops the active run and its Playwright process tree, blocks all egress (pod, web, LLM, tickets) and refuses new runs. Also settable by creating var/KILL.</Text>
|
| 30 |
</div>
|
| 31 |
+
<Can perm="admin" fallback={<Text size="xs" c="dimmed">Admin only.</Text>}>
|
| 32 |
<Stack gap="xs">
|
| 33 |
<TextInput label="Reason" value={reason} onChange={(e) => setReason(e.currentTarget.value)} />
|
| 34 |
{k?.engaged
|
| 35 |
? <Button onClick={() => m.mutate(false)} loading={m.isPending}>Release</Button>
|
| 36 |
+
: <Button color="red" variant="filled" onClick={() => m.mutate(true)} loading={m.isPending}>Engage kill switch</Button>}
|
| 37 |
</Stack>
|
| 38 |
</Can>
|
| 39 |
</Group>
|
| 40 |
<ErrorAlert error={m.error} />
|
| 41 |
+
</section>
|
| 42 |
+
<section className="fpt-card" style={{ padding: 16 }} aria-label="Providers and health">
|
| 43 |
+
<Text fw={600} mb={4}>Providers and health</Text>
|
| 44 |
<Text size="sm">Mock app: {health.data?.mock_up ? 'up' : 'DOWN'} - Ollama: {health.data?.ollama_up ? 'up' : 'off/down'} - frontier: {health.data?.frontier_configured ? 'configured' : 'not configured'}</Text>
|
| 45 |
<Text size="sm">LLM routing: stub (always) - local: {String(providers.local ?? 'none')} - frontier: {String(providers.frontier ?? 'off')} - local model {String(cfg.data?.ollama_model ?? '')}</Text>
|
| 46 |
+
</section>
|
| 47 |
</Stack>
|
| 48 |
);
|
| 49 |
}
|
|
|
|
| 61 |
<Text size="sm" c="dimmed">L0: humans approve every new/changed/generated case. L1: approved library cases and patch-touched cases auto-approve. L2: generated drafts too. Real-defect confirmation and tickets are never autonomous. Promotion is refused unless the metrics meet the thresholds; demotion is always allowed.</Text>
|
| 62 |
<ErrorAlert error={q.error || m.error} title="Change refused" />
|
| 63 |
<Table.ScrollContainer minWidth={760}>
|
| 64 |
+
<Table aria-label="autonomy" className="fpt-table">
|
| 65 |
<Table.Thead><Table.Tr><Table.Th>Module</Table.Th><Table.Th>Level</Table.Th><Table.Th>Approval decisions</Table.Th><Table.Th>Approval rate</Table.Th><Table.Th>Defect recall</Table.Th><Table.Th>Can promote</Table.Th><Table.Th>Set</Table.Th></Table.Tr></Table.Thead>
|
| 66 |
<Table.Tbody>
|
| 67 |
{Object.entries(q.data ?? {}).map(([mod, a]) => (
|
| 68 |
<Table.Tr key={mod}>
|
| 69 |
+
<Table.Td>{mod}</Table.Td><Table.Td><b>{a.level}</b></Table.Td>
|
| 70 |
<Table.Td>{a.metrics.n_approval_decisions} / {a.thresholds.min_labels}</Table.Td>
|
| 71 |
<Table.Td>{pct(a.metrics.case_approval_rate)} (min {pct(a.thresholds.min_agreement)})</Table.Td>
|
| 72 |
<Table.Td>{pct(a.metrics.real_defect_recall)} (min {pct(a.thresholds.min_recall)})</Table.Td>
|
|
|
|
| 83 |
);
|
| 84 |
}
|
| 85 |
|
| 86 |
+
/** Scheduled runs (step 7): the same screen at /schedules, /admin/scheduler and Settings > Schedules. */
|
| 87 |
+
export { ScheduledRunsPage as SchedulerPage } from './ScheduledRunsPage';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 88 |
|
| 89 |
export function UsersPage() {
|
| 90 |
const q = useUsers();
|
|
|
|
| 106 |
<Alert color="gray">Local accounts (argon2id). Roles: viewer (read), consultant (approve cases, self-heal fixes, drafts), qa_approver (confirm defects, waivers, flaky owners), admin (everything incl. kill switch, autonomy, scheduler, users). OIDC sign-in is a stub hook in this pilot.</Alert>
|
| 107 |
<ErrorAlert error={q.error || create.error || update.error} />
|
| 108 |
<Table.ScrollContainer minWidth={640}>
|
| 109 |
+
<Table aria-label="users" className="fpt-table">
|
| 110 |
<Table.Thead><Table.Tr><Table.Th>User</Table.Th><Table.Th>Role</Table.Th><Table.Th>Active</Table.Th><Table.Th>Last login</Table.Th><Table.Th>Created</Table.Th></Table.Tr></Table.Thead>
|
| 111 |
<Table.Tbody>
|
| 112 |
{(q.data ?? []).map((u) => (
|
|
|
|
| 124 |
<TextInput label="Username" required value={username} onChange={(e) => setUsername(e.currentTarget.value)} />
|
| 125 |
<PasswordInput label="Password (min 12)" required value={password} onChange={(e) => setPassword(e.currentTarget.value)} w={220} />
|
| 126 |
<Select label="Role" w={160} data={['viewer', 'consultant', 'qa_approver', 'admin']} value={role} onChange={(v) => setRole((v as typeof role) ?? 'viewer')} />
|
| 127 |
+
<Button type="submit" variant="filled" loading={create.isPending}>Create</Button>
|
| 128 |
</Group>
|
| 129 |
</Card>
|
| 130 |
</Stack>
|
web/src/pages/AgentTeamPage.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import { Button, Group, Stack, Table, Tabs, Text } from '@mantine/core';
|
| 2 |
-
import {
|
| 3 |
import { useQuery } from '@tanstack/react-query';
|
| 4 |
import { useState } from 'react';
|
| 5 |
import { Link, useSearchParams } from 'react-router-dom';
|
|
@@ -74,7 +74,7 @@ export function AgentTeamPage() {
|
|
| 74 |
<PageHeader crumbs={[{ label: 'Settings', to: '/admin' }, { label: 'Advanced', to: '/admin?tab=advanced' }, { label: 'Agent team' }]} title="Agent team">
|
| 75 |
<Link to="/runs" className="fpt-iconbtn" aria-label="Back to workspace"><IconStar size={14} /></Link>
|
| 76 |
<Link to="/admin/autonomy" className="fpt-iconbtn" aria-label="Autonomy settings"><IconSettings size={14} /></Link>
|
| 77 |
-
<Button component={Link} to="/runs?new=1"
|
| 78 |
</PageHeader>
|
| 79 |
<ErrorAlert error={cfg.error} />
|
| 80 |
|
|
@@ -85,7 +85,7 @@ export function AgentTeamPage() {
|
|
| 85 |
<div style={{ background: 'var(--fpt-band)', height: 46 }} />
|
| 86 |
<div style={{ textAlign: 'center', padding: '0 14px 14px', marginTop: -22 }}>
|
| 87 |
<span className="fpt-iconbtn" style={{ width: 44, height: 44, borderRadius: '50%', margin: '0 auto', background: 'var(--fpt-surface)' }} aria-hidden><IconRobot size={20} /></span>
|
| 88 |
-
<Text fw={
|
| 89 |
<Text size="xs" c="dimmed">Runs the shared state, retries, checkpoints and human gates for every agent.</Text>
|
| 90 |
<Group gap={6} justify="center" mt={8}>
|
| 91 |
<Pill tone={ready.data?.ready ? 'green' : 'red'} testId="orchestrator">{ready.data ? ready.data.orchestrator : 'checking…'}</Pill>
|
|
@@ -121,11 +121,11 @@ export function AgentTeamPage() {
|
|
| 121 |
<Tabs.Panel value="basic">
|
| 122 |
<Stack gap="sm">
|
| 123 |
<div>
|
| 124 |
-
<Text size="sm" fw={
|
| 125 |
<Text size="xs" c="dimmed">{sel.group}</Text>
|
| 126 |
</div>
|
| 127 |
<div className="fpt-card" style={{ padding: 12, background: 'var(--fpt-surface-2)' }}>
|
| 128 |
-
<Text size="xs" fw={
|
| 129 |
<Text size="sm">{sel.job}</Text>
|
| 130 |
</div>
|
| 131 |
<KV rows={[
|
|
@@ -135,7 +135,7 @@ export function AgentTeamPage() {
|
|
| 135 |
['Graph node', <code key="n">{sel.node}</code>],
|
| 136 |
]} />
|
| 137 |
<div>
|
| 138 |
-
<Group justify="space-between" mb={4}><Text size="xs" fw={
|
| 139 |
<Group gap={6}>
|
| 140 |
{Object.entries(autonomy.data ?? {}).map(([m, r]) => <Pill key={m} tone={r.level === 'L0' ? 'neutral' : r.level === 'L1' ? 'blue' : 'green'}>{m} · {r.level}</Pill>)}
|
| 141 |
{!autonomy.data && <Text size="xs" c="dimmed">loading…</Text>}
|
|
@@ -192,7 +192,7 @@ export function AgentTeamPage() {
|
|
| 192 |
{/* right: workflow */}
|
| 193 |
<div className="fpt-side fpt-hide-narrow" style={{ flex: '0 0 270px', width: 270 }}>
|
| 194 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 195 |
-
<Text size="sm" fw={
|
| 196 |
<Text size="xs" c="dimmed" mb={6}>The order agents work in, from the pod scan to the learner. Pass → reporter; fail → self-heal → one retry → triage. The pills show what each agent is designed for; hover for what serves it now (outlined = not connected now).</Text>
|
| 197 |
<GraphView nowFor={(n) => nowInfo(n, c)} />
|
| 198 |
</div>
|
|
|
|
| 1 |
import { Button, Group, Stack, Table, Tabs, Text } from '@mantine/core';
|
| 2 |
+
import { IconRobot, IconSettings, IconStar } from '@tabler/icons-react';
|
| 3 |
import { useQuery } from '@tanstack/react-query';
|
| 4 |
import { useState } from 'react';
|
| 5 |
import { Link, useSearchParams } from 'react-router-dom';
|
|
|
|
| 74 |
<PageHeader crumbs={[{ label: 'Settings', to: '/admin' }, { label: 'Advanced', to: '/admin?tab=advanced' }, { label: 'Agent team' }]} title="Agent team">
|
| 75 |
<Link to="/runs" className="fpt-iconbtn" aria-label="Back to workspace"><IconStar size={14} /></Link>
|
| 76 |
<Link to="/admin/autonomy" className="fpt-iconbtn" aria-label="Autonomy settings"><IconSettings size={14} /></Link>
|
| 77 |
+
<Button variant="filled" component={Link} to="/runs?new=1">New test run</Button>
|
| 78 |
</PageHeader>
|
| 79 |
<ErrorAlert error={cfg.error} />
|
| 80 |
|
|
|
|
| 85 |
<div style={{ background: 'var(--fpt-band)', height: 46 }} />
|
| 86 |
<div style={{ textAlign: 'center', padding: '0 14px 14px', marginTop: -22 }}>
|
| 87 |
<span className="fpt-iconbtn" style={{ width: 44, height: 44, borderRadius: '50%', margin: '0 auto', background: 'var(--fpt-surface)' }} aria-hidden><IconRobot size={20} /></span>
|
| 88 |
+
<Text fw={600} mt={6}>Coordinator</Text>
|
| 89 |
<Text size="xs" c="dimmed">Runs the shared state, retries, checkpoints and human gates for every agent.</Text>
|
| 90 |
<Group gap={6} justify="center" mt={8}>
|
| 91 |
<Pill tone={ready.data?.ready ? 'green' : 'red'} testId="orchestrator">{ready.data ? ready.data.orchestrator : 'checking…'}</Pill>
|
|
|
|
| 121 |
<Tabs.Panel value="basic">
|
| 122 |
<Stack gap="sm">
|
| 123 |
<div>
|
| 124 |
+
<Text size="sm" fw={600}>{sel.name}</Text>
|
| 125 |
<Text size="xs" c="dimmed">{sel.group}</Text>
|
| 126 |
</div>
|
| 127 |
<div className="fpt-card" style={{ padding: 12, background: 'var(--fpt-surface-2)' }}>
|
| 128 |
+
<Text size="xs" fw={600} mb={4}>What this agent does</Text>
|
| 129 |
<Text size="sm">{sel.job}</Text>
|
| 130 |
</div>
|
| 131 |
<KV rows={[
|
|
|
|
| 135 |
['Graph node', <code key="n">{sel.node}</code>],
|
| 136 |
]} />
|
| 137 |
<div>
|
| 138 |
+
<Group justify="space-between" mb={4}><Text size="xs" fw={600}>Autonomy per module</Text><Button variant="subtle" size="compact-xs" component={Link} to="/admin/autonomy">Manage</Button></Group>
|
| 139 |
<Group gap={6}>
|
| 140 |
{Object.entries(autonomy.data ?? {}).map(([m, r]) => <Pill key={m} tone={r.level === 'L0' ? 'neutral' : r.level === 'L1' ? 'blue' : 'green'}>{m} · {r.level}</Pill>)}
|
| 141 |
{!autonomy.data && <Text size="xs" c="dimmed">loading…</Text>}
|
|
|
|
| 192 |
{/* right: workflow */}
|
| 193 |
<div className="fpt-side fpt-hide-narrow" style={{ flex: '0 0 270px', width: 270 }}>
|
| 194 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 195 |
+
<Text size="sm" fw={600}>Workflow · designed engine per agent</Text>
|
| 196 |
<Text size="xs" c="dimmed" mb={6}>The order agents work in, from the pod scan to the learner. Pass → reporter; fail → self-heal → one retry → triage. The pills show what each agent is designed for; hover for what serves it now (outlined = not connected now).</Text>
|
| 197 |
<GraphView nowFor={(n) => nowInfo(n, c)} />
|
| 198 |
</div>
|
web/src/pages/AssistantPage.tsx
CHANGED
|
@@ -289,13 +289,15 @@ export function Conversation({ id, notes, say, setStatus, clear }: ViewProps & {
|
|
| 289 |
{stage === 'result' && (
|
| 290 |
<>
|
| 291 |
<Phase>Result</Phase>
|
| 292 |
-
<Msg who="bot" wide>
|
| 293 |
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
|
|
|
|
|
|
|
| 299 |
</Msg>
|
| 300 |
</>
|
| 301 |
)}
|
|
|
|
| 289 |
{stage === 'result' && (
|
| 290 |
<>
|
| 291 |
<Phase>Result</Phase>
|
| 292 |
+
<Msg who="bot" wide>
|
| 293 |
+
<StageCard stage="result">
|
| 294 |
+
<Result r={r} after={(
|
| 295 |
+
<Group gap="md" mt={4} className="fpt-result-links">
|
| 296 |
+
<Anchor component="button" type="button" size="sm" onClick={() => nav('/runs/new')} data-testid="chat-new">Test another business area</Anchor>
|
| 297 |
+
<Anchor component={Link} to={`/runs/${id}/workflow`} size="sm">Open the team board</Anchor>
|
| 298 |
+
</Group>
|
| 299 |
+
)} />
|
| 300 |
+
</StageCard>
|
| 301 |
</Msg>
|
| 302 |
</>
|
| 303 |
)}
|
web/src/pages/FailureReview.tsx
CHANGED
|
@@ -21,11 +21,9 @@ export function FailureCard({ f, draft, onChange, editable, quick = false }: { f
|
|
| 21 |
<Group justify="space-between" wrap="wrap" gap={6}>
|
| 22 |
<div style={{ minWidth: 0 }}>
|
| 23 |
<Text size="sm" fw={600}>{f.title ?? f.case_id}</Text>
|
| 24 |
-
<
|
| 25 |
-
{f.step
|
| 26 |
-
|
| 27 |
-
{f.priority_words && <Pill tone="neutral">{f.priority_words}</Pill>}
|
| 28 |
-
</Group>
|
| 29 |
</div>
|
| 30 |
{done && <Pill tone="green">answered: {done.confirmed ? ANSWER_WORDS[done.confirmed] ?? done.confirmed.replace(/_/g, ' ') : done.owner ? `owner ${done.owner}` : 'yes'}</Pill>}
|
| 31 |
</Group>
|
|
@@ -47,8 +45,8 @@ export function FailureCard({ f, draft, onChange, editable, quick = false }: { f
|
|
| 47 |
{f.ask === 'confirm' && (
|
| 48 |
<Radio.Group value={draft.choice ?? ''} onChange={(v) => onChange({ ...draft, choice: v as FailureChoice })} label="Your verdict">
|
| 49 |
<Group mt={4} gap="md">
|
| 50 |
-
<Radio value="real_defect" label={`Real defect – raise ticket${f.category === 'real_defect' ? '
|
| 51 |
-
<Radio value="not_defect" label={`Not a defect${f.category !== 'real_defect' ? '
|
| 52 |
<Radio value="expected_change" label="Expected change from the patch" />
|
| 53 |
</Group>
|
| 54 |
</Radio.Group>
|
|
@@ -93,7 +91,7 @@ export function FailureReview({ id, waiting }: { id: string; waiting: boolean })
|
|
| 93 |
<>
|
| 94 |
<ErrorAlert error={submit.error} />
|
| 95 |
<Can perm="gate.human_review" fallback={<Alert color="gray">Only QA approvers (or admins) can confirm defects, waivers and owners.</Alert>}>
|
| 96 |
-
<Group><Button onClick={send} loading={submit.isPending} disabled={submit.isSuccess}>Submit failure review</Button>
|
| 97 |
{submit.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; the test run continues.</Text>}</Group>
|
| 98 |
</Can>
|
| 99 |
</>
|
|
|
|
| 21 |
<Group justify="space-between" wrap="wrap" gap={6}>
|
| 22 |
<div style={{ minWidth: 0 }}>
|
| 23 |
<Text size="sm" fw={600}>{f.title ?? f.case_id}</Text>
|
| 24 |
+
<Text size="xs" c="dimmed" mt={2} data-testid={`failure-facts-${f.case_id}`}>
|
| 25 |
+
{[f.outcome === 'flaky' ? `Passed only on retry${f.step ? ` (step ${f.step})` : ''}.` : f.step ? `Failed at ${f.step}.` : 'Failed.', f.priority_words ? `${f.priority_words}.` : ''].filter(Boolean).join(' ')}
|
| 26 |
+
</Text>
|
|
|
|
|
|
|
| 27 |
</div>
|
| 28 |
{done && <Pill tone="green">answered: {done.confirmed ? ANSWER_WORDS[done.confirmed] ?? done.confirmed.replace(/_/g, ' ') : done.owner ? `owner ${done.owner}` : 'yes'}</Pill>}
|
| 29 |
</Group>
|
|
|
|
| 45 |
{f.ask === 'confirm' && (
|
| 46 |
<Radio.Group value={draft.choice ?? ''} onChange={(v) => onChange({ ...draft, choice: v as FailureChoice })} label="Your verdict">
|
| 47 |
<Group mt={4} gap="md">
|
| 48 |
+
<Radio value="real_defect" label={`Real defect – raise ticket${f.category === 'real_defect' ? ' (suggested)' : ''}`} />
|
| 49 |
+
<Radio value="not_defect" label={`Not a defect${f.category !== 'real_defect' ? ' (suggested)' : ''}`} />
|
| 50 |
<Radio value="expected_change" label="Expected change from the patch" />
|
| 51 |
</Group>
|
| 52 |
</Radio.Group>
|
|
|
|
| 91 |
<>
|
| 92 |
<ErrorAlert error={submit.error} />
|
| 93 |
<Can perm="gate.human_review" fallback={<Alert color="gray">Only QA approvers (or admins) can confirm defects, waivers and owners.</Alert>}>
|
| 94 |
+
<Group><Button variant="filled" onClick={send} loading={submit.isPending} disabled={submit.isSuccess}>Submit failure review</Button>
|
| 95 |
{submit.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; the test run continues.</Text>}</Group>
|
| 96 |
</Can>
|
| 97 |
</>
|
web/src/pages/LibraryPages.tsx
CHANGED
|
@@ -1,84 +1,121 @@
|
|
| 1 |
-
import {
|
|
|
|
| 2 |
import {
|
| 3 |
IconAdjustments, IconBooks, IconBrain, IconCalendarTime, IconFileReport, IconPower, IconRobot, IconShieldCheck, IconUsers, IconWand,
|
| 4 |
} from '@tabler/icons-react';
|
| 5 |
import { useState, type ReactNode } from 'react';
|
| 6 |
-
import { Link } from 'react-router-dom';
|
| 7 |
import { MODULE_NAMES } from '../agents';
|
| 8 |
-
import {
|
| 9 |
-
import {
|
| 10 |
-
import {
|
| 11 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 12 |
|
| 13 |
const MODULES = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX'];
|
| 14 |
|
| 15 |
export function ScenariosLibraryPage() {
|
|
|
|
| 16 |
const [module, setModule] = useState<string | null>('P2P');
|
| 17 |
const [step, setStep] = useState<string | null>(null);
|
| 18 |
const [priority, setPriority] = useState<string | null>(null);
|
| 19 |
const [q, setQ] = useState('');
|
| 20 |
const [offset, setOffset] = useState(0);
|
| 21 |
-
const
|
|
|
|
|
|
|
| 22 |
const limit = 25;
|
| 23 |
const lib = useScenarioLibrary({ module: module ?? undefined, step: step ?? undefined, priority: priority ?? undefined, q: q || undefined, limit, offset });
|
| 24 |
-
const detail = useScenario(open);
|
| 25 |
const reset = () => setOffset(0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 26 |
return (
|
| 27 |
<Stack gap="md">
|
| 28 |
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Scenarios library' }]} title="Scenarios library"
|
| 29 |
-
extra={<
|
| 30 |
-
<
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
</div>
|
| 56 |
-
{
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
|
|
|
| 60 |
</Stack>
|
| 61 |
);
|
| 62 |
}
|
| 63 |
|
| 64 |
export function ReportsPage() {
|
| 65 |
const runs = useRuns(50, 0, 'completed');
|
|
|
|
| 66 |
return (
|
| 67 |
<Stack gap="md">
|
| 68 |
-
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Reports' }]} title="Reports"
|
| 69 |
-
|
| 70 |
<div className="fpt-card" style={{ overflow: 'hidden' }} role="list" aria-label="reports">
|
| 71 |
-
{(runs.data?.items ?? []).length === 0 && <Text size="sm" c="dimmed" p="md">{runs.isLoading ? 'Loading
|
| 72 |
-
{(runs.data?.items ?? []).map((r, i) =>
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
<
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
</div>
|
| 83 |
</Stack>
|
| 84 |
);
|
|
@@ -88,7 +125,7 @@ function HubCard({ to, icon, title, body }: { to: string; icon: ReactNode; title
|
|
| 88 |
return (
|
| 89 |
<Link to={to} className="fpt-card fpt-tile" style={{ alignItems: 'flex-start' }}>
|
| 90 |
<span className="fpt-iconbtn" style={{ width: 34, height: 34, borderRadius: 10 }} aria-hidden>{icon}</span>
|
| 91 |
-
<span><Text size="sm" fw={
|
| 92 |
</Link>
|
| 93 |
);
|
| 94 |
}
|
|
|
|
| 1 |
+
import { CloseButton, Drawer, Group, Select, Skeleton, Stack, Table, Text, TextInput, UnstyledButton } from '@mantine/core';
|
| 2 |
+
import { useMediaQuery } from '@mantine/hooks';
|
| 3 |
import {
|
| 4 |
IconAdjustments, IconBooks, IconBrain, IconCalendarTime, IconFileReport, IconPower, IconRobot, IconShieldCheck, IconUsers, IconWand,
|
| 5 |
} from '@tabler/icons-react';
|
| 6 |
import { useState, type ReactNode } from 'react';
|
| 7 |
+
import { Link, useSearchParams } from 'react-router-dom';
|
| 8 |
import { MODULE_NAMES } from '../agents';
|
| 9 |
+
import { usePods, useRuns, useScenarioLibrary } from '../api/hooks';
|
| 10 |
+
import { ErrorAlert, GlossaryButton, PageHeader, Pager, Prio } from '../components/common';
|
| 11 |
+
import { envKind } from '../components/shell/EnvSwitcher';
|
| 12 |
+
import { ScenarioSteps } from '../components/shell/panelTabs';
|
| 13 |
+
import { decisionWords } from '../glossary';
|
| 14 |
+
import { runTitle, shortWhen } from '../runName';
|
| 15 |
+
|
| 16 |
+
const DECISION_TONE: Record<string, string> = { GO: 'green', 'NO-GO': 'red', HELD: 'amber' };
|
| 17 |
|
| 18 |
const MODULES = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX'];
|
| 19 |
|
| 20 |
export function ScenariosLibraryPage() {
|
| 21 |
+
const [params, setParams] = useSearchParams();
|
| 22 |
const [module, setModule] = useState<string | null>('P2P');
|
| 23 |
const [step, setStep] = useState<string | null>(null);
|
| 24 |
const [priority, setPriority] = useState<string | null>(null);
|
| 25 |
const [q, setQ] = useState('');
|
| 26 |
const [offset, setOffset] = useState(0);
|
| 27 |
+
const wide = useMediaQuery('(min-width: 1280px)');
|
| 28 |
+
const open = params.get('scenario');
|
| 29 |
+
const setOpen = (id: string | null) => { const p = new URLSearchParams(params); if (id) p.set('scenario', id); else p.delete('scenario'); setParams(p, { replace: true }); };
|
| 30 |
const limit = 25;
|
| 31 |
const lib = useScenarioLibrary({ module: module ?? undefined, step: step ?? undefined, priority: priority ?? undefined, q: q || undefined, limit, offset });
|
|
|
|
| 32 |
const reset = () => setOffset(0);
|
| 33 |
+
const items = lib.data?.items ?? [];
|
| 34 |
+
const filters = (
|
| 35 |
+
<div className={wide ? 'fpt-libfilters' : 'fpt-libfilterbar'} role="group" aria-label="Filter the scenarios">
|
| 36 |
+
<Select label="Business area" w={wide ? undefined : 210} data={MODULES.map((m) => ({ value: m, label: `${MODULE_NAMES[m] ?? m} (${m})` }))} value={module} clearable
|
| 37 |
+
onChange={(v) => { setModule(v); setStep(null); reset(); }} />
|
| 38 |
+
<Select label="Process step" w={wide ? undefined : 230} data={lib.data?.steps ?? []} value={step} clearable onChange={(v) => { setStep(v); reset(); }} />
|
| 39 |
+
<Select label="Priority" w={wide ? undefined : 140} data={['Critical', 'High', 'Medium', 'Low']} value={priority} clearable onChange={(v) => { setPriority(v); reset(); }} />
|
| 40 |
+
<TextInput label="Search" placeholder="title or ID" value={q} onChange={(e) => { setQ(e.currentTarget.value); reset(); }} />
|
| 41 |
+
</div>
|
| 42 |
+
);
|
| 43 |
return (
|
| 44 |
<Stack gap="md">
|
| 45 |
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Scenarios library' }]} title="Scenarios library"
|
| 46 |
+
extra={<span className="fpt-pagedesc fpt-num">{lib.data?.total ?? 0} scenario{lib.data?.total === 1 ? '' : 's'}</span>}><GlossaryButton /></PageHeader>
|
| 47 |
+
<div className="fpt-lib" data-wide={wide || undefined} data-open={(wide && !!open) || undefined}>
|
| 48 |
+
{filters}
|
| 49 |
+
<div style={{ minWidth: 0 }}>
|
| 50 |
+
<ErrorAlert error={lib.error} />
|
| 51 |
+
<div className="fpt-card" style={{ overflow: 'hidden' }}>
|
| 52 |
+
<Table.ScrollContainer minWidth={600}>
|
| 53 |
+
<Table aria-label="scenarios library" className="fpt-table">
|
| 54 |
+
<Table.Thead><Table.Tr><Table.Th>Scenario</Table.Th><Table.Th>Process step</Table.Th><Table.Th>Priority</Table.Th><Table.Th>Status</Table.Th><Table.Th>Automated</Table.Th></Table.Tr></Table.Thead>
|
| 55 |
+
<Table.Tbody>
|
| 56 |
+
{lib.isLoading && [0, 1, 2, 3].map((i) => <Table.Tr key={i}><Table.Td colSpan={5}><Skeleton height={28} /></Table.Td></Table.Tr>)}
|
| 57 |
+
{!lib.isLoading && items.length === 0 && <Table.Tr><Table.Td colSpan={5}><Text size="sm" c="dimmed">No scenarios match these filters.</Text></Table.Td></Table.Tr>}
|
| 58 |
+
{items.map((s) => (
|
| 59 |
+
<Table.Tr key={s.id} data-selected={open === s.id || undefined} className="fpt-libro">
|
| 60 |
+
<Table.Td>
|
| 61 |
+
<UnstyledButton onClick={() => setOpen(open === s.id ? null : s.id)} aria-pressed={open === s.id} className="fpt-libtitle">{s.title}</UnstyledButton>
|
| 62 |
+
<Text size="xs" c="dimmed"><span className="fpt-idpill">{s.id}</span> <span className="fpt-aitext"><IconBooks size={13} aria-hidden />Library</span></Text>
|
| 63 |
+
</Table.Td>
|
| 64 |
+
<Table.Td>{s.step ?? <span className="fpt-nocov">No process step</span>}</Table.Td>
|
| 65 |
+
<Table.Td><Prio words={s.priority_words} /></Table.Td>
|
| 66 |
+
<Table.Td><span className="fpt-dotword" data-tone="neutral">{s.status === 'draft' ? 'Awaiting approval' : s.status === 'approved' ? 'Approved' : s.status}</span></Table.Td>
|
| 67 |
+
<Table.Td>{s.automated ? 'Yes' : 'Not yet'}</Table.Td>
|
| 68 |
+
</Table.Tr>
|
| 69 |
+
))}
|
| 70 |
+
</Table.Tbody>
|
| 71 |
+
</Table>
|
| 72 |
+
</Table.ScrollContainer>
|
| 73 |
+
</div>
|
| 74 |
+
{lib.data && <Pager total={lib.data.total} limit={limit} offset={offset} onChange={setOffset} />}
|
| 75 |
+
</div>
|
| 76 |
+
{wide && open && (
|
| 77 |
+
<aside className="fpt-card fpt-libpanel" aria-label="Scenario steps">
|
| 78 |
+
<Group justify="space-between" mb={6}><Text size="sm" fw={600}>Steps</Text><CloseButton aria-label="Close the steps" onClick={() => setOpen(null)} /></Group>
|
| 79 |
+
<ScenarioSteps scenarioId={open} />
|
| 80 |
+
</aside>
|
| 81 |
+
)}
|
| 82 |
</div>
|
| 83 |
+
{!wide && (
|
| 84 |
+
<Drawer opened={!!open} onClose={() => setOpen(null)} position="right" size="xl" title="Steps">
|
| 85 |
+
{open && <ScenarioSteps scenarioId={open} />}
|
| 86 |
+
</Drawer>
|
| 87 |
+
)}
|
| 88 |
</Stack>
|
| 89 |
);
|
| 90 |
}
|
| 91 |
|
| 92 |
export function ReportsPage() {
|
| 93 |
const runs = useRuns(50, 0, 'completed');
|
| 94 |
+
const pods = usePods().data ?? [];
|
| 95 |
return (
|
| 96 |
<Stack gap="md">
|
| 97 |
+
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Reports' }]} title="Reports"
|
| 98 |
+
extra={<span className="fpt-pagedesc">Finished test runs. Open one to read the report, download the PDF and sign it off.</span>} />
|
| 99 |
<div className="fpt-card" style={{ overflow: 'hidden' }} role="list" aria-label="reports">
|
| 100 |
+
{(runs.data?.items ?? []).length === 0 && <Text size="sm" c="dimmed" p="md">{runs.isLoading ? 'Loading the reports.' : 'No finished test runs yet. Start a test run; its report appears here when it finishes.'}</Text>}
|
| 101 |
+
{(runs.data?.items ?? []).map((r, i) => {
|
| 102 |
+
const fusion = envKind(pods.find((p) => p.id === r.pod_id)?.kind) === 'fusion';
|
| 103 |
+
const ds = Object.entries(r.decisions ?? {});
|
| 104 |
+
return (
|
| 105 |
+
<Link key={r.run_id} to={`/runs/${r.run_id}/report`} className="fpt-row fpt-reportrow" role="listitem" style={{ borderTop: i ? '1px solid var(--fpt-border)' : 0 }}>
|
| 106 |
+
<IconFileReport size={16} aria-hidden color="var(--fpt-dim)" />
|
| 107 |
+
<div style={{ flex: '1 1 240px', minWidth: 0 }}>
|
| 108 |
+
<Text size="sm" fw={600}>{runTitle(r)}</Text>
|
| 109 |
+
<Text size="xs" c="dimmed">{fusion ? `Oracle Fusion pod: ${r.pod_name ?? 'unnamed'}` : 'Practice environment'}. {shortWhen(r.created_at)}. {r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ') || 'All areas'}.</Text>
|
| 110 |
+
</div>
|
| 111 |
+
<span className="fpt-reportverdicts">
|
| 112 |
+
{ds.length === 0 ? <span className="fpt-verdictword">No decision</span> : ds.map(([m, d]) => (
|
| 113 |
+
<span key={m} className="fpt-verdictword" data-tone={DECISION_TONE[d] ?? 'neutral'} data-rule={d} title={`Rule result: ${d}`}>{ds.length > 1 ? `${m} ` : ''}{decisionWords(d)}</span>
|
| 114 |
+
))}
|
| 115 |
+
</span>
|
| 116 |
+
</Link>
|
| 117 |
+
);
|
| 118 |
+
})}
|
| 119 |
</div>
|
| 120 |
</Stack>
|
| 121 |
);
|
|
|
|
| 125 |
return (
|
| 126 |
<Link to={to} className="fpt-card fpt-tile" style={{ alignItems: 'flex-start' }}>
|
| 127 |
<span className="fpt-iconbtn" style={{ width: 34, height: 34, borderRadius: 10 }} aria-hidden>{icon}</span>
|
| 128 |
+
<span><Text size="sm" fw={600}>{title}</Text><Text size="xs" c="dimmed">{body}</Text></span>
|
| 129 |
</Link>
|
| 130 |
);
|
| 131 |
}
|
web/src/pages/LiveView.tsx
CHANGED
|
@@ -54,7 +54,7 @@ function Results({ id, l, sawFailure, gate }: { id: string; l?: LiveStatus; sawF
|
|
| 54 |
{failed && (
|
| 55 |
<button type="button" className="fpt-failed-frame" onClick={() => setOpen(true)} aria-label={`See the failed screen of ${failed.title}`}>
|
| 56 |
<img src={`/api/runs/${encodeURIComponent(id)}/live/failed?t=${encodeURIComponent(failed.ts)}`} alt={`Screen of ${failed.title} at the moment it failed`} />
|
| 57 |
-
<Text size="xs" fw={
|
| 58 |
</button>
|
| 59 |
)}
|
| 60 |
<Stack gap={4} mt={failed ? 8 : 0}>
|
|
@@ -162,8 +162,8 @@ export function LiveView({ id, status, gate, reasonQuick, compact }: { id: strin
|
|
| 162 |
onError={() => { if (wasActive.current) window.setTimeout(() => setConn((c) => c + 1), 2000); }} />
|
| 163 |
)}
|
| 164 |
{still && <img src={still} alt="Paused picture of the test browser" />}
|
| 165 |
-
{overlay && <div className="fpt-live-overlay" role="status"><Text size="sm" fw={
|
| 166 |
-
{still && <div className="fpt-live-overlay" data-kind="paused" role="status"><Text size="sm" fw={
|
| 167 |
</div>
|
| 168 |
<Group justify="space-between" wrap="wrap" gap={8}>
|
| 169 |
<Text size="xs" c="dimmed">Test data only. This is the test environment's browser, not your own session.{l?.page_title ? ` Page: ${l.page_title}.` : ''}</Text>
|
|
|
|
| 54 |
{failed && (
|
| 55 |
<button type="button" className="fpt-failed-frame" onClick={() => setOpen(true)} aria-label={`See the failed screen of ${failed.title}`}>
|
| 56 |
<img src={`/api/runs/${encodeURIComponent(id)}/live/failed?t=${encodeURIComponent(failed.ts)}`} alt={`Screen of ${failed.title} at the moment it failed`} />
|
| 57 |
+
<Text size="xs" fw={600} p={6} ta="left">Failed: {failed.title}</Text>
|
| 58 |
</button>
|
| 59 |
)}
|
| 60 |
<Stack gap={4} mt={failed ? 8 : 0}>
|
|
|
|
| 162 |
onError={() => { if (wasActive.current) window.setTimeout(() => setConn((c) => c + 1), 2000); }} />
|
| 163 |
)}
|
| 164 |
{still && <img src={still} alt="Paused picture of the test browser" />}
|
| 165 |
+
{overlay && <div className="fpt-live-overlay" role="status"><Text size="sm" fw={600}>{overlay}</Text></div>}
|
| 166 |
+
{still && <div className="fpt-live-overlay" data-kind="paused" role="status"><Text size="sm" fw={600}>View paused. The test is still running.</Text><Button size="compact-sm" mt={6} onClick={() => setStill(null)} leftSection={<IconPlayerPlay size={12} />}>Jump to live</Button></div>}
|
| 167 |
</div>
|
| 168 |
<Group justify="space-between" wrap="wrap" gap={8}>
|
| 169 |
<Text size="xs" c="dimmed">Test data only. This is the test environment's browser, not your own session.{l?.page_title ? ` Page: ${l.page_title}.` : ''}</Text>
|
web/src/pages/LoginPage.tsx
CHANGED
|
@@ -46,9 +46,9 @@ export function LoginPage() {
|
|
| 46 |
onChange={(e) => setUsername(e.currentTarget.value)} data-autofocus size="md" radius="md" />
|
| 47 |
<PasswordInput label="Password" autoComplete="current-password" required value={password} onChange={(e) => setPassword(e.currentTarget.value)} size="md" radius="md" />
|
| 48 |
{supabase && <Anchor component={Link} to="/forgot" size="sm" mt={-8} style={{ alignSelf: 'flex-end' }}>Forgot your password?</Anchor>}
|
| 49 |
-
<Button type="submit" loading={busy} size="md" radius="md" fullWidth>Sign in</Button>
|
| 50 |
{authCfg.data?.registration && (
|
| 51 |
-
<Group gap={6} justify="center"><Text size="sm" c="dimmed">New here?</Text><Anchor component={Link} to="/register" size="sm" fw={
|
| 52 |
)}
|
| 53 |
</Stack>
|
| 54 |
</form>
|
|
|
|
| 46 |
onChange={(e) => setUsername(e.currentTarget.value)} data-autofocus size="md" radius="md" />
|
| 47 |
<PasswordInput label="Password" autoComplete="current-password" required value={password} onChange={(e) => setPassword(e.currentTarget.value)} size="md" radius="md" />
|
| 48 |
{supabase && <Anchor component={Link} to="/forgot" size="sm" mt={-8} style={{ alignSelf: 'flex-end' }}>Forgot your password?</Anchor>}
|
| 49 |
+
<Button type="submit" variant="filled" loading={busy} size="md" radius="md" fullWidth>Sign in</Button>
|
| 50 |
{authCfg.data?.registration && (
|
| 51 |
+
<Group gap={6} justify="center"><Text size="sm" c="dimmed">New here?</Text><Anchor component={Link} to="/register" size="sm" fw={600}>Create an account</Anchor></Group>
|
| 52 |
)}
|
| 53 |
</Stack>
|
| 54 |
</form>
|
web/src/pages/PasswordPages.tsx
CHANGED
|
@@ -43,8 +43,8 @@ export function ForgotPage() {
|
|
| 43 |
{!!err && <Alert color="red" role="alert" radius="md">{errorMessage(err)}</Alert>}
|
| 44 |
<TextInput label="Work e-mail" type="email" placeholder="you@company.com" autoComplete="email" required value={email}
|
| 45 |
onChange={(e) => setEmail(e.currentTarget.value)} size="md" radius="md" data-autofocus />
|
| 46 |
-
<Button type="submit" loading={busy} size="md" radius="md" fullWidth disabled={!email}>Send the reset link</Button>
|
| 47 |
-
<Group gap={6} justify="center"><Anchor component={Link} to="/login" size="sm" fw={
|
| 48 |
</Stack>
|
| 49 |
)}
|
| 50 |
</form>
|
|
@@ -85,13 +85,13 @@ export function ResetPage() {
|
|
| 85 |
<Stack gap="md" data-testid="reset-done">
|
| 86 |
<Title order={2}>Password changed</Title>
|
| 87 |
<Text size="sm">Your new password is set. Sign in with it now.</Text>
|
| 88 |
-
<Button component={Link} to="/login" size="md" radius="md" fullWidth>Go to sign in</Button>
|
| 89 |
</Stack>
|
| 90 |
) : !token ? (
|
| 91 |
<Stack gap="md">
|
| 92 |
<Title order={2}>This link can't be used</Title>
|
| 93 |
<Text size="sm" c="dimmed">{linkError ? decodeURIComponent(linkError.replace(/\+/g, ' ')) : 'The reset link is incomplete or has already been used.'} Ask for a new one.</Text>
|
| 94 |
-
<Button component={Link} to="/forgot" size="md" radius="md" fullWidth>Send a new reset link</Button>
|
| 95 |
</Stack>
|
| 96 |
) : (
|
| 97 |
<Stack gap="md">
|
|
@@ -104,7 +104,7 @@ export function ResetPage() {
|
|
| 104 |
size="md" radius="md" error={password.length > 0 && password.length < 10 ? 'Use at least 10 characters.' : undefined} />
|
| 105 |
<PasswordInput label="Repeat the new password" autoComplete="new-password" required value={again} onChange={(e) => setAgain(e.currentTarget.value)}
|
| 106 |
size="md" radius="md" error={mismatch ? 'The two passwords are different.' : undefined} />
|
| 107 |
-
<Button type="submit" loading={busy} size="md" radius="md" fullWidth disabled={mismatch || password.length < 10}>Save the new password</Button>
|
| 108 |
</Stack>
|
| 109 |
)}
|
| 110 |
</form>
|
|
|
|
| 43 |
{!!err && <Alert color="red" role="alert" radius="md">{errorMessage(err)}</Alert>}
|
| 44 |
<TextInput label="Work e-mail" type="email" placeholder="you@company.com" autoComplete="email" required value={email}
|
| 45 |
onChange={(e) => setEmail(e.currentTarget.value)} size="md" radius="md" data-autofocus />
|
| 46 |
+
<Button type="submit" variant="filled" loading={busy} size="md" radius="md" fullWidth disabled={!email}>Send the reset link</Button>
|
| 47 |
+
<Group gap={6} justify="center"><Anchor component={Link} to="/login" size="sm" fw={600}>Back to sign in</Anchor></Group>
|
| 48 |
</Stack>
|
| 49 |
)}
|
| 50 |
</form>
|
|
|
|
| 85 |
<Stack gap="md" data-testid="reset-done">
|
| 86 |
<Title order={2}>Password changed</Title>
|
| 87 |
<Text size="sm">Your new password is set. Sign in with it now.</Text>
|
| 88 |
+
<Button variant="filled" component={Link} to="/login" size="md" radius="md" fullWidth>Go to sign in</Button>
|
| 89 |
</Stack>
|
| 90 |
) : !token ? (
|
| 91 |
<Stack gap="md">
|
| 92 |
<Title order={2}>This link can't be used</Title>
|
| 93 |
<Text size="sm" c="dimmed">{linkError ? decodeURIComponent(linkError.replace(/\+/g, ' ')) : 'The reset link is incomplete or has already been used.'} Ask for a new one.</Text>
|
| 94 |
+
<Button variant="filled" component={Link} to="/forgot" size="md" radius="md" fullWidth>Send a new reset link</Button>
|
| 95 |
</Stack>
|
| 96 |
) : (
|
| 97 |
<Stack gap="md">
|
|
|
|
| 104 |
size="md" radius="md" error={password.length > 0 && password.length < 10 ? 'Use at least 10 characters.' : undefined} />
|
| 105 |
<PasswordInput label="Repeat the new password" autoComplete="new-password" required value={again} onChange={(e) => setAgain(e.currentTarget.value)}
|
| 106 |
size="md" radius="md" error={mismatch ? 'The two passwords are different.' : undefined} />
|
| 107 |
+
<Button type="submit" variant="filled" loading={busy} size="md" radius="md" fullWidth disabled={mismatch || password.length < 10}>Save the new password</Button>
|
| 108 |
</Stack>
|
| 109 |
)}
|
| 110 |
</form>
|
web/src/pages/PodsPage.tsx
CHANGED
|
@@ -1,10 +1,11 @@
|
|
| 1 |
-
import { Alert, Button, Group, Modal, MultiSelect, PasswordInput, Select, SimpleGrid, Stack, Switch, Text, TextInput, Textarea } from '@mantine/core';
|
| 2 |
-
import { IconCircleCheck, IconCircleX, IconKey, IconPlugConnected, IconPlus,
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { MODULE_NAMES } from '../agents';
|
| 5 |
import { usePodMutations, usePods, type Pod } from '../api/hooks';
|
| 6 |
import { useAuth } from '../auth/AuthContext';
|
| 7 |
-
import { Can, ErrorAlert, fmtTs,
|
|
|
|
| 8 |
|
| 9 |
const MODULE_OPTIONS = Object.entries(MODULE_NAMES).map(([value, name]) => ({ value, label: `${name} (${value})` }));
|
| 10 |
const ENV_OPTIONS = [
|
|
@@ -29,7 +30,7 @@ function AddPodModal({ opened, onClose }: { opened: boolean; onClose: () => void
|
|
| 29 |
<MultiSelect label="Modules enabled on this pod" data={MODULE_OPTIONS} value={f.modules} onChange={set('modules')} searchable />
|
| 30 |
<Textarea label="Notes (optional)" value={f.notes} onChange={(e) => set('notes')(e.currentTarget.value)} autosize minRows={2} />
|
| 31 |
<ErrorAlert error={m.create.error} title="Could not save the pod" />
|
| 32 |
-
<Group justify="flex-end"><Button variant="default" onClick={onClose}>Cancel</Button><Button onClick={() => void save()} loading={m.create.isPending} disabled={!f.name || f.base_url.length < 12}>Save pod</Button></Group>
|
| 33 |
</Stack>
|
| 34 |
</Modal>
|
| 35 |
);
|
|
@@ -48,12 +49,12 @@ function CredentialModal({ pod, onClose }: { pod: Pod | null; onClose: () => voi
|
|
| 48 |
return (
|
| 49 |
<Modal opened={!!pod} onClose={onClose} title={`Sign-in details for ${pod?.name ?? ''}`} radius="lg" centered>
|
| 50 |
<Stack gap="sm">
|
| 51 |
-
<Alert color="
|
| 52 |
<Select label="Module" data={MODULE_OPTIONS} value={module} onChange={setModule} searchable allowDeselect={false} />
|
| 53 |
<TextInput label="Test username" value={username} onChange={(e) => setUsername(e.currentTarget.value)} autoComplete="off" />
|
| 54 |
<PasswordInput label="Test password" value={password} onChange={(e) => setPassword(e.currentTarget.value)} autoComplete="new-password" />
|
| 55 |
<ErrorAlert error={m.credential.error} />
|
| 56 |
-
<Group justify="flex-end"><Button variant="default" onClick={onClose}>Cancel</Button><Button onClick={() => void save()} loading={m.credential.isPending} disabled={!username || !password}>Save sign-in</Button></Group>
|
| 57 |
</Stack>
|
| 58 |
</Modal>
|
| 59 |
);
|
|
@@ -64,40 +65,38 @@ function PodCard({ p, onCreds }: { p: Pod; onCreds: (p: Pod) => void }) {
|
|
| 64 |
const { can } = useAuth();
|
| 65 |
const [result, setResult] = useState<{ ok: boolean; detail: string } | null>(null);
|
| 66 |
const test = async () => setResult(await m.test.mutateAsync(p.id));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
return (
|
| 68 |
-
<div className="fpt-card"
|
| 69 |
-
<
|
| 70 |
-
<
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
</div>
|
| 76 |
-
</Group>
|
| 77 |
-
{p.runnable ? <Pill tone="green">ready for test runs</Pill> : <Pill tone="amber">not available for runs</Pill>}
|
| 78 |
-
</Group>
|
| 79 |
-
<Group gap={6} mt="sm">
|
| 80 |
-
<Pill tone={p.kind === 'mock' ? 'lav' : 'blue'}>{p.kind === 'mock' ? 'Practice mock app' : 'Oracle Fusion'}</Pill>
|
| 81 |
-
<Pill tone="mint">{ENV_OPTIONS.find((e) => e.value === p.environment)?.label ?? p.environment}</Pill>
|
| 82 |
-
{p.release && <Pill>release {p.release}</Pill>}
|
| 83 |
-
{p.is_default && <Pill>default</Pill>}
|
| 84 |
-
{!p.enabled && <Pill tone="red">disabled</Pill>}
|
| 85 |
</Group>
|
| 86 |
-
|
| 87 |
-
<Text size="xs"
|
| 88 |
-
<
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
|
|
|
| 94 |
{result && (
|
| 95 |
-
<
|
|
|
|
|
|
|
| 96 |
)}
|
| 97 |
<ErrorAlert error={m.test.error || m.update.error} />
|
| 98 |
<Group gap="xs" mt="md">
|
| 99 |
-
<Can perm="run.start"><Button size="xs"
|
| 100 |
-
{can('admin') && p.kind !== 'mock' && <Button size="xs"
|
| 101 |
{can('admin') && !p.is_default && (
|
| 102 |
<Switch size="xs" label="Enabled" checked={p.enabled} onChange={(e) => m.update.mutate({ id: p.id, body: { enabled: e.currentTarget.checked } })} />
|
| 103 |
)}
|
|
@@ -112,18 +111,21 @@ export function PodsPage() {
|
|
| 112 |
const [creds, setCreds] = useState<Pod | null>(null);
|
| 113 |
return (
|
| 114 |
<Stack gap="md">
|
| 115 |
-
<PageHeader crumbs={[{ label: 'Home', to: '/runs' }, { label: 'Test environments' }]} title="Test environments
|
| 116 |
-
<
|
|
|
|
| 117 |
</PageHeader>
|
| 118 |
-
<
|
| 119 |
-
<
|
| 120 |
-
<Text size="sm" c="dimmed">
|
| 121 |
A pod is the Oracle Fusion <b>test</b> environment the agents test after a quarterly patch. Admins register each pod here with its
|
| 122 |
URL and a test sign-in per module; everyone then picks the pod when starting a run. Production pods are never allowed.
|
| 123 |
In this pilot, runs execute only on the local practice mock app; Oracle Fusion pods can be registered and connection-tested ahead of go-live.
|
| 124 |
</Text>
|
| 125 |
-
</
|
| 126 |
<ErrorAlert error={pods.error} />
|
|
|
|
|
|
|
| 127 |
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
| 128 |
{(pods.data ?? []).map((p) => <PodCard key={p.id} p={p} onCreds={setCreds} />)}
|
| 129 |
</SimpleGrid>
|
|
|
|
| 1 |
+
import { Alert, Button, Group, Modal, MultiSelect, PasswordInput, Select, SimpleGrid, Skeleton, Stack, Switch, Text, TextInput, Textarea } from '@mantine/core';
|
| 2 |
+
import { IconCircleCheck, IconCircleX, IconCloud, IconKey, IconPlugConnected, IconPlus, IconShieldLock } from '@tabler/icons-react';
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { MODULE_NAMES } from '../agents';
|
| 5 |
import { usePodMutations, usePods, type Pod } from '../api/hooks';
|
| 6 |
import { useAuth } from '../auth/AuthContext';
|
| 7 |
+
import { Can, ErrorAlert, fmtTs, MOCK_TEXT, PageHeader } from '../components/common';
|
| 8 |
+
import { shortWhen } from '../runName';
|
| 9 |
|
| 10 |
const MODULE_OPTIONS = Object.entries(MODULE_NAMES).map(([value, name]) => ({ value, label: `${name} (${value})` }));
|
| 11 |
const ENV_OPTIONS = [
|
|
|
|
| 30 |
<MultiSelect label="Modules enabled on this pod" data={MODULE_OPTIONS} value={f.modules} onChange={set('modules')} searchable />
|
| 31 |
<Textarea label="Notes (optional)" value={f.notes} onChange={(e) => set('notes')(e.currentTarget.value)} autosize minRows={2} />
|
| 32 |
<ErrorAlert error={m.create.error} title="Could not save the pod" />
|
| 33 |
+
<Group justify="flex-end"><Button variant="default" onClick={onClose}>Cancel</Button><Button variant="filled" onClick={() => void save()} loading={m.create.isPending} disabled={!f.name || f.base_url.length < 12}>Save pod</Button></Group>
|
| 34 |
</Stack>
|
| 35 |
</Modal>
|
| 36 |
);
|
|
|
|
| 49 |
return (
|
| 50 |
<Modal opened={!!pod} onClose={onClose} title={`Sign-in details for ${pod?.name ?? ''}`} radius="lg" centered>
|
| 51 |
<Stack gap="sm">
|
| 52 |
+
<Alert color="gray" variant="light">Use a dedicated <b>test user</b> with only the roles the tests need. The password is stored in the secrets vault, is never shown again, and never reaches an AI model.</Alert>
|
| 53 |
<Select label="Module" data={MODULE_OPTIONS} value={module} onChange={setModule} searchable allowDeselect={false} />
|
| 54 |
<TextInput label="Test username" value={username} onChange={(e) => setUsername(e.currentTarget.value)} autoComplete="off" />
|
| 55 |
<PasswordInput label="Test password" value={password} onChange={(e) => setPassword(e.currentTarget.value)} autoComplete="new-password" />
|
| 56 |
<ErrorAlert error={m.credential.error} />
|
| 57 |
+
<Group justify="flex-end"><Button variant="default" onClick={onClose}>Cancel</Button><Button variant="filled" onClick={() => void save()} loading={m.credential.isPending} disabled={!username || !password}>Save sign-in</Button></Group>
|
| 58 |
</Stack>
|
| 59 |
</Modal>
|
| 60 |
);
|
|
|
|
| 65 |
const { can } = useAuth();
|
| 66 |
const [result, setResult] = useState<{ ok: boolean; detail: string } | null>(null);
|
| 67 |
const test = async () => setResult(await m.test.mutateAsync(p.id));
|
| 68 |
+
const fusion = p.kind !== 'mock';
|
| 69 |
+
const env = ENV_OPTIONS.find((e) => e.value === p.environment)?.label ?? p.environment;
|
| 70 |
+
const conn = !p.last_check_at ? { tone: 'neutral', words: 'Not checked yet' }
|
| 71 |
+
: p.last_check_ok ? { tone: 'green', words: `Connected, checked ${shortWhen(p.last_check_at)}` }
|
| 72 |
+
: { tone: 'red', words: `Connection failed, checked ${shortWhen(p.last_check_at)}${p.last_check_detail ? `: ${p.last_check_detail}` : ''}` };
|
| 73 |
return (
|
| 74 |
+
<div className="fpt-card fpt-podcard" data-testid={`pod-${p.id}`} data-kind={fusion ? 'fusion' : 'mock'}>
|
| 75 |
+
<div className="fpt-podcard-cue">
|
| 76 |
+
{fusion ? <><IconCloud size={15} aria-hidden />Oracle Fusion pod</> : <><IconShieldLock size={15} aria-hidden />Practice environment: {MOCK_TEXT}</>}
|
| 77 |
+
</div>
|
| 78 |
+
<Group justify="space-between" align="baseline" wrap="wrap" gap={6} mt={6}>
|
| 79 |
+
<Text fw={600}>{p.name}{p.is_default && <Text span size="sm" c="dimmed" fw={400}> (default)</Text>}</Text>
|
| 80 |
+
{!p.enabled && <span className="fpt-dotword">Disabled</span>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
</Group>
|
| 82 |
+
<Text size="xs" c="dimmed" style={{ wordBreak: 'break-all' }}>{p.base_url}</Text>
|
| 83 |
+
<Text size="xs" c="dimmed">{env}{p.release ? `, release ${p.release}` : ''}. Modules: {p.modules.length ? p.modules.map((x) => MODULE_NAMES[x] ?? x).join(', ') : 'any'}.</Text>
|
| 84 |
+
<Stack gap={4} mt="sm">
|
| 85 |
+
<span className="fpt-dotword" data-tone={conn.tone} title={p.last_check_at ? fmtTs(p.last_check_at) : undefined}>{conn.words}</span>
|
| 86 |
+
{p.runnable ? <Text size="xs">Ready for test runs.</Text> : <Text size="xs" style={{ color: 'var(--pill-amber-fg)' }}>Not available for test runs{p.not_runnable_reason ? `: ${p.not_runnable_reason}` : '.'}</Text>}
|
| 87 |
+
<Text size="xs" c="dimmed">
|
| 88 |
+
Sign-in details: {p.credentials.length ? p.credentials.map((c) => `${c.module} (set by ${c.set_by})`).join(', ') : p.kind === 'mock' ? 'not needed for the mock app' : 'none yet'}.
|
| 89 |
+
</Text>
|
| 90 |
+
</Stack>
|
| 91 |
{result && (
|
| 92 |
+
<Text size="sm" mt="sm" className="fpt-podtest" data-ok={result.ok} data-testid="pod-test-result" role="status">
|
| 93 |
+
{result.ok ? <IconCircleCheck size={15} aria-hidden /> : <IconCircleX size={15} aria-hidden />}{result.detail}
|
| 94 |
+
</Text>
|
| 95 |
)}
|
| 96 |
<ErrorAlert error={m.test.error || m.update.error} />
|
| 97 |
<Group gap="xs" mt="md">
|
| 98 |
+
<Can perm="run.start"><Button size="xs" leftSection={<IconPlugConnected size={13} />} onClick={() => void test()} loading={m.test.isPending}>Test connection</Button></Can>
|
| 99 |
+
{can('admin') && p.kind !== 'mock' && <Button size="xs" leftSection={<IconKey size={13} />} onClick={() => onCreds(p)}>Sign-in details</Button>}
|
| 100 |
{can('admin') && !p.is_default && (
|
| 101 |
<Switch size="xs" label="Enabled" checked={p.enabled} onChange={(e) => m.update.mutate({ id: p.id, body: { enabled: e.currentTarget.checked } })} />
|
| 102 |
)}
|
|
|
|
| 111 |
const [creds, setCreds] = useState<Pod | null>(null);
|
| 112 |
return (
|
| 113 |
<Stack gap="md">
|
| 114 |
+
<PageHeader crumbs={[{ label: 'Home', to: '/runs' }, { label: 'Test environments' }]} title="Test environments"
|
| 115 |
+
extra={<span className="fpt-pagedesc">The Oracle Fusion test pods the agents test after a patch, and the practice environment. Production pods are never allowed.</span>}>
|
| 116 |
+
<Can perm="admin"><Button variant="filled" onClick={() => setAdding(true)} leftSection={<IconPlus size={13} />} aria-label="Add test environment (Add pod)">Add test environment</Button></Can>
|
| 117 |
</PageHeader>
|
| 118 |
+
<details className="fpt-podhelp">
|
| 119 |
+
<summary>What is a pod?</summary>
|
| 120 |
+
<Text size="sm" c="dimmed" mt={6}>
|
| 121 |
A pod is the Oracle Fusion <b>test</b> environment the agents test after a quarterly patch. Admins register each pod here with its
|
| 122 |
URL and a test sign-in per module; everyone then picks the pod when starting a run. Production pods are never allowed.
|
| 123 |
In this pilot, runs execute only on the local practice mock app; Oracle Fusion pods can be registered and connection-tested ahead of go-live.
|
| 124 |
</Text>
|
| 125 |
+
</details>
|
| 126 |
<ErrorAlert error={pods.error} />
|
| 127 |
+
{pods.isLoading && <SimpleGrid cols={{ base: 1, md: 2 }}><Skeleton height={200} radius="md" /><Skeleton height={200} radius="md" /></SimpleGrid>}
|
| 128 |
+
{!pods.isLoading && (pods.data ?? []).length === 0 && <Text size="sm" c="dimmed">No test environments yet. Add the practice pod or an Oracle Fusion test pod.</Text>}
|
| 129 |
<SimpleGrid cols={{ base: 1, md: 2 }}>
|
| 130 |
{(pods.data ?? []).map((p) => <PodCard key={p.id} p={p} onCreds={setCreds} />)}
|
| 131 |
</SimpleGrid>
|
web/src/pages/QueuesPages.tsx
CHANGED
|
@@ -95,20 +95,26 @@ export function TicketsPage() {
|
|
| 95 |
const t = useTicket(sel);
|
| 96 |
return (
|
| 97 |
<Stack>
|
| 98 |
-
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Defects' }]} title="Defects"
|
| 99 |
-
|
| 100 |
<ErrorAlert error={q.error} />
|
| 101 |
-
<
|
| 102 |
-
<Table
|
| 103 |
-
<Table
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
<Drawer opened={!!sel} onClose={() => setSel(null)} position="right" size="lg" title={sel ?? ''}>
|
| 113 |
{t.data && <Pre maxHeight={800}>{JSON.stringify(t.data.body ?? t.data, null, 2)}</Pre>}
|
| 114 |
</Drawer>
|
|
|
|
| 95 |
const t = useTicket(sel);
|
| 96 |
return (
|
| 97 |
<Stack>
|
| 98 |
+
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Defects' }]} title="Defects"
|
| 99 |
+
extra={<span className="fpt-pagedesc">Raised only for failures a person confirmed as real defects. Pilot: saved as files under var/tickets (Jira and ServiceNow are not connected yet).</span>} />
|
| 100 |
<ErrorAlert error={q.error} />
|
| 101 |
+
<div className="fpt-card" style={{ overflow: 'hidden' }}>
|
| 102 |
+
<Table.ScrollContainer minWidth={640}>
|
| 103 |
+
<Table fz="sm" aria-label="tickets" className="fpt-table">
|
| 104 |
+
<Table.Thead><Table.Tr><Table.Th>Ticket</Table.Th><Table.Th>Case</Table.Th><Table.Th>Run</Table.Th><Table.Th>Sink</Table.Th><Table.Th>Status</Table.Th><Table.Th>By</Table.Th><Table.Th>Created</Table.Th></Table.Tr></Table.Thead>
|
| 105 |
+
<Table.Tbody>
|
| 106 |
+
{q.data?.items.length === 0 && <Table.Tr><Table.Td colSpan={7}><Text size="sm" c="dimmed">No defects yet. A defect is raised when you confirm a failed scenario as a real problem.</Text></Table.Td></Table.Tr>}
|
| 107 |
+
{q.data?.items.map((x) => (
|
| 108 |
+
<Table.Tr key={x.ticket_id}><Table.Td><Anchor component="button" onClick={() => setSel(x.ticket_id)}>{x.ticket_id}</Anchor></Table.Td><Table.Td>{x.case_id}</Table.Td>
|
| 109 |
+
<Table.Td><Anchor component={Link} to={`/runs/${x.run_id}/triage`} className="fpt-idpill">{x.run_id}</Anchor></Table.Td><Table.Td>{x.sink}</Table.Td>
|
| 110 |
+
{/* every ticket is a person-confirmed real defect, so an open one is red; any other status is neutral */}
|
| 111 |
+
<Table.Td><span className="fpt-dotword" data-tone={x.status === 'open' ? 'red' : 'neutral'} data-testid={`status-${x.status}`}>{x.status === 'open' ? 'Open' : x.status.charAt(0).toUpperCase() + x.status.slice(1).replace(/_/g, ' ')}</span></Table.Td>
|
| 112 |
+
<Table.Td>{x.created_by}</Table.Td><Table.Td>{fmtTs(x.created_at)}</Table.Td></Table.Tr>
|
| 113 |
+
))}
|
| 114 |
+
</Table.Tbody>
|
| 115 |
+
</Table>
|
| 116 |
+
</Table.ScrollContainer>
|
| 117 |
+
</div>
|
| 118 |
<Drawer opened={!!sel} onClose={() => setSel(null)} position="right" size="lg" title={sel ?? ''}>
|
| 119 |
{t.data && <Pre maxHeight={800}>{JSON.stringify(t.data.body ?? t.data, null, 2)}</Pre>}
|
| 120 |
</Drawer>
|
web/src/pages/ReadinessPage.tsx
CHANGED
|
@@ -1,16 +1,20 @@
|
|
| 1 |
import { Accordion, Anchor, Button, Group, Modal, Select, Skeleton, Stack, Text } from '@mantine/core';
|
| 2 |
-
import { IconExternalLink, IconPlus } from '@tabler/icons-react';
|
| 3 |
-
import { useEffect, useState } from 'react';
|
| 4 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
-
import {
|
|
|
|
| 7 |
import type { ModuleReadiness, PatchChange } from '../api/types';
|
| 8 |
import { Can, ErrorAlert, GlossaryButton, PageHeader, Pill } from '../components/common';
|
|
|
|
|
|
|
| 9 |
import { ProcessFlow, StepLegend } from '../components/ProcessFlow';
|
| 10 |
-
import {
|
| 11 |
import { EmptyState } from '../components/shell/EmptyState';
|
| 12 |
import { useUiPrefs } from '../components/shell/prefs';
|
| 13 |
-
import { VERDICT_TONE } from '../glossary';
|
|
|
|
| 14 |
import { StartRunForm } from './StartRunWizard';
|
| 15 |
|
| 16 |
const joinWords = (xs: string[]) => (xs.length <= 1 ? xs.join('') : `${xs.slice(0, -1).join(', ')} and ${xs[xs.length - 1]}`);
|
|
@@ -27,34 +31,82 @@ export function readinessSentence(m: ModuleReadiness): string {
|
|
| 27 |
return `${passed} of ${c.scenarios} scenarios passed so far.`;
|
| 28 |
}
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
const c = m.counts;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
const [more, setMore] = useState(false);
|
| 33 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
return (
|
| 35 |
-
<section className="fpt-card"
|
| 36 |
-
<Group justify="space-between" wrap="
|
| 37 |
-
<Text fw={600} size="lg">{
|
| 38 |
-
<
|
| 39 |
</Group>
|
| 40 |
-
<Text size="sm"
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 49 |
</Group>
|
| 50 |
{more && (
|
| 51 |
<Stack gap={6} mt="sm" data-testid={`details-${m.module}`}>
|
| 52 |
<StepLegend />
|
| 53 |
<Text size="xs" c="dimmed">
|
| 54 |
-
Scenarios in this test run: {c.scenarios}
|
| 55 |
</Text>
|
| 56 |
-
{
|
| 57 |
-
<Text size="xs" c="dimmed">{
|
| 58 |
</Stack>
|
| 59 |
)}
|
| 60 |
</section>
|
|
@@ -84,7 +136,7 @@ function ChangeItem({ ch }: { ch: PatchChange }) {
|
|
| 84 |
<Accordion.Item value={ch.id} data-testid={`change-${ch.id}`}>
|
| 85 |
<Accordion.Control>
|
| 86 |
<Group justify="space-between" wrap="wrap" gap={6}>
|
| 87 |
-
<Text size="sm" fw={
|
| 88 |
<Group gap={4}>
|
| 89 |
{ch.affected_steps.slice(0, 4).map((s) => <Pill key={s} tone="mint">{s}</Pill>)}
|
| 90 |
{ch.gap ? <Pill tone="amber">No test covers this yet</Pill> : <Pill tone="green">{ch.covering_scenarios.length} scenario(s) cover it</Pill>}
|
|
@@ -122,22 +174,30 @@ export function ReadinessPage() {
|
|
| 122 |
const newOpen = params.get('new') === '1';
|
| 123 |
const setNew = (open: boolean) => { const p = new URLSearchParams(params); if (open) p.set('new', '1'); else p.delete('new'); setParams(p); };
|
| 124 |
const mods = q.data?.modules ?? [];
|
| 125 |
-
const [verdict, setVerdict] = useState<string | null>(null);
|
| 126 |
-
const shown = verdict ? mods.filter((m) => m.verdict === verdict) : mods;
|
| 127 |
const latest = patch ?? q.data?.patch_id ?? q.data?.patches?.[0] ?? null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
return (
|
| 130 |
<Stack gap="md">
|
| 131 |
-
<PageHeader crumbs={[]} title="Patch readiness">
|
| 132 |
<Select aria-label="Test environment" size="xs" w={190} data={(pods.data ?? []).map((p) => ({ value: String(p.id), label: p.name }))}
|
| 133 |
value={podId ? String(podId) : null} onChange={(v) => { setPodId(v ? Number(v) : null); setPatch(null); }} />
|
| 134 |
<Select aria-label="Patch" size="xs" w={140} placeholder="latest" clearable data={q.data?.patches ?? []} value={patch} onChange={setPatch} />
|
| 135 |
-
<Can perm="run.start"><Button onClick={() => setNew(true)}
|
| 136 |
</PageHeader>
|
| 137 |
-
<ReleaseStrip podId={podId} patch={latest} />
|
| 138 |
<ErrorAlert error={q.error} />
|
| 139 |
-
{mods.length > 0 && <KpiTiles modules={mods} value={verdict} onChange={setVerdict} />}
|
| 140 |
-
<NeedsYouList limit={5} />
|
| 141 |
{q.isLoading && (
|
| 142 |
<div className="fpt-areas" aria-busy="true" aria-label="Loading the business areas">
|
| 143 |
<Skeleton height={220} radius="lg" /><Skeleton height={220} radius="lg" />
|
|
@@ -149,21 +209,16 @@ export function ReadinessPage() {
|
|
| 149 |
)}
|
| 150 |
{mods.length > 0 && (
|
| 151 |
<section aria-label="Business areas">
|
| 152 |
-
<
|
| 153 |
-
<Text className="fpt-section-kicker">Business areas{verdict ? ` · ${verdict}` : ''}</Text>
|
| 154 |
-
{verdict && <Button size="compact-xs" variant="subtle" color="gray" onClick={() => setVerdict(null)}>Show all</Button>}
|
| 155 |
-
</Group>
|
| 156 |
-
{shown.length === 0 && <Text size="sm" c="dimmed">No business area is “{verdict}” right now.</Text>}
|
| 157 |
-
<div className="fpt-areas">{shown.map((m) => <ModuleCard key={m.module} m={m} />)}</div>
|
| 158 |
</section>
|
| 159 |
)}
|
| 160 |
{mods.some((m) => m.changes.length > 0) && (
|
| 161 |
<Accordion variant="separated" radius="md">
|
| 162 |
<Accordion.Item value="changes">
|
| 163 |
<Accordion.Control>
|
| 164 |
-
<Text fw={
|
| 165 |
<Text size="xs" c="dimmed">
|
| 166 |
-
{mods.reduce((n, m) => n + m.changes.length, 0)} change area(s)
|
| 167 |
</Text>
|
| 168 |
</Accordion.Control>
|
| 169 |
<Accordion.Panel><PatchChanges modules={mods} /></Accordion.Panel>
|
|
|
|
| 1 |
import { Accordion, Anchor, Button, Group, Modal, Select, Skeleton, Stack, Text } from '@mantine/core';
|
| 2 |
+
import { IconAlertCircle, IconExternalLink, IconLoader2, IconPlus } from '@tabler/icons-react';
|
| 3 |
+
import { useEffect, useMemo, useState } from 'react';
|
| 4 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
+
import type { Schemas } from '../api/client';
|
| 7 |
+
import { usePods, useReadiness, useRunReadiness, useRuns } from '../api/hooks';
|
| 8 |
import type { ModuleReadiness, PatchChange } from '../api/types';
|
| 9 |
import { Can, ErrorAlert, GlossaryButton, PageHeader, Pill } from '../components/common';
|
| 10 |
+
|
| 11 |
+
const DECISION_TONE: Record<string, string> = { GO: 'green', 'NO-GO': 'red', HELD: 'amber' };
|
| 12 |
import { ProcessFlow, StepLegend } from '../components/ProcessFlow';
|
| 13 |
+
import { ReleaseLine } from '../components/shell/cockpit';
|
| 14 |
import { EmptyState } from '../components/shell/EmptyState';
|
| 15 |
import { useUiPrefs } from '../components/shell/prefs';
|
| 16 |
+
import { decisionWords, VERDICT_TONE } from '../glossary';
|
| 17 |
+
import { shortWhen } from '../runName';
|
| 18 |
import { StartRunForm } from './StartRunWizard';
|
| 19 |
|
| 20 |
const joinWords = (xs: string[]) => (xs.length <= 1 ? xs.join('') : `${xs.slice(0, -1).join(', ')} and ${xs[xs.length - 1]}`);
|
|
|
|
| 31 |
return `${passed} of ${c.scenarios} scenarios passed so far.`;
|
| 32 |
}
|
| 33 |
|
| 34 |
+
type RunSummary = Schemas['RunSummary'];
|
| 35 |
+
const TERMINAL = ['completed', 'failed', 'killed', 'cancelled', 'interrupted'];
|
| 36 |
+
const plural = (n: number, one: string, many = `${one}s`) => `${n} ${n === 1 ? one : many}`;
|
| 37 |
+
|
| 38 |
+
/** The result line of a finished test run for one area; it always names a scenario count. */
|
| 39 |
+
export function finishedSentence(m: ModuleReadiness): string {
|
| 40 |
const c = m.counts;
|
| 41 |
+
const passed = c.passed + c.passed_on_retry;
|
| 42 |
+
const failingSteps = m.steps.filter((s) => s.state === 'failing' && !s.cross_cutting).map((s) => s.name);
|
| 43 |
+
if (c.failing) return `${plural(c.failing, 'scenario')} failing${failingSteps.length ? ` in ${joinWords(failingSteps.slice(0, 3))}` : ''}.`;
|
| 44 |
+
if (c.scenarios && passed === c.scenarios) return `All ${plural(c.scenarios, 'scenario')} passed.`;
|
| 45 |
+
return `${passed} of ${plural(c.scenarios, 'scenario')} passed.`;
|
| 46 |
+
}
|
| 47 |
+
|
| 48 |
+
/** The newest run of an area when it is newer than the last finished one and not finished itself. */
|
| 49 |
+
export function inProgressLine(m: ModuleReadiness, lastId?: string | null): { words: string; waiting: boolean } | null {
|
| 50 |
+
if (!m.run_id || m.run_id === lastId) return null;
|
| 51 |
+
const st = m.run_status ?? '';
|
| 52 |
+
if (st === 'waiting_approval' || (!st && m.counts.waiting_for_you > 0)) return { words: 'A newer test run is waiting for your approval.', waiting: true };
|
| 53 |
+
if (st === 'waiting_review') return { words: 'A newer test run is waiting for your decision on failures.', waiting: true };
|
| 54 |
+
if (st === 'completed') return null;
|
| 55 |
+
if (TERMINAL.includes(st)) return { words: 'A newer test run stopped before it finished.', waiting: false };
|
| 56 |
+
return { words: 'A newer test run is testing now.', waiting: false };
|
| 57 |
+
}
|
| 58 |
+
|
| 59 |
+
/** One business area. On Patch readiness the verdict is always the last finished one (`last`); a newer run that has not
|
| 60 |
+
* finished is a second, labelled line. Inside a test run (`inRun`) the card describes that run. */
|
| 61 |
+
export function ModuleCard({ m, inRun = false, last }: { m: ModuleReadiness; inRun?: boolean; last?: RunSummary | null }) {
|
| 62 |
const [more, setMore] = useState(false);
|
| 63 |
+
const lastRd = useRunReadiness(last?.run_id ?? '', !inRun && !!last);
|
| 64 |
+
const lastMod = last ? (m.run_id === last.run_id ? m : lastRd.data?.modules.find((x) => x.module === m.module)) : undefined;
|
| 65 |
+
const signed = last && lastRd.data?.signoff ? lastRd.data.signoff : null;
|
| 66 |
+
const name = MODULE_NAMES[m.module] ?? m.module;
|
| 67 |
+
const shownMod = inRun ? m : lastMod ?? m;
|
| 68 |
+
const c = shownMod.counts;
|
| 69 |
+
const extra = shownMod.steps.filter((s) => s.cross_cutting || s.group).length;
|
| 70 |
+
const d = last?.decisions?.[m.module] ?? null;
|
| 71 |
+
const verdict = inRun ? m.verdict : d ? decisionWords(d) : 'Not tested yet';
|
| 72 |
+
const tone = inRun ? VERDICT_TONE[m.verdict] ?? 'neutral' : d ? DECISION_TONE[d] ?? 'neutral' : 'neutral';
|
| 73 |
+
const newer = inRun ? null : inProgressLine(m, last?.run_id);
|
| 74 |
+
const summary = inRun ? readinessSentence(m)
|
| 75 |
+
: !last ? 'Not tested yet for this environment and patch.'
|
| 76 |
+
: `Last result ${shortWhen(last.created_at)}${signed ? `, signed off by ${signed.by}` : ', not signed off yet'}. ${lastMod ? finishedSentence(lastMod) : 'Loading the scenario counts.'}`;
|
| 77 |
+
const openId = last?.run_id ?? m.run_id;
|
| 78 |
return (
|
| 79 |
+
<section className="fpt-card fpt-area" aria-label={`${name} readiness`} data-testid={`readiness-${m.module}`} data-waiting={newer?.waiting || undefined}>
|
| 80 |
+
<Group justify="space-between" wrap="nowrap" gap={8} align="baseline">
|
| 81 |
+
<Text fw={600} size="lg">{name}</Text>
|
| 82 |
+
<span className="fpt-verdictword" data-tone={tone} data-testid={`verdict-${m.module}`}>{verdict}</span>
|
| 83 |
</Group>
|
| 84 |
+
<Text size="sm" mt={2} data-testid={`summary-${m.module}`}>{summary}</Text>
|
| 85 |
+
{newer && (
|
| 86 |
+
<div className="fpt-area-newer" data-waiting={newer.waiting || undefined}>
|
| 87 |
+
{newer.waiting ? <IconAlertCircle size={16} aria-hidden /> : <IconLoader2 size={16} aria-hidden />}
|
| 88 |
+
<Text size="sm" span style={{ flex: '1 1 auto' }}>{newer.words}</Text>
|
| 89 |
+
{newer.waiting && m.run_id && <Button size="xs" variant="filled" component={Link} to={`/runs/${m.run_id}`}>Open your review</Button>}
|
| 90 |
+
{!newer.waiting && m.run_id && <Anchor size="sm" component={Link} to={`/runs/${m.run_id}`}>Open it</Anchor>}
|
| 91 |
+
</div>
|
| 92 |
+
)}
|
| 93 |
+
<div style={{ marginTop: 12 }}><ProcessFlow steps={shownMod.steps} mainOnly={!more} /></div>
|
| 94 |
+
<Group gap="xs" mt="md" wrap="wrap" align="center">
|
| 95 |
+
{inRun && m.run_id && c.failing > 0 && <Button size="xs" component={Link} to={`/runs/${m.run_id}/failures`}>See the failures</Button>}
|
| 96 |
+
{!inRun && last && c.failing > 0 && <Button size="xs" component={Link} to={`/runs/${last.run_id}/failures`}>See the failures</Button>}
|
| 97 |
+
{!inRun && openId && <Button size="xs" component={Link} to={`/runs/${openId}`}>Open the test run</Button>}
|
| 98 |
+
{!inRun && last && <Button size="xs" component={Link} to={`/runs/${last.run_id}/report`}>Report</Button>}
|
| 99 |
+
{!inRun && !m.run_id && !last && <Can perm="run.start"><Button size="xs" component={Link} to={`/runs/new?area=${encodeURIComponent(m.module)}`}>Start a test run</Button></Can>}
|
| 100 |
+
<Anchor component="button" type="button" size="sm" className="fpt-textlink" onClick={() => setMore((v) => !v)} aria-expanded={more}>{more ? 'Show less' : `Show details${extra ? ` and ${extra} more process areas` : ''}`}</Anchor>
|
| 101 |
</Group>
|
| 102 |
{more && (
|
| 103 |
<Stack gap={6} mt="sm" data-testid={`details-${m.module}`}>
|
| 104 |
<StepLegend />
|
| 105 |
<Text size="xs" c="dimmed">
|
| 106 |
+
Scenarios in this test run: {c.scenarios}. Passed {c.passed + c.passed_on_retry}, failing {c.failing}, waiting for you {c.waiting_for_you}. In the library: {c.library}.
|
| 107 |
</Text>
|
| 108 |
+
{shownMod.confirmed_defects.length > 0 && <Text size="sm">Confirmed defects: {shownMod.confirmed_defects.join(', ')}. <Anchor component={Link} to="/tickets">Defects</Anchor></Text>}
|
| 109 |
+
<Text size="xs" c="dimmed">{shownMod.basis}</Text>
|
| 110 |
</Stack>
|
| 111 |
)}
|
| 112 |
</section>
|
|
|
|
| 136 |
<Accordion.Item value={ch.id} data-testid={`change-${ch.id}`}>
|
| 137 |
<Accordion.Control>
|
| 138 |
<Group justify="space-between" wrap="wrap" gap={6}>
|
| 139 |
+
<Text size="sm" fw={600}>{ch.area}</Text>
|
| 140 |
<Group gap={4}>
|
| 141 |
{ch.affected_steps.slice(0, 4).map((s) => <Pill key={s} tone="mint">{s}</Pill>)}
|
| 142 |
{ch.gap ? <Pill tone="amber">No test covers this yet</Pill> : <Pill tone="green">{ch.covering_scenarios.length} scenario(s) cover it</Pill>}
|
|
|
|
| 174 |
const newOpen = params.get('new') === '1';
|
| 175 |
const setNew = (open: boolean) => { const p = new URLSearchParams(params); if (open) p.set('new', '1'); else p.delete('new'); setParams(p); };
|
| 176 |
const mods = q.data?.modules ?? [];
|
|
|
|
|
|
|
| 177 |
const latest = patch ?? q.data?.patch_id ?? q.data?.patches?.[0] ?? null;
|
| 178 |
+
// the last finished test run per area on this environment (and patch): the verdict an area shows
|
| 179 |
+
const finished = useRuns(100, 0, 'completed');
|
| 180 |
+
const lastFor = useMemo(() => {
|
| 181 |
+
const out: Record<string, RunSummary> = {};
|
| 182 |
+
for (const r of finished.data?.items ?? []) {
|
| 183 |
+
if (r.status !== 'completed' || (podId !== null && r.pod_id != null && r.pod_id !== podId)) continue;
|
| 184 |
+
if (latest && r.patch_id && r.patch_id !== latest) continue;
|
| 185 |
+
for (const mod of r.modules) if (r.decisions?.[mod] && (!out[mod] || r.created_at > out[mod].created_at)) out[mod] = r;
|
| 186 |
+
}
|
| 187 |
+
return out;
|
| 188 |
+
}, [finished.data, podId, latest]);
|
| 189 |
+
// areas that wait for you come first
|
| 190 |
+
const ordered = [...mods].sort((a, b) => Number(!!inProgressLine(b, lastFor[b.module]?.run_id)?.waiting) - Number(!!inProgressLine(a, lastFor[a.module]?.run_id)?.waiting));
|
| 191 |
|
| 192 |
return (
|
| 193 |
<Stack gap="md">
|
| 194 |
+
<PageHeader crumbs={[]} title="Patch readiness" extra={<ReleaseLine podId={podId} patch={latest} />}>
|
| 195 |
<Select aria-label="Test environment" size="xs" w={190} data={(pods.data ?? []).map((p) => ({ value: String(p.id), label: p.name }))}
|
| 196 |
value={podId ? String(podId) : null} onChange={(v) => { setPodId(v ? Number(v) : null); setPatch(null); }} />
|
| 197 |
<Select aria-label="Patch" size="xs" w={140} placeholder="latest" clearable data={q.data?.patches ?? []} value={patch} onChange={setPatch} />
|
| 198 |
+
<Can perm="run.start"><Button variant="filled" onClick={() => setNew(true)} leftSection={<IconPlus size={13} />}>New test run</Button></Can>
|
| 199 |
</PageHeader>
|
|
|
|
| 200 |
<ErrorAlert error={q.error} />
|
|
|
|
|
|
|
| 201 |
{q.isLoading && (
|
| 202 |
<div className="fpt-areas" aria-busy="true" aria-label="Loading the business areas">
|
| 203 |
<Skeleton height={220} radius="lg" /><Skeleton height={220} radius="lg" />
|
|
|
|
| 209 |
)}
|
| 210 |
{mods.length > 0 && (
|
| 211 |
<section aria-label="Business areas">
|
| 212 |
+
<div className="fpt-areas">{ordered.map((m) => <ModuleCard key={m.module} m={m} last={lastFor[m.module] ?? null} />)}</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 213 |
</section>
|
| 214 |
)}
|
| 215 |
{mods.some((m) => m.changes.length > 0) && (
|
| 216 |
<Accordion variant="separated" radius="md">
|
| 217 |
<Accordion.Item value="changes">
|
| 218 |
<Accordion.Control>
|
| 219 |
+
<Text fw={600}>What this patch changes</Text>
|
| 220 |
<Text size="xs" c="dimmed">
|
| 221 |
+
{mods.reduce((n, m) => n + m.changes.length, 0)} change area(s), {mods.reduce((n, m) => n + m.changes.filter((ch) => ch.gap).length, 0)} not covered by a test yet
|
| 222 |
</Text>
|
| 223 |
</Accordion.Control>
|
| 224 |
<Accordion.Panel><PatchChanges modules={mods} /></Accordion.Panel>
|
web/src/pages/RegisterPage.tsx
CHANGED
|
@@ -55,7 +55,7 @@ export function RegisterPage() {
|
|
| 55 |
<IconMailCheck size={40} />
|
| 56 |
<Title order={2}>Check your inbox</Title>
|
| 57 |
<Text size="sm">We sent a confirmation link to <b>{email}</b>. Open it, then come back and sign in.</Text>
|
| 58 |
-
<Button component={Link} to="/login" size="md" radius="md" fullWidth>Go to sign in</Button>
|
| 59 |
</Stack>
|
| 60 |
) : cfg.data && !cfg.data.registration ? (
|
| 61 |
<Stack gap="md">
|
|
@@ -78,8 +78,8 @@ export function RegisterPage() {
|
|
| 78 |
</div>
|
| 79 |
<PasswordInput label="Repeat the password" autoComplete="new-password" required value={again} onChange={(e) => setAgain(e.currentTarget.value)} size="md" radius="md"
|
| 80 |
error={mismatch ? 'The two passwords are different.' : undefined} />
|
| 81 |
-
<Button type="submit" loading={busy} size="md" radius="md" fullWidth disabled={mismatch || password.length < 10 || !email}>Create account</Button>
|
| 82 |
-
<Group gap={6} justify="center"><Text size="sm" c="dimmed">Already have an account?</Text><Anchor component={Link} to="/login" size="sm" fw={
|
| 83 |
</Stack>
|
| 84 |
)}
|
| 85 |
</form>
|
|
|
|
| 55 |
<IconMailCheck size={40} />
|
| 56 |
<Title order={2}>Check your inbox</Title>
|
| 57 |
<Text size="sm">We sent a confirmation link to <b>{email}</b>. Open it, then come back and sign in.</Text>
|
| 58 |
+
<Button variant="filled" component={Link} to="/login" size="md" radius="md" fullWidth>Go to sign in</Button>
|
| 59 |
</Stack>
|
| 60 |
) : cfg.data && !cfg.data.registration ? (
|
| 61 |
<Stack gap="md">
|
|
|
|
| 78 |
</div>
|
| 79 |
<PasswordInput label="Repeat the password" autoComplete="new-password" required value={again} onChange={(e) => setAgain(e.currentTarget.value)} size="md" radius="md"
|
| 80 |
error={mismatch ? 'The two passwords are different.' : undefined} />
|
| 81 |
+
<Button type="submit" variant="filled" loading={busy} size="md" radius="md" fullWidth disabled={mismatch || password.length < 10 || !email}>Create account</Button>
|
| 82 |
+
<Group gap={6} justify="center"><Text size="sm" c="dimmed">Already have an account?</Text><Anchor component={Link} to="/login" size="sm" fw={600}>Sign in</Anchor></Group>
|
| 83 |
</Stack>
|
| 84 |
)}
|
| 85 |
</form>
|
web/src/pages/RunCases.tsx
CHANGED
|
@@ -73,7 +73,7 @@ export function RunCases({ id, waiting }: { id: string; waiting: boolean }) {
|
|
| 73 |
<ErrorAlert error={approve.error} />
|
| 74 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray">Your role cannot answer this gate (consultant or admin required).</Alert>}>
|
| 75 |
<Group>
|
| 76 |
-
<Button onClick={() => submit([...sel])} loading={approve.isPending} disabled={approve.isSuccess}>Approve selected ({sel.size})</Button>
|
| 77 |
<Button variant="light" onClick={() => submit(pendingIds)} loading={approve.isPending} disabled={approve.isSuccess}>Approve all</Button>
|
| 78 |
<Button color="red" variant="light" onClick={() => submit([])} loading={approve.isPending} disabled={approve.isSuccess}>Reject all</Button>
|
| 79 |
{approve.isSuccess && <Text c="teal" size="sm" role="status">Answer recorded; the run resumes.</Text>}
|
|
|
|
| 73 |
<ErrorAlert error={approve.error} />
|
| 74 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray">Your role cannot answer this gate (consultant or admin required).</Alert>}>
|
| 75 |
<Group>
|
| 76 |
+
<Button variant="filled" onClick={() => submit([...sel])} loading={approve.isPending} disabled={approve.isSuccess}>Approve selected ({sel.size})</Button>
|
| 77 |
<Button variant="light" onClick={() => submit(pendingIds)} loading={approve.isPending} disabled={approve.isSuccess}>Approve all</Button>
|
| 78 |
<Button color="red" variant="light" onClick={() => submit([])} loading={approve.isPending} disabled={approve.isSuccess}>Reject all</Button>
|
| 79 |
{approve.isSuccess && <Text c="teal" size="sm" role="status">Answer recorded; the run resumes.</Text>}
|
web/src/pages/RunGuide.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import { Alert, Button, Group, Progress, Stack, Stepper, Text, TextInput, UnstyledButton } from '@mantine/core';
|
| 2 |
import { IconArrowLeft, IconArrowRight, IconCheck, IconCircleCheck, IconCircleDashed, IconFileSpreadsheet, IconFileReport, IconListDetails, IconLoader2, IconPhotoOff } from '@tabler/icons-react';
|
| 3 |
-
import { useState } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import type { Schemas } from '../api/client';
|
| 6 |
import { useApproveCases, useGate, usePods, useHumanReview, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks';
|
|
@@ -49,7 +49,7 @@ export function Prepare({ r }: { r: Run }) {
|
|
| 49 |
const st = (from: number, to: number) => (at > to ? 'done' : at >= from ? 'now' : 'todo');
|
| 50 |
return (
|
| 51 |
<Stack gap="sm">
|
| 52 |
-
<Text size="lg" fw={
|
| 53 |
<Text size="sm" c="dimmed">Nothing to do yet. This usually takes about a minute, and you will be asked for your approval next.</Text>
|
| 54 |
<Tick state={st(0, 0)}>Reading the test environment: which business areas are switched on</Tick>
|
| 55 |
<Tick state={st(1, 2)}>Reading what this patch changes</Tick>
|
|
@@ -69,7 +69,7 @@ export function Approve({ r }: { r: Run }) {
|
|
| 69 |
const aiFailed = (g?.ai_not_runnable ?? []).length;
|
| 70 |
return (
|
| 71 |
<Stack gap="sm">
|
| 72 |
-
<Text size="lg" fw={
|
| 73 |
<Text size="sm">
|
| 74 |
A scenario is one business check, for example “a requisition below the limit is approved by the first approver”.
|
| 75 |
{changed > 0 ? ` ${changed} of them cover something this patch changes.` : ''} We recommend testing all of them.
|
|
@@ -83,7 +83,7 @@ export function Approve({ r }: { r: Run }) {
|
|
| 83 |
<ErrorAlert error={approve.error || gate.error} />
|
| 84 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray">Approving scenarios needs the consultant or admin role. You can still read them and download the test script.</Alert>}>
|
| 85 |
<Group gap="sm" wrap="wrap">
|
| 86 |
-
<Button size="md" onClick={() => approve.mutate({ approved: ids, rejected: [], comments: {} })} loading={approve.isPending} disabled={!ids.length || approve.isSuccess}
|
| 87 |
rightSection={<IconArrowRight size={16} />} data-testid="guide-approve-all">
|
| 88 |
Approve all {ids.length} and start testing
|
| 89 |
</Button>
|
|
@@ -106,7 +106,7 @@ export function Testing({ r, watch }: { r: Run; watch: boolean }) {
|
|
| 106 |
fail: a.fail + m.counts.failing }), { n: 0, done: 0, fail: 0 });
|
| 107 |
return (
|
| 108 |
<Stack gap="sm">
|
| 109 |
-
<Text size="lg" fw={
|
| 110 |
<Text size="sm" c="dimmed">You can leave this page. Testing carries on, and you are only asked to step in if a scenario fails.</Text>
|
| 111 |
<div>
|
| 112 |
<Group justify="space-between" mb={4}>
|
|
@@ -153,12 +153,12 @@ export function Judge({ r, onShowScreen, onShowSteps }: { r: Run; onShowScreen?:
|
|
| 153 |
return (
|
| 154 |
<Stack gap="sm" aria-label="failure decisions">
|
| 155 |
<Group justify="space-between" wrap="wrap">
|
| 156 |
-
<Text size="lg" fw={
|
| 157 |
-
<
|
| 158 |
</Group>
|
| 159 |
<div className="fpt-card fpt-judge" style={{ padding: 16 }} data-testid={`guide-failure-${f.case_id}`}>
|
| 160 |
<div className="fpt-judge-text">
|
| 161 |
-
<Text fw={
|
| 162 |
{f.step && <Text size="xs" c="dimmed" mb="sm">It stopped at: {f.step}</Text>}
|
| 163 |
{f.ask === 'owner' ? (
|
| 164 |
<>
|
|
@@ -169,20 +169,20 @@ export function Judge({ r, onShowScreen, onShowSteps }: { r: Run; onShowScreen?:
|
|
| 169 |
<>
|
| 170 |
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: 10 }}>
|
| 171 |
<div className="fpt-card" style={{ padding: 10, background: 'var(--fpt-surface-2)' }}><Text size="xs" c="dimmed">We expected</Text><Text size="sm">{f.expected ?? 'the step to complete'}</Text></div>
|
| 172 |
-
<div className="fpt-card" style={{ padding: 10, background: 'var(--
|
| 173 |
</div>
|
| 174 |
{r.playwright_mode === 'stub' && (
|
| 175 |
<Text size="sm" c="dimmed" mt={6} className="fpt-judge-noscreen"><IconPhotoOff size={14} style={{ verticalAlign: -2 }} aria-hidden /> No screen: quick simulations don't open a browser.</Text>
|
| 176 |
)}
|
| 177 |
{onShowSteps && <Button variant="subtle" size="compact-xs" mt={6} px={0} leftSection={<IconListDetails size={14} />} onClick={() => onShowSteps(f.case_id)}>Show the steps</Button>}
|
| 178 |
<Text size="sm" mt="sm"><b>Our suggestion:</b> {f.suggestion}</Text>
|
| 179 |
-
<Text size="sm" fw={
|
| 180 |
<Stack gap={8} role="radiogroup" aria-label="Is this a real problem?">
|
| 181 |
{CHOICES.map((c) => (
|
| 182 |
<UnstyledButton key={c.value} role="radio" aria-checked={choice === c.value} onClick={() => set({ choice: c.value })} className="fpt-card fpt-choice" data-active={choice === c.value}>
|
| 183 |
<Group gap={10} wrap="nowrap">
|
| 184 |
<span className="fpt-choice-dot" aria-hidden>{choice === c.value && <IconCheck size={12} />}</span>
|
| 185 |
-
<div><Text size="sm" fw={
|
| 186 |
</Group>
|
| 187 |
</UnstyledButton>
|
| 188 |
))}
|
|
@@ -201,8 +201,8 @@ export function Judge({ r, onShowScreen, onShowSteps }: { r: Run; onShowScreen?:
|
|
| 201 |
<Group justify="space-between">
|
| 202 |
<Button variant="default" size="xs" leftSection={<IconArrowLeft size={13} />} disabled={i === 0} onClick={() => setI((n) => n - 1)}>Back</Button>
|
| 203 |
{last
|
| 204 |
-
? <Button onClick={send} loading={submit.isPending} disabled={submit.isSuccess} data-testid="guide-submit-decisions">Submit {pending.length === 1 ? 'my decision' : `my ${pending.length} decisions`}</Button>
|
| 205 |
-
: <Button onClick={() => setI((n) => n + 1)}
|
| 206 |
</Group>
|
| 207 |
</Can>
|
| 208 |
<Text size="xs" c="dimmed">Want the full picture first? <Link to={`/runs/${r.run_id}/failures`}>Open all failure details</Link>.</Text>
|
|
@@ -210,7 +210,7 @@ export function Judge({ r, onShowScreen, onShowSteps }: { r: Run; onShowScreen?:
|
|
| 210 |
);
|
| 211 |
}
|
| 212 |
|
| 213 |
-
export function Result({ r }: { r: Run }) {
|
| 214 |
const rd = useRunReadiness(r.run_id);
|
| 215 |
const fusion = (usePods().data ?? []).find((p) => p.id === r.pod_id)?.kind === 'fusion';
|
| 216 |
const d = r.decision ?? Object.values(r.decisions ?? {})[0] ?? null;
|
|
@@ -223,7 +223,7 @@ export function Result({ r }: { r: Run }) {
|
|
| 223 |
const tone = d === 'GO' ? 'green' : d === 'HELD' ? 'amber' : 'red';
|
| 224 |
return (
|
| 225 |
<Stack gap="sm">
|
| 226 |
-
<div className="fpt-
|
| 227 |
<Text fw={600} className="fpt-verdict">{decisionWords(d)}</Text>
|
| 228 |
<Text size="sm">
|
| 229 |
{d === 'GO' ? 'Every required check passed. This business area is ready for the patch.'
|
|
@@ -231,19 +231,17 @@ export function Result({ r }: { r: Run }) {
|
|
| 231 |
: 'At least one required check failed or is not covered yet, so this is not ready for the patch.'}
|
| 232 |
</Text>
|
| 233 |
</div>
|
| 234 |
-
<
|
| 235 |
-
<
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
{gaps > 0 && <Text size="sm">• {gaps} part{gaps === 1 ? '' : 's'} of the process have no test yet</Text>}
|
| 239 |
-
{rd.data?.signoff && <Text size="sm">• Signed off by {rd.data.signoff.by}</Text>}
|
| 240 |
-
</Stack>
|
| 241 |
<Group gap="xs" wrap="wrap">
|
| 242 |
-
<Button component={Link} to={`/runs/${r.run_id}/report`} leftSection={<IconFileReport size={14} />}>{rd.data?.signoff ? 'Open the report' : 'Open the report and sign off'}</Button>
|
| 243 |
<ExcelButton id={r.run_id} label="Download the results (Excel)" />
|
| 244 |
{r.playwright_mode !== 'stub' && <Button component={Link} to={`/runs/${r.run_id}/proof`} variant="default">See the screens</Button>}
|
| 245 |
</Group>
|
| 246 |
<Text size="xs" c="dimmed">{fusion ? `Results come from the Oracle Fusion pod ${r.pod_name ?? ''}.` : 'Results come from the practice environment (the mock app), not Oracle Fusion.'}</Text>
|
|
|
|
| 247 |
</Stack>
|
| 248 |
);
|
| 249 |
}
|
|
@@ -252,11 +250,11 @@ export function Stopped({ r }: { r: Run }) {
|
|
| 252 |
const action = useRunAction();
|
| 253 |
return (
|
| 254 |
<Stack gap="sm">
|
| 255 |
-
<Text size="lg" fw={
|
| 256 |
{r.error && <Text size="sm">Reason: {r.error}</Text>}
|
| 257 |
<ErrorAlert error={action.error} />
|
| 258 |
<Can perm="run.control">
|
| 259 |
-
{['interrupted', 'failed'].includes(r.status) && <Button w="fit-content" onClick={() => action.mutate({ id: r.run_id, action: 'resume' })} loading={action.isPending}>Carry on from where it stopped</Button>}
|
| 260 |
</Can>
|
| 261 |
</Stack>
|
| 262 |
);
|
|
|
|
| 1 |
import { Alert, Button, Group, Progress, Stack, Stepper, Text, TextInput, UnstyledButton } from '@mantine/core';
|
| 2 |
import { IconArrowLeft, IconArrowRight, IconCheck, IconCircleCheck, IconCircleDashed, IconFileSpreadsheet, IconFileReport, IconListDetails, IconLoader2, IconPhotoOff } from '@tabler/icons-react';
|
| 3 |
+
import { useState, type ReactNode } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import type { Schemas } from '../api/client';
|
| 6 |
import { useApproveCases, useGate, usePods, useHumanReview, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks';
|
|
|
|
| 49 |
const st = (from: number, to: number) => (at > to ? 'done' : at >= from ? 'now' : 'todo');
|
| 50 |
return (
|
| 51 |
<Stack gap="sm">
|
| 52 |
+
<Text size="lg" fw={600}>Getting the test ready</Text>
|
| 53 |
<Text size="sm" c="dimmed">Nothing to do yet. This usually takes about a minute, and you will be asked for your approval next.</Text>
|
| 54 |
<Tick state={st(0, 0)}>Reading the test environment: which business areas are switched on</Tick>
|
| 55 |
<Tick state={st(1, 2)}>Reading what this patch changes</Tick>
|
|
|
|
| 69 |
const aiFailed = (g?.ai_not_runnable ?? []).length;
|
| 70 |
return (
|
| 71 |
<Stack gap="sm">
|
| 72 |
+
<Text size="lg" fw={600}>{ids.length} scenario{ids.length === 1 ? '' : 's'} {ids.length === 1 ? 'is' : 'are'} ready to test</Text>
|
| 73 |
<Text size="sm">
|
| 74 |
A scenario is one business check, for example “a requisition below the limit is approved by the first approver”.
|
| 75 |
{changed > 0 ? ` ${changed} of them cover something this patch changes.` : ''} We recommend testing all of them.
|
|
|
|
| 83 |
<ErrorAlert error={approve.error || gate.error} />
|
| 84 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray">Approving scenarios needs the consultant or admin role. You can still read them and download the test script.</Alert>}>
|
| 85 |
<Group gap="sm" wrap="wrap">
|
| 86 |
+
<Button size="md" variant="filled" onClick={() => approve.mutate({ approved: ids, rejected: [], comments: {} })} loading={approve.isPending} disabled={!ids.length || approve.isSuccess}
|
| 87 |
rightSection={<IconArrowRight size={16} />} data-testid="guide-approve-all">
|
| 88 |
Approve all {ids.length} and start testing
|
| 89 |
</Button>
|
|
|
|
| 106 |
fail: a.fail + m.counts.failing }), { n: 0, done: 0, fail: 0 });
|
| 107 |
return (
|
| 108 |
<Stack gap="sm">
|
| 109 |
+
<Text size="lg" fw={600}>Testing in progress</Text>
|
| 110 |
<Text size="sm" c="dimmed">You can leave this page. Testing carries on, and you are only asked to step in if a scenario fails.</Text>
|
| 111 |
<div>
|
| 112 |
<Group justify="space-between" mb={4}>
|
|
|
|
| 153 |
return (
|
| 154 |
<Stack gap="sm" aria-label="failure decisions">
|
| 155 |
<Group justify="space-between" wrap="wrap">
|
| 156 |
+
<Text size="lg" fw={600}>{pending.length === 1 ? 'One scenario needs your decision' : `${pending.length} scenarios need your decision`}</Text>
|
| 157 |
+
{pending.length > 1 && <Text size="sm" c="dimmed" className="fpt-num" data-testid="guide-judge-count">{Math.min(i + 1, pending.length)} of {pending.length}</Text>}
|
| 158 |
</Group>
|
| 159 |
<div className="fpt-card fpt-judge" style={{ padding: 16 }} data-testid={`guide-failure-${f.case_id}`}>
|
| 160 |
<div className="fpt-judge-text">
|
| 161 |
+
<Text fw={600}>{f.title ?? f.case_id}</Text>
|
| 162 |
{f.step && <Text size="xs" c="dimmed" mb="sm">It stopped at: {f.step}</Text>}
|
| 163 |
{f.ask === 'owner' ? (
|
| 164 |
<>
|
|
|
|
| 169 |
<>
|
| 170 |
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(220px, 1fr))', gap: 10 }}>
|
| 171 |
<div className="fpt-card" style={{ padding: 10, background: 'var(--fpt-surface-2)' }}><Text size="xs" c="dimmed">We expected</Text><Text size="sm">{f.expected ?? 'the step to complete'}</Text></div>
|
| 172 |
+
<div className="fpt-card" style={{ padding: 10, background: 'var(--fpt-surface-2)' }}><Text size="xs" c="dimmed">What happened</Text><Text size="sm" style={{ color: 'var(--pill-red-fg)' }}>{f.actual ?? 'it did not complete'}</Text></div>
|
| 173 |
</div>
|
| 174 |
{r.playwright_mode === 'stub' && (
|
| 175 |
<Text size="sm" c="dimmed" mt={6} className="fpt-judge-noscreen"><IconPhotoOff size={14} style={{ verticalAlign: -2 }} aria-hidden /> No screen: quick simulations don't open a browser.</Text>
|
| 176 |
)}
|
| 177 |
{onShowSteps && <Button variant="subtle" size="compact-xs" mt={6} px={0} leftSection={<IconListDetails size={14} />} onClick={() => onShowSteps(f.case_id)}>Show the steps</Button>}
|
| 178 |
<Text size="sm" mt="sm"><b>Our suggestion:</b> {f.suggestion}</Text>
|
| 179 |
+
<Text size="sm" fw={600} mt="md" mb={6}>Is this a real problem?</Text>
|
| 180 |
<Stack gap={8} role="radiogroup" aria-label="Is this a real problem?">
|
| 181 |
{CHOICES.map((c) => (
|
| 182 |
<UnstyledButton key={c.value} role="radio" aria-checked={choice === c.value} onClick={() => set({ choice: c.value })} className="fpt-card fpt-choice" data-active={choice === c.value}>
|
| 183 |
<Group gap={10} wrap="nowrap">
|
| 184 |
<span className="fpt-choice-dot" aria-hidden>{choice === c.value && <IconCheck size={12} />}</span>
|
| 185 |
+
<div><Text size="sm" fw={600}>{c.title}{c.value === suggested(f) ? <Text span size="xs" c="dimmed" fw={400}> (suggested)</Text> : null}</Text><Text size="xs" c="dimmed">{c.body}</Text></div>
|
| 186 |
</Group>
|
| 187 |
</UnstyledButton>
|
| 188 |
))}
|
|
|
|
| 201 |
<Group justify="space-between">
|
| 202 |
<Button variant="default" size="xs" leftSection={<IconArrowLeft size={13} />} disabled={i === 0} onClick={() => setI((n) => n - 1)}>Back</Button>
|
| 203 |
{last
|
| 204 |
+
? <Button variant="filled" onClick={send} loading={submit.isPending} disabled={submit.isSuccess} data-testid="guide-submit-decisions">Submit {pending.length === 1 ? 'my decision' : `my ${pending.length} decisions`}</Button>
|
| 205 |
+
: <Button variant="filled" onClick={() => setI((n) => n + 1)} data-primary="next">Next</Button>}
|
| 206 |
</Group>
|
| 207 |
</Can>
|
| 208 |
<Text size="xs" c="dimmed">Want the full picture first? <Link to={`/runs/${r.run_id}/failures`}>Open all failure details</Link>.</Text>
|
|
|
|
| 210 |
);
|
| 211 |
}
|
| 212 |
|
| 213 |
+
export function Result({ r, after }: { r: Run; after?: ReactNode }) {
|
| 214 |
const rd = useRunReadiness(r.run_id);
|
| 215 |
const fusion = (usePods().data ?? []).find((p) => p.id === r.pod_id)?.kind === 'fusion';
|
| 216 |
const d = r.decision ?? Object.values(r.decisions ?? {})[0] ?? null;
|
|
|
|
| 223 |
const tone = d === 'GO' ? 'green' : d === 'HELD' ? 'amber' : 'red';
|
| 224 |
return (
|
| 225 |
<Stack gap="sm">
|
| 226 |
+
<div className="fpt-result" data-tone={tone} data-testid="guide-result">
|
| 227 |
<Text fw={600} className="fpt-verdict">{decisionWords(d)}</Text>
|
| 228 |
<Text size="sm">
|
| 229 |
{d === 'GO' ? 'Every required check passed. This business area is ready for the patch.'
|
|
|
|
| 231 |
: 'At least one required check failed or is not covered yet, so this is not ready for the patch.'}
|
| 232 |
</Text>
|
| 233 |
</div>
|
| 234 |
+
<Text size="sm" className="fpt-num fpt-result-facts" title={gaps > 0 ? `${gaps} part${gaps === 1 ? '' : 's'} of the process have no test yet` : undefined}>
|
| 235 |
+
{tested} tested · <span data-fail={failing > 0 || undefined}>{failing} failing</span> · {notRun} not run · {defects ? <Link to="/tickets">{defects} defect{defects === 1 ? '' : 's'}</Link> : '0 defects'}
|
| 236 |
+
</Text>
|
| 237 |
+
{rd.data?.signoff && <Text size="sm" c="dimmed">Signed off by {rd.data.signoff.by}.</Text>}
|
|
|
|
|
|
|
|
|
|
| 238 |
<Group gap="xs" wrap="wrap">
|
| 239 |
+
<Button variant="filled" component={Link} to={`/runs/${r.run_id}/report`} leftSection={<IconFileReport size={14} />}>{rd.data?.signoff ? 'Open the report' : 'Open the report and sign off'}</Button>
|
| 240 |
<ExcelButton id={r.run_id} label="Download the results (Excel)" />
|
| 241 |
{r.playwright_mode !== 'stub' && <Button component={Link} to={`/runs/${r.run_id}/proof`} variant="default">See the screens</Button>}
|
| 242 |
</Group>
|
| 243 |
<Text size="xs" c="dimmed">{fusion ? `Results come from the Oracle Fusion pod ${r.pod_name ?? ''}.` : 'Results come from the practice environment (the mock app), not Oracle Fusion.'}</Text>
|
| 244 |
+
{after}
|
| 245 |
</Stack>
|
| 246 |
);
|
| 247 |
}
|
|
|
|
| 250 |
const action = useRunAction();
|
| 251 |
return (
|
| 252 |
<Stack gap="sm">
|
| 253 |
+
<Text size="lg" fw={600}>{r.status === 'cancelled' ? 'This test run was cancelled' : r.status === 'killed' ? 'This test run was stopped by the emergency stop' : 'This test run stopped before it finished'}</Text>
|
| 254 |
{r.error && <Text size="sm">Reason: {r.error}</Text>}
|
| 255 |
<ErrorAlert error={action.error} />
|
| 256 |
<Can perm="run.control">
|
| 257 |
+
{['interrupted', 'failed'].includes(r.status) && <Button w="fit-content" variant="filled" onClick={() => action.mutate({ id: r.run_id, action: 'resume' })} loading={action.isPending}>Carry on from where it stopped</Button>}
|
| 258 |
</Can>
|
| 259 |
</Stack>
|
| 260 |
);
|
web/src/pages/RunPage.tsx
CHANGED
|
@@ -136,7 +136,7 @@ export function Activity({ id }: { id: string }) {
|
|
| 136 |
<aside className="fpt-side" aria-label="run side panel">
|
| 137 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 138 |
<Group justify="space-between" mb={6}>
|
| 139 |
-
<Text size="sm" fw={
|
| 140 |
<span className="fpt-pill" data-tone={mode === 'sse' ? 'green' : 'amber'} data-testid="stream-mode">{mode === 'sse' ? 'live (server-sent events)' : mode}</span>
|
| 141 |
</Group>
|
| 142 |
<GraphView states={st} compact />
|
|
@@ -144,12 +144,12 @@ export function Activity({ id }: { id: string }) {
|
|
| 144 |
</div>
|
| 145 |
{Object.keys(r.counts ?? {}).length > 0 && (
|
| 146 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 147 |
-
<Text size="sm" fw={
|
| 148 |
<Group gap={6}>{Object.entries(r.counts ?? {}).slice(0, 10).map(([k, v]) => <Pill key={k}>{k} <b>{String(v)}</b></Pill>)}</Group>
|
| 149 |
</div>
|
| 150 |
)}
|
| 151 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 152 |
-
<Text size="sm" fw={
|
| 153 |
<Stack gap={4}>
|
| 154 |
<Anchor component={Link} to={`/runs/${id}/report`} size="sm">Report & sign-off</Anchor>
|
| 155 |
{pdfs.map((m) => (
|
|
@@ -221,13 +221,13 @@ export function NextStep({ r, here, compact = false }: {
|
|
| 221 |
if (action && here && action.to.endsWith(`/${here}`)) action = null; // never a button to the page you are on
|
| 222 |
if (compact && !action) {
|
| 223 |
return (
|
| 224 |
-
<div className="fpt-
|
| 225 |
<Text fw={600} size="sm" truncate>{title}</Text>
|
| 226 |
</div>
|
| 227 |
);
|
| 228 |
}
|
| 229 |
return (
|
| 230 |
-
<div className="fpt-
|
| 231 |
<Group justify="space-between" wrap="wrap" gap="sm">
|
| 232 |
<div style={{ minWidth: 0, flex: '1 1 320px' }}>
|
| 233 |
<Text fw={600} size="sm">{title}</Text>
|
|
|
|
| 136 |
<aside className="fpt-side" aria-label="run side panel">
|
| 137 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 138 |
<Group justify="space-between" mb={6}>
|
| 139 |
+
<Text size="sm" fw={600}><IconRobot size={14} style={{ verticalAlign: -2 }} /> Agent team</Text>
|
| 140 |
<span className="fpt-pill" data-tone={mode === 'sse' ? 'green' : 'amber'} data-testid="stream-mode">{mode === 'sse' ? 'live (server-sent events)' : mode}</span>
|
| 141 |
</Group>
|
| 142 |
<GraphView states={st} compact />
|
|
|
|
| 144 |
</div>
|
| 145 |
{Object.keys(r.counts ?? {}).length > 0 && (
|
| 146 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 147 |
+
<Text size="sm" fw={600} mb={6}>Counts</Text>
|
| 148 |
<Group gap={6}>{Object.entries(r.counts ?? {}).slice(0, 10).map(([k, v]) => <Pill key={k}>{k} <b>{String(v)}</b></Pill>)}</Group>
|
| 149 |
</div>
|
| 150 |
)}
|
| 151 |
<div className="fpt-card" style={{ padding: 12 }}>
|
| 152 |
+
<Text size="sm" fw={600} mb={6}>Evidence & report</Text>
|
| 153 |
<Stack gap={4}>
|
| 154 |
<Anchor component={Link} to={`/runs/${id}/report`} size="sm">Report & sign-off</Anchor>
|
| 155 |
{pdfs.map((m) => (
|
|
|
|
| 221 |
if (action && here && action.to.endsWith(`/${here}`)) action = null; // never a button to the page you are on
|
| 222 |
if (compact && !action) {
|
| 223 |
return (
|
| 224 |
+
<div className="fpt-nextstep" data-testid="next-step" data-compact="true" data-tone={tone} title={body}>
|
| 225 |
<Text fw={600} size="sm" truncate>{title}</Text>
|
| 226 |
</div>
|
| 227 |
);
|
| 228 |
}
|
| 229 |
return (
|
| 230 |
+
<div className="fpt-nextstep" data-testid="next-step" data-tone={tone}>
|
| 231 |
<Group justify="space-between" wrap="wrap" gap="sm">
|
| 232 |
<div style={{ minWidth: 0, flex: '1 1 320px' }}>
|
| 233 |
<Text fw={600} size="sm">{title}</Text>
|
web/src/pages/RunStage.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import { Collapse,
|
| 2 |
import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconLoader2, IconUserCheck } from '@tabler/icons-react';
|
| 3 |
import { useState, type ReactNode } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
|
@@ -9,9 +9,10 @@ import { AgentSteps, STEP_WORDS } from './AssistantPage';
|
|
| 9 |
|
| 10 |
export type GuideStage = 'prepare' | 'approve' | 'testing' | 'judge' | 'result' | 'stopped';
|
| 11 |
|
| 12 |
-
const STAGE: Record<GuideStage, { n: number; word: string }> = {
|
| 13 |
-
prepare: { n: 1, word: 'Prepare' }, approve: { n: 2, word: 'Approve'
|
| 14 |
-
|
|
|
|
| 15 |
};
|
| 16 |
const SEGMENTS = ['Prepare', 'Approve', 'Testing', 'Result'];
|
| 17 |
|
|
@@ -21,7 +22,7 @@ export function StageProgress({ stage }: { stage: GuideStage }) {
|
|
| 21 |
return (
|
| 22 |
<div className="fpt-stage-progress" role="img" aria-label={`Progress of this test run: stage ${at} of 4, ${STAGE[stage].word}`}>
|
| 23 |
{SEGMENTS.map((s, i) => (
|
| 24 |
-
<span key={s} title={s} data-state={i + 1 < at || stage === 'result' ? 'done' : i + 1 === at ?
|
| 25 |
))}
|
| 26 |
</div>
|
| 27 |
);
|
|
@@ -33,7 +34,7 @@ export function StageCard({ stage, children }: { stage: GuideStage; children: Re
|
|
| 33 |
return (
|
| 34 |
<div className="fpt-stage" data-testid="run-guide" data-stage={stage}>
|
| 35 |
<div className="fpt-stage-head">
|
| 36 |
-
<span className="fpt-stage-kicker">{stage === 'stopped' ? '
|
| 37 |
{stage !== 'stopped' && <StageProgress stage={stage} />}
|
| 38 |
</div>
|
| 39 |
{children}
|
|
@@ -53,27 +54,20 @@ export function TeamStrip({ runId, finished, events }: { runId: string; finished
|
|
| 53 |
const waiting = by('waiting');
|
| 54 |
const failed = by('error');
|
| 55 |
const name = (n: string) => STEP_WORDS[n]?.[0] ?? agentName(n);
|
| 56 |
-
const chip = (n: string, kind: string, icon: ReactNode, text: string) => (
|
| 57 |
-
<span key={`${kind}${n}`} className="fpt-team-chip" data-kind={kind}>{icon}{text}</span>
|
| 58 |
-
);
|
| 59 |
return (
|
| 60 |
<div className="fpt-team" aria-label="The team working on this test run" role="group">
|
| 61 |
<div className="fpt-team-line">
|
| 62 |
-
<
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
: done.map((n) => chip(n, 'done', <IconCircleCheck size={14} aria-hidden />, name(n)))}
|
| 66 |
-
{running.map((n) => chip(n, 'running', <IconLoader2 size={14} className="fpt-spin" aria-hidden />, `${name(n)}: working`))}
|
| 67 |
-
{waiting.map((n) => chip(n, 'waiting', <IconUserCheck size={14} aria-hidden />, `${name(n)}: waiting for you`))}
|
| 68 |
-
{failed.map((n) => chip(n, 'error', <IconCircleX size={14} aria-hidden />, `${name(n)}: stopped`))}
|
| 69 |
-
{!done.length && !running.length && !waiting.length && !failed.length && <span className="fpt-team-chip" data-kind="idle">Starting the agents…</span>}
|
| 70 |
-
</div>
|
| 71 |
-
<Group justify="space-between" gap={8} wrap="wrap" mt={6}>
|
| 72 |
<span className="fpt-team-sum">
|
| 73 |
-
{done.length
|
|
|
|
|
|
|
|
|
|
| 74 |
</span>
|
| 75 |
<Link to={`/runs/${runId}/workflow`} className="fpt-team-link">Open the team board</Link>
|
| 76 |
-
</
|
| 77 |
<UnstyledButton className="fpt-team-more" onClick={() => setAll((v) => !v)} aria-expanded={all}>
|
| 78 |
{all ? <IconChevronDown size={13} /> : <IconChevronRight size={13} />} Show every step
|
| 79 |
</UnstyledButton>
|
|
|
|
| 1 |
+
import { Collapse, UnstyledButton } from '@mantine/core';
|
| 2 |
import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconLoader2, IconUserCheck } from '@tabler/icons-react';
|
| 3 |
import { useState, type ReactNode } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
|
|
|
| 9 |
|
| 10 |
export type GuideStage = 'prepare' | 'approve' | 'testing' | 'judge' | 'result' | 'stopped';
|
| 11 |
|
| 12 |
+
const STAGE: Record<GuideStage, { n: number; word: string; line: string }> = {
|
| 13 |
+
prepare: { n: 1, word: 'Prepare', line: 'prepare the test' }, approve: { n: 2, word: 'Approve', line: 'approve the scenarios' },
|
| 14 |
+
testing: { n: 3, word: 'Testing', line: 'testing' }, judge: { n: 3, word: 'Your decision', line: 'your decision' },
|
| 15 |
+
result: { n: 4, word: 'Result', line: 'result' }, stopped: { n: 0, word: 'Stopped', line: 'stopped' },
|
| 16 |
};
|
| 17 |
const SEGMENTS = ['Prepare', 'Approve', 'Testing', 'Result'];
|
| 18 |
|
|
|
|
| 22 |
return (
|
| 23 |
<div className="fpt-stage-progress" role="img" aria-label={`Progress of this test run: stage ${at} of 4, ${STAGE[stage].word}`}>
|
| 24 |
{SEGMENTS.map((s, i) => (
|
| 25 |
+
<span key={s} title={s} data-state={i + 1 < at || stage === 'result' ? 'done' : i + 1 === at ? 'now' : 'todo'} />
|
| 26 |
))}
|
| 27 |
</div>
|
| 28 |
);
|
|
|
|
| 34 |
return (
|
| 35 |
<div className="fpt-stage" data-testid="run-guide" data-stage={stage}>
|
| 36 |
<div className="fpt-stage-head">
|
| 37 |
+
<span className="fpt-stage-kicker">{stage === 'stopped' ? 'This test run stopped' : `Step ${s.n} of 4: ${s.line}`}</span>
|
| 38 |
{stage !== 'stopped' && <StageProgress stage={stage} />}
|
| 39 |
</div>
|
| 40 |
{children}
|
|
|
|
| 54 |
const waiting = by('waiting');
|
| 55 |
const failed = by('error');
|
| 56 |
const name = (n: string) => STEP_WORDS[n]?.[0] ?? agentName(n);
|
|
|
|
|
|
|
|
|
|
| 57 |
return (
|
| 58 |
<div className="fpt-team" aria-label="The team working on this test run" role="group">
|
| 59 |
<div className="fpt-team-line">
|
| 60 |
+
{waiting.length ? <IconUserCheck size={15} className="fpt-team-icon" data-kind="waiting" aria-hidden />
|
| 61 |
+
: failed.length ? <IconCircleX size={15} className="fpt-team-icon" data-kind="error" aria-hidden />
|
| 62 |
+
: running.length ? <IconLoader2 size={15} className="fpt-spin fpt-team-icon" aria-hidden /> : <IconCircleCheck size={15} className="fpt-team-icon" aria-hidden />}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 63 |
<span className="fpt-team-sum">
|
| 64 |
+
{!done.length && !running.length && !waiting.length && !failed.length ? 'Starting the agents…' : `${done.length} of ${nodes.length} steps done.`}
|
| 65 |
+
{waiting.map((n) => ` ${name(n)} is waiting for you.`).join('')}
|
| 66 |
+
{running.map((n) => ` ${name(n)} is working.`).join('')}
|
| 67 |
+
{failed.map((n) => ` ${name(n)} stopped.`).join('')}
|
| 68 |
</span>
|
| 69 |
<Link to={`/runs/${runId}/workflow`} className="fpt-team-link">Open the team board</Link>
|
| 70 |
+
</div>
|
| 71 |
<UnstyledButton className="fpt-team-more" onClick={() => setAll((v) => !v)} aria-expanded={all}>
|
| 72 |
{all ? <IconChevronDown size={13} /> : <IconChevronRight size={13} />} Show every step
|
| 73 |
</UnstyledButton>
|
web/src/pages/RunTriage.tsx
CHANGED
|
@@ -54,7 +54,7 @@ export function RunTriage({ id, waiting }: { id: string; waiting: boolean }) {
|
|
| 54 |
{g.items.map((it) => <ItemCard key={it.case_id} it={it} value={answers[it.case_id] ?? {}} onChange={(a) => setAnswers((s) => ({ ...s, [it.case_id]: a }))} />)}
|
| 55 |
<ErrorAlert error={submit.error} />
|
| 56 |
<Can perm="gate.human_review" fallback={<Alert color="gray">Only QA approvers (or admins) can confirm defects, waivers and flaky owners.</Alert>}>
|
| 57 |
-
<Group><Button onClick={send} loading={submit.isPending} disabled={submit.isSuccess}>Submit review</Button>
|
| 58 |
{submit.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; the run resumes.</Text>}</Group>
|
| 59 |
</Can>
|
| 60 |
</Stack>
|
|
|
|
| 54 |
{g.items.map((it) => <ItemCard key={it.case_id} it={it} value={answers[it.case_id] ?? {}} onChange={(a) => setAnswers((s) => ({ ...s, [it.case_id]: a }))} />)}
|
| 55 |
<ErrorAlert error={submit.error} />
|
| 56 |
<Can perm="gate.human_review" fallback={<Alert color="gray">Only QA approvers (or admins) can confirm defects, waivers and flaky owners.</Alert>}>
|
| 57 |
+
<Group><Button variant="filled" onClick={send} loading={submit.isPending} disabled={submit.isSuccess}>Submit review</Button>
|
| 58 |
{submit.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; the run resumes.</Text>}</Group>
|
| 59 |
</Can>
|
| 60 |
</Stack>
|
web/src/pages/RunWorkspace.tsx
CHANGED
|
@@ -1,12 +1,12 @@
|
|
| 1 |
import { ActionIcon, Alert, Button, CopyButton, Group, Menu, Modal, Skeleton, Tabs, Text, Tooltip } from '@mantine/core';
|
| 2 |
-
import { IconAlertTriangle, IconArrowLeft, IconChevronDown, IconDots, IconLayoutSidebarRight, IconLayoutSidebarRightCollapse, IconPlayerPlay
|
| 3 |
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
| 4 |
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
import { useEvidence, useGate, useLive, usePods, useRun, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks';
|
| 7 |
import type { ApproveGate } from '../api/types';
|
| 8 |
import { useAuth } from '../auth/AuthContext';
|
| 9 |
-
import { Can, DecisionBadge, ErrorAlert, GlossaryButton, GlossaryList
|
| 10 |
import { EmptyState } from '../components/shell/EmptyState';
|
| 11 |
import { EnvBadge, envKind, useChosenEnv } from '../components/shell/EnvSwitcher';
|
| 12 |
import { ExcelPanel, ReportSummary, ScenarioSteps } from '../components/shell/panelTabs';
|
|
@@ -62,7 +62,7 @@ function Workspace() {
|
|
| 62 |
const nav = useNavigate();
|
| 63 |
const { can } = useAuth();
|
| 64 |
const panel = useSidePanel();
|
| 65 |
-
const { size
|
| 66 |
const canWatch = useCanWatch();
|
| 67 |
const run = useRun(id ?? '', !!id);
|
| 68 |
const rd = useRunReadiness(id ?? '');
|
|
@@ -145,18 +145,16 @@ function Workspace() {
|
|
| 145 |
}, [panel]);
|
| 146 |
|
| 147 |
const shots = new Set((evidence.data ?? []).filter((e) => e.case_id && e.content_type.startsWith('image/')).map((e) => e.case_id)).size;
|
| 148 |
-
const decided = Object.values(r?.decisions ?? {});
|
| 149 |
const badges: Partial<Record<PanelTab, ReactNode>> = {
|
| 150 |
live: live.data?.active ? <span className="fpt-sdot fpt-panel-livedot" data-state="done" data-pulse="true" aria-hidden /> : undefined,
|
| 151 |
screens: browserRun && shots ? <span className="fpt-panel-count fpt-num">{shots}</span> : undefined,
|
| 152 |
-
|
| 153 |
-
steps: panel.scenario ? <span className="fpt-panel-count">{panel.scenario}</span> : undefined,
|
| 154 |
};
|
| 155 |
const none = () => <EmptyState title="Nothing here yet" body="Your test run's evidence appears here: the live browser, each scenario's screens, the report and the Excel files." />;
|
| 156 |
const render: Partial<Record<PanelTab, () => ReactNode>> = {
|
| 157 |
live: () => (r ? <LiveView id={r.run_id} status={r.status} gate={r.pending_gate} reasonQuick={!browserRun} compact /> : none()),
|
| 158 |
screens: () => (r ? <RunProof key={proofFilter} id={r.run_id} quick={!browserRun} oneColumn fusionPod={fusion ? r.pod_name ?? pod?.name ?? '' : null} filter={proofFilter} /> : none()),
|
| 159 |
-
report: () => (r ? <ReportSummary runId={r.run_id} /> : none()),
|
| 160 |
excel: () => (r ? <ExcelPanel runId={r.run_id} finished={r.status === 'completed'} /> : none()),
|
| 161 |
steps: () => (id ? <ScenarioSteps runId={r?.run_id} scenarioId={panel.scenario} /> : none()),
|
| 162 |
};
|
|
@@ -201,13 +199,14 @@ function Workspace() {
|
|
| 201 |
top = (
|
| 202 |
<TopBar title={runTitle(r)} titleTestId="run-title" honesty={false}
|
| 203 |
sub={<>
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
| 209 |
-
|
| 210 |
-
|
|
|
|
| 211 |
{refPill}
|
| 212 |
</>}
|
| 213 |
actions={<>
|
|
@@ -233,22 +232,22 @@ function Workspace() {
|
|
| 233 |
);
|
| 234 |
} else top = (
|
| 235 |
<TopBar
|
| 236 |
-
title={
|
|
|
|
| 237 |
sub={<>
|
| 238 |
<EnvBadge kind={fusion ? 'fusion' : 'mock'} name={r.pod_name ?? pod?.name} />
|
| 239 |
-
{!fusion && !sidebarExpanded && <span className="fpt-topbar-mock fpt-topbar-trunc">{MOCK_TEXT}</span>}
|
| 240 |
-
<span className="fpt-topbar-trunc">{browserRun ? 'Full browser run' : 'Quick simulation'}{r.modules.length > 1 ? ` · ${r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}` : ''}</span>
|
| 241 |
{refPill}
|
| 242 |
</>}
|
| 243 |
-
middle={
|
|
|
|
|
|
|
|
|
|
|
|
|
| 244 |
<span className="fpt-statechip" data-state={runState(r)} title={CHIP_WORDS(r)}>
|
| 245 |
<StatusDot state={runState(r)} label={CHIP_WORDS(r)} decorative />
|
| 246 |
<span className="fpt-chip-long">{CHIP_WORDS(r)}</span><span className="fpt-chip-short" aria-hidden>{CHIP_SHORT(r)}</span>
|
| 247 |
</span>
|
| 248 |
-
|
| 249 |
-
<Group key={m} gap={4} wrap="nowrap">{r.modules.length > 1 && <Text size="xs" fw={600}>{MODULE_NAMES[m] ?? m}</Text>}<DecisionBadge decision={d} size="sm" /></Group>
|
| 250 |
-
))}
|
| 251 |
-
</>}
|
| 252 |
actions={<>
|
| 253 |
{r.orchestrator === 'temporal' && <Can perm="admin"><TemporalLink id={r.run_id} /></Can>}
|
| 254 |
<GlossaryButton />
|
|
@@ -264,7 +263,7 @@ function Workspace() {
|
|
| 264 |
</Menu.Dropdown>
|
| 265 |
</Menu>
|
| 266 |
<Can perm="run.control">
|
| 267 |
-
{['interrupted', 'failed'].includes(r.status) && <Button onClick={() => action.mutate({ id: r.run_id, action: 'resume' })}
|
| 268 |
{!TERMINAL.includes(r.status) && <Button className="fpt-wide-only" color="red" variant="light" onClick={() => action.mutate({ id: r.run_id, action: 'cancel', reason: 'cancelled from the run page' })}>Cancel test run</Button>}
|
| 269 |
</Can>
|
| 270 |
{panelToggle}
|
|
@@ -294,7 +293,6 @@ type RunDetail = NonNullable<ReturnType<typeof useRun>['data']>;
|
|
| 294 |
/** A former tab of the run page, in the center with "← Conversation" and the view switcher. */
|
| 295 |
function DetailView({ id, tab, r, watching, browserRun, fusionPod }: { id: string; tab: string; r: RunDetail; watching: boolean; browserRun: boolean; fusionPod: string | null }) {
|
| 296 |
const nav = useNavigate();
|
| 297 |
-
const { size } = useShell();
|
| 298 |
const { can } = useAuth();
|
| 299 |
const MORE: Record<string, string> = { ...MORE_ALL, ...MORE_ADMIN };
|
| 300 |
const your = (v: string) => (v === 'scenarios' && r.pending_gate === 'approve_cases') || (v === 'failures' && r.pending_gate === 'human_review') ? ' • your review' : '';
|
|
@@ -344,7 +342,7 @@ function DetailView({ id, tab, r, watching, browserRun, fusionPod }: { id: strin
|
|
| 344 |
</Tabs>
|
| 345 |
</div>
|
| 346 |
<div className="fpt-ws-detail">
|
| 347 |
-
{tab !== 'workflow' && <NextStep r={r} here={tab} compact={
|
| 348 |
<NowTesting id={id} enabled={watching} />
|
| 349 |
{body[tab]?.()}
|
| 350 |
</div>
|
|
|
|
| 1 |
import { ActionIcon, Alert, Button, CopyButton, Group, Menu, Modal, Skeleton, Tabs, Text, Tooltip } from '@mantine/core';
|
| 2 |
+
import { IconAlertTriangle, IconArrowLeft, IconChevronDown, IconDots, IconLayoutSidebarRight, IconLayoutSidebarRightCollapse, IconPlayerPlay } from '@tabler/icons-react';
|
| 3 |
import { useEffect, useRef, useState, type ReactNode } from 'react';
|
| 4 |
import { Link, useNavigate, useParams, useSearchParams } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
import { useEvidence, useGate, useLive, usePods, useRun, useRunAction, useRunFailures, useRunReadiness } from '../api/hooks';
|
| 7 |
import type { ApproveGate } from '../api/types';
|
| 8 |
import { useAuth } from '../auth/AuthContext';
|
| 9 |
+
import { Can, DecisionBadge, ErrorAlert, GlossaryButton, GlossaryList } from '../components/common';
|
| 10 |
import { EmptyState } from '../components/shell/EmptyState';
|
| 11 |
import { EnvBadge, envKind, useChosenEnv } from '../components/shell/EnvSwitcher';
|
| 12 |
import { ExcelPanel, ReportSummary, ScenarioSteps } from '../components/shell/panelTabs';
|
|
|
|
| 62 |
const nav = useNavigate();
|
| 63 |
const { can } = useAuth();
|
| 64 |
const panel = useSidePanel();
|
| 65 |
+
const { size } = useShell();
|
| 66 |
const canWatch = useCanWatch();
|
| 67 |
const run = useRun(id ?? '', !!id);
|
| 68 |
const rd = useRunReadiness(id ?? '');
|
|
|
|
| 145 |
}, [panel]);
|
| 146 |
|
| 147 |
const shots = new Set((evidence.data ?? []).filter((e) => e.case_id && e.content_type.startsWith('image/')).map((e) => e.case_id)).size;
|
|
|
|
| 148 |
const badges: Partial<Record<PanelTab, ReactNode>> = {
|
| 149 |
live: live.data?.active ? <span className="fpt-sdot fpt-panel-livedot" data-state="done" data-pulse="true" aria-hidden /> : undefined,
|
| 150 |
screens: browserRun && shots ? <span className="fpt-panel-count fpt-num">{shots}</span> : undefined,
|
| 151 |
+
|
|
|
|
| 152 |
};
|
| 153 |
const none = () => <EmptyState title="Nothing here yet" body="Your test run's evidence appears here: the live browser, each scenario's screens, the report and the Excel files." />;
|
| 154 |
const render: Partial<Record<PanelTab, () => ReactNode>> = {
|
| 155 |
live: () => (r ? <LiveView id={r.run_id} status={r.status} gate={r.pending_gate} reasonQuick={!browserRun} compact /> : none()),
|
| 156 |
screens: () => (r ? <RunProof key={proofFilter} id={r.run_id} quick={!browserRun} oneColumn fusionPod={fusion ? r.pod_name ?? pod?.name ?? '' : null} filter={proofFilter} /> : none()),
|
| 157 |
+
report: () => (r ? <ReportSummary runId={r.run_id} hideVerdict={tab === 'report'} /> : none()),
|
| 158 |
excel: () => (r ? <ExcelPanel runId={r.run_id} finished={r.status === 'completed'} /> : none()),
|
| 159 |
steps: () => (id ? <ScenarioSteps runId={r?.run_id} scenarioId={panel.scenario} /> : none()),
|
| 160 |
};
|
|
|
|
| 199 |
top = (
|
| 200 |
<TopBar title={runTitle(r)} titleTestId="run-title" honesty={false}
|
| 201 |
sub={<>
|
| 202 |
+
{Object.keys(r.decisions ?? {}).length
|
| 203 |
+
? Object.values(r.decisions ?? {}).map((d, i) => <DecisionBadge key={i} decision={d} size="sm" />)
|
| 204 |
+
: (
|
| 205 |
+
<span className="fpt-statechip" data-state={runState(r)} title={CHIP_WORDS(r)}>
|
| 206 |
+
<StatusDot state={runState(r)} label={CHIP_WORDS(r)} decorative /><span aria-hidden>{CHIP_SHORT(r)}</span><span className="fpt-sr-only">{CHIP_WORDS(r)}</span>
|
| 207 |
+
</span>
|
| 208 |
+
)}
|
| 209 |
+
<EnvBadge kind={fusion ? 'fusion' : 'mock'} name={r.pod_name ?? pod?.name} />
|
| 210 |
{refPill}
|
| 211 |
</>}
|
| 212 |
actions={<>
|
|
|
|
| 232 |
);
|
| 233 |
} else top = (
|
| 234 |
<TopBar
|
| 235 |
+
title={<span title={`${browserRun ? 'Full browser run' : 'Quick simulation (no browser)'}${r.modules.length > 1 ? `: ${r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}` : ''}`}>{runTitle(r)}</span>}
|
| 236 |
+
titleTestId="run-title" honesty={false}
|
| 237 |
sub={<>
|
| 238 |
<EnvBadge kind={fusion ? 'fusion' : 'mock'} name={r.pod_name ?? pod?.name} />
|
|
|
|
|
|
|
| 239 |
{refPill}
|
| 240 |
</>}
|
| 241 |
+
middle={Object.keys(r.decisions ?? {}).length ? (
|
| 242 |
+
<>{Object.entries(r.decisions ?? {}).map(([m, d]) => (
|
| 243 |
+
<Group key={m} gap={4} wrap="nowrap">{r.modules.length > 1 && <Text size="xs" fw={600}>{MODULE_NAMES[m] ?? m}</Text>}<DecisionBadge decision={d} size="sm" /></Group>
|
| 244 |
+
))}</>
|
| 245 |
+
) : (
|
| 246 |
<span className="fpt-statechip" data-state={runState(r)} title={CHIP_WORDS(r)}>
|
| 247 |
<StatusDot state={runState(r)} label={CHIP_WORDS(r)} decorative />
|
| 248 |
<span className="fpt-chip-long">{CHIP_WORDS(r)}</span><span className="fpt-chip-short" aria-hidden>{CHIP_SHORT(r)}</span>
|
| 249 |
</span>
|
| 250 |
+
)}
|
|
|
|
|
|
|
|
|
|
| 251 |
actions={<>
|
| 252 |
{r.orchestrator === 'temporal' && <Can perm="admin"><TemporalLink id={r.run_id} /></Can>}
|
| 253 |
<GlossaryButton />
|
|
|
|
| 263 |
</Menu.Dropdown>
|
| 264 |
</Menu>
|
| 265 |
<Can perm="run.control">
|
| 266 |
+
{['interrupted', 'failed'].includes(r.status) && <Button variant="filled" onClick={() => action.mutate({ id: r.run_id, action: 'resume' })} leftSection={<IconPlayerPlay size={12} />}>Resume</Button>}
|
| 267 |
{!TERMINAL.includes(r.status) && <Button className="fpt-wide-only" color="red" variant="light" onClick={() => action.mutate({ id: r.run_id, action: 'cancel', reason: 'cancelled from the run page' })}>Cancel test run</Button>}
|
| 268 |
</Can>
|
| 269 |
{panelToggle}
|
|
|
|
| 293 |
/** A former tab of the run page, in the center with "← Conversation" and the view switcher. */
|
| 294 |
function DetailView({ id, tab, r, watching, browserRun, fusionPod }: { id: string; tab: string; r: RunDetail; watching: boolean; browserRun: boolean; fusionPod: string | null }) {
|
| 295 |
const nav = useNavigate();
|
|
|
|
| 296 |
const { can } = useAuth();
|
| 297 |
const MORE: Record<string, string> = { ...MORE_ALL, ...MORE_ADMIN };
|
| 298 |
const your = (v: string) => (v === 'scenarios' && r.pending_gate === 'approve_cases') || (v === 'failures' && r.pending_gate === 'human_review') ? ' • your review' : '';
|
|
|
|
| 342 |
</Tabs>
|
| 343 |
</div>
|
| 344 |
<div className="fpt-ws-detail">
|
| 345 |
+
{tab !== 'workflow' && tab !== 'report' && <NextStep r={r} here={tab} compact={tab === 'scenarios' || tab === 'failures'} />} {/* on the Team view the Coordinator card is the action (R2-S3) */}
|
| 346 |
<NowTesting id={id} enabled={watching} />
|
| 347 |
{body[tab]?.()}
|
| 348 |
</div>
|
web/src/pages/RunsPage.tsx
CHANGED
|
@@ -1,16 +1,29 @@
|
|
| 1 |
import { ActionIcon, Button, Group, Menu, Modal, Select, Stack, Text } from '@mantine/core';
|
| 2 |
-
import {
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 5 |
-
import {
|
| 6 |
import { RUN_STATUS_WORDS } from '../glossary';
|
| 7 |
import { usePodProfile, usePods, useRunAction, useRuns } from '../api/hooks';
|
| 8 |
import { StartRunForm } from './StartRunWizard';
|
| 9 |
-
import { Can,
|
| 10 |
-
import {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
-
const MODULES = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP', 'CX'];
|
| 13 |
const TERMINAL = ['completed', 'failed', 'killed', 'cancelled'];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
|
| 15 |
function GettingStarted({ hasRuns, podChecked, hasCompleted, onStart }: { hasRuns: boolean; podChecked: boolean; hasCompleted: boolean; onStart: () => void }) {
|
| 16 |
const steps = [
|
|
@@ -22,17 +35,17 @@ function GettingStarted({ hasRuns, podChecked, hasCompleted, onStart }: { hasRun
|
|
| 22 |
if (steps.every((x) => x.done)) return null;
|
| 23 |
return (
|
| 24 |
<section className="fpt-card" style={{ padding: 16 }} aria-label="Getting started">
|
| 25 |
-
<Text fw={
|
| 26 |
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(210px, 1fr))', gap: 10 }}>
|
| 27 |
{steps.map((x, i) => (
|
| 28 |
-
<div key={i} className="fpt-card" style={{ padding: 12
|
| 29 |
<Group gap={6} wrap="nowrap">
|
| 30 |
-
{x.done ? <IconCircleCheck size={16} color="var(--
|
| 31 |
-
<Text size="sm" fw={
|
| 32 |
</Group>
|
| 33 |
<Text size="xs" c="dimmed" mt={4}>{x.body}</Text>
|
| 34 |
-
{!x.done && x.to && <Button size="compact-xs"
|
| 35 |
-
{!x.done && x.action && <Button size="compact-xs"
|
| 36 |
</div>
|
| 37 |
))}
|
| 38 |
</div>
|
|
@@ -55,52 +68,70 @@ export function RunsPage() {
|
|
| 55 |
const newOpen = params.get('new') === '1';
|
| 56 |
const setNew = (open: boolean) => { const p = new URLSearchParams(params); if (open) p.set('new', '1'); else p.delete('new'); setParams(p); };
|
| 57 |
const release = pod.data?.about?.release;
|
| 58 |
-
const
|
| 59 |
-
const
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
return (
|
| 62 |
<Stack gap="md">
|
| 63 |
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Test runs' }]}
|
| 64 |
-
title={<>Test runs{module ? `
|
| 65 |
-
extra={defaultPod &&
|
| 66 |
-
<Link to="/pods"
|
| 67 |
-
|
| 68 |
-
</Link>
|
| 69 |
-
{release && <Pill>pod release {release}</Pill>}
|
| 70 |
-
</>}>
|
| 71 |
<GlossaryButton />
|
| 72 |
-
<Can perm="run.start"><Button onClick={() => setNew(true)}
|
| 73 |
</PageHeader>
|
| 74 |
|
| 75 |
<GettingStarted hasRuns={(runs.data?.total ?? 0) > 0} podChecked={!!defaultPod?.last_check_ok}
|
| 76 |
hasCompleted={(runs.data?.items ?? []).some((r) => r.status === 'completed')} onStart={() => setNew(true)} />
|
| 77 |
|
| 78 |
<div>
|
| 79 |
-
<Group justify="space-between" mb={
|
| 80 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
<Group gap="xs">
|
| 82 |
{(module || waitingOnly) && <Button variant="subtle" size="compact-xs" component={Link} to="/runs">Clear filter</Button>}
|
|
|
|
|
|
|
| 83 |
<Select aria-label="Filter by status" placeholder="all statuses" clearable value={status} onChange={(v) => { setStatus(v); setOffset(0); }} w={230}
|
| 84 |
data={Object.entries(RUN_STATUS_WORDS).map(([value, label]) => ({ value, label }))} />
|
| 85 |
</Group>
|
| 86 |
</Group>
|
| 87 |
<ErrorAlert error={runs.error || action.error} />
|
| 88 |
<div className="fpt-card" role="list" aria-label="runs" style={{ overflow: 'hidden' }}>
|
| 89 |
-
{items.length === 0 && <Text size="sm" c="dimmed" p="md">{runs.isLoading ? 'Loading
|
| 90 |
-
{items.map((r, i) =>
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 96 |
</div>
|
| 97 |
-
<
|
| 98 |
-
<Pill icon={<IconCalendar size={11} />}>{new Date(r.created_at).toLocaleDateString()}</Pill>
|
| 99 |
-
<Pill tone="lav">{r.playwright_mode === 'stub' ? 'quick simulation' : 'browser test run'}</Pill>
|
| 100 |
-
<StatusBadge status={r.status} />
|
| 101 |
-
{r.pending_gate && <Link to={`/runs/${r.run_id}/${r.pending_gate === 'approve_cases' ? 'scenarios' : 'failures'}`} className="fpt-pill" data-tone="amber">your review</Link>}
|
| 102 |
-
{Object.entries(r.decisions ?? {}).map(([m, d]) => <Group key={m} gap={3}><Text size="xs">{m}</Text><DecisionBadge decision={d} size="sm" /></Group>)}
|
| 103 |
-
</Group>
|
| 104 |
<Menu position="bottom-end" withinPortal>
|
| 105 |
<Menu.Target><ActionIcon variant="subtle" color="gray" aria-label={`actions for ${r.run_id}`}><IconDots size={15} /></ActionIcon></Menu.Target>
|
| 106 |
<Menu.Dropdown>
|
|
@@ -113,7 +144,8 @@ export function RunsPage() {
|
|
| 113 |
</Menu.Dropdown>
|
| 114 |
</Menu>
|
| 115 |
</div>
|
| 116 |
-
|
|
|
|
| 117 |
</div>
|
| 118 |
{runs.data && <Pager total={runs.data.total} limit={limit} offset={offset} onChange={setOffset} />}
|
| 119 |
</div>
|
|
|
|
| 1 |
import { ActionIcon, Button, Group, Menu, Modal, Select, Stack, Text } from '@mantine/core';
|
| 2 |
+
import { IconCircleCheck, IconCircleDashed, IconDots, IconPlus } from '@tabler/icons-react';
|
| 3 |
import { useState } from 'react';
|
| 4 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 5 |
+
import { MODULE_NAMES } from '../agents';
|
| 6 |
import { RUN_STATUS_WORDS } from '../glossary';
|
| 7 |
import { usePodProfile, usePods, useRunAction, useRuns } from '../api/hooks';
|
| 8 |
import { StartRunForm } from './StartRunWizard';
|
| 9 |
+
import { Can, ErrorAlert, GlossaryButton, PageHeader, Pager } from '../components/common';
|
| 10 |
+
import { envKind } from '../components/shell/EnvSwitcher';
|
| 11 |
+
import { FilterChips } from '../components/shell/FilterChips';
|
| 12 |
+
import { rowWords, runStatusWords } from '../components/shell/RunListItem';
|
| 13 |
+
import { runState, StatusDot } from '../components/shell/StatusDot';
|
| 14 |
+
import { runTitle, shortWhen } from '../runName';
|
| 15 |
|
|
|
|
| 16 |
const TERMINAL = ['completed', 'failed', 'killed', 'cancelled'];
|
| 17 |
+
type Quick = 'all' | 'needs' | 'running' | 'finished' | 'stopped';
|
| 18 |
+
type Row = { status: string; pending_gate?: string | null };
|
| 19 |
+
/** Quick filters over the current page (client side); "Needs you" is the ?waiting=1 link the sidebar uses. */
|
| 20 |
+
const QUICK: Record<Quick, (r: Row) => boolean> = {
|
| 21 |
+
all: () => true,
|
| 22 |
+
needs: (r) => !!r.pending_gate,
|
| 23 |
+
running: (r) => !r.pending_gate && ['queued', 'running'].includes(r.status),
|
| 24 |
+
finished: (r) => r.status === 'completed',
|
| 25 |
+
stopped: (r) => ['failed', 'killed', 'cancelled', 'interrupted'].includes(r.status),
|
| 26 |
+
};
|
| 27 |
|
| 28 |
function GettingStarted({ hasRuns, podChecked, hasCompleted, onStart }: { hasRuns: boolean; podChecked: boolean; hasCompleted: boolean; onStart: () => void }) {
|
| 29 |
const steps = [
|
|
|
|
| 35 |
if (steps.every((x) => x.done)) return null;
|
| 36 |
return (
|
| 37 |
<section className="fpt-card" style={{ padding: 16 }} aria-label="Getting started">
|
| 38 |
+
<Text fw={600} mb={8}>Getting started</Text>
|
| 39 |
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fit, minmax(210px, 1fr))', gap: 10 }}>
|
| 40 |
{steps.map((x, i) => (
|
| 41 |
+
<div key={i} className="fpt-card" style={{ padding: 12 }} data-done={x.done || undefined}>
|
| 42 |
<Group gap={6} wrap="nowrap">
|
| 43 |
+
{x.done ? <IconCircleCheck size={16} color="var(--fpt-dim)" aria-label="done" /> : <IconCircleDashed size={16} color="var(--fpt-dim)" aria-hidden />}
|
| 44 |
+
<Text size="sm" fw={600}>{i + 1}. {x.title}</Text>
|
| 45 |
</Group>
|
| 46 |
<Text size="xs" c="dimmed" mt={4}>{x.body}</Text>
|
| 47 |
+
{!x.done && x.to && <Button size="compact-xs" mt={6} component={Link} to={x.to}>Open</Button>}
|
| 48 |
+
{!x.done && x.action && <Button size="compact-xs" mt={6} onClick={x.action}>Start now</Button>}
|
| 49 |
</div>
|
| 50 |
))}
|
| 51 |
</div>
|
|
|
|
| 68 |
const newOpen = params.get('new') === '1';
|
| 69 |
const setNew = (open: boolean) => { const p = new URLSearchParams(params); if (open) p.set('new', '1'); else p.delete('new'); setParams(p); };
|
| 70 |
const release = pod.data?.about?.release;
|
| 71 |
+
const [quick, setQuick] = useState<Quick>('all');
|
| 72 |
+
const q: Quick = waitingOnly ? 'needs' : quick;
|
| 73 |
+
const page = (runs.data?.items ?? []).filter((r) => !module || (module === 'ALL' ? !r.modules.length : r.modules.includes(module)));
|
| 74 |
+
const items = page.filter(QUICK[q]);
|
| 75 |
+
const count = (k: Quick) => page.filter(QUICK[k]).length;
|
| 76 |
+
const kindOf = (id?: number | null) => envKind((pods.data ?? []).find((p) => p.id === id)?.kind);
|
| 77 |
+
const setWaiting = (on: boolean) => { const p = new URLSearchParams(params); if (on) p.set('waiting', '1'); else p.delete('waiting'); setParams(p); };
|
| 78 |
+
const pick = (k: Quick) => { setWaiting(k === 'needs'); setQuick(k === 'needs' ? 'all' : k); };
|
| 79 |
+
const setArea = (m: string | null) => { const p = new URLSearchParams(params); if (m) p.set('module', m); else p.delete('module'); setParams(p); setOffset(0); };
|
| 80 |
|
| 81 |
return (
|
| 82 |
<Stack gap="md">
|
| 83 |
<PageHeader crumbs={[{ label: 'Patch readiness', to: '/' }, { label: 'Test runs' }]}
|
| 84 |
+
title={<>Test runs{module ? `: ${MODULE_NAMES[module] ?? module}` : ''}</>}
|
| 85 |
+
extra={defaultPod && (
|
| 86 |
+
<span className="fpt-pagedesc">Default test environment: <Link to="/pods">{defaultPod.name}</Link>{release ? `, release ${release}` : ''}.{defaultPod.last_check_ok === false ? ' Its last connection check failed.' : ''}</span>
|
| 87 |
+
)}>
|
|
|
|
|
|
|
|
|
|
| 88 |
<GlossaryButton />
|
| 89 |
+
<Can perm="run.start"><Button variant="filled" onClick={() => setNew(true)} leftSection={<IconPlus size={13} />}>New test run</Button></Can>
|
| 90 |
</PageHeader>
|
| 91 |
|
| 92 |
<GettingStarted hasRuns={(runs.data?.total ?? 0) > 0} podChecked={!!defaultPod?.last_check_ok}
|
| 93 |
hasCompleted={(runs.data?.items ?? []).some((r) => r.status === 'completed')} onStart={() => setNew(true)} />
|
| 94 |
|
| 95 |
<div>
|
| 96 |
+
<Group justify="space-between" mb={8} wrap="wrap">
|
| 97 |
+
<FilterChips label="Show test runs" value={q} onChange={pick} options={[
|
| 98 |
+
{ value: 'all', label: 'All', count: count('all') }, { value: 'needs', label: 'Needs you', count: count('needs') },
|
| 99 |
+
{ value: 'running', label: 'Running', count: count('running') }, { value: 'finished', label: 'Finished', count: count('finished') },
|
| 100 |
+
{ value: 'stopped', label: 'Stopped', count: count('stopped') },
|
| 101 |
+
]} />
|
| 102 |
<Group gap="xs">
|
| 103 |
{(module || waitingOnly) && <Button variant="subtle" size="compact-xs" component={Link} to="/runs">Clear filter</Button>}
|
| 104 |
+
<Select aria-label="Business area" placeholder="all areas" clearable value={module} onChange={setArea} w={170}
|
| 105 |
+
data={Object.entries(MODULE_NAMES).map(([value, label]) => ({ value, label }))} />
|
| 106 |
<Select aria-label="Filter by status" placeholder="all statuses" clearable value={status} onChange={(v) => { setStatus(v); setOffset(0); }} w={230}
|
| 107 |
data={Object.entries(RUN_STATUS_WORDS).map(([value, label]) => ({ value, label }))} />
|
| 108 |
</Group>
|
| 109 |
</Group>
|
| 110 |
<ErrorAlert error={runs.error || action.error} />
|
| 111 |
<div className="fpt-card" role="list" aria-label="runs" style={{ overflow: 'hidden' }}>
|
| 112 |
+
{items.length === 0 && <Text size="sm" c="dimmed" p="md">{runs.isLoading ? 'Loading the test runs.' : page.length ? 'No test runs match this filter.' : 'No test runs yet. Start one to test the patch.'}</Text>}
|
| 113 |
+
{items.map((r, i) => {
|
| 114 |
+
const st = runState(r);
|
| 115 |
+
const d = r.decision ?? Object.values(r.decisions ?? {})[0] ?? null;
|
| 116 |
+
const kind = kindOf(r.pod_id);
|
| 117 |
+
const env = kind === 'fusion' ? `Oracle Fusion pod: ${r.pod_name ?? 'unnamed'}` : 'Practice environment';
|
| 118 |
+
const gateTo = r.pending_gate ? `/runs/${r.run_id}/${r.pending_gate === 'approve_cases' ? 'scenarios' : 'failures'}` : null;
|
| 119 |
+
const areas = Object.keys(r.decisions ?? {});
|
| 120 |
+
return (
|
| 121 |
+
<div key={r.run_id} role="listitem" data-testid={`run-row-${r.run_id}`} className="fpt-row fpt-runrow" style={{ borderTop: i ? '1px solid var(--fpt-border)' : 0 }}>
|
| 122 |
+
<div style={{ flex: '1 1 260px', minWidth: 0 }}>
|
| 123 |
+
<div className="fpt-runrow-top">
|
| 124 |
+
<Link to={`/runs/${r.run_id}`} className="fpt-runrow-title">{runTitle(r)}</Link>
|
| 125 |
+
<span className="fpt-runitem-state" data-state={st} title={runStatusWords(r)}>
|
| 126 |
+
<StatusDot state={st} label={runStatusWords(r)} decorative size={8} />
|
| 127 |
+
{areas.length > 1 ? areas.map((m) => `${m} ${rowWords(r, r.decisions?.[m])}`).join(', ') : rowWords(r, d)}
|
| 128 |
+
</span>
|
| 129 |
+
</div>
|
| 130 |
+
<Text size="xs" c="dimmed" className="fpt-runrow-sub" data-env={kind}>
|
| 131 |
+
<span className="fpt-runrow-env">{env}</span>. {r.playwright_mode === 'stub' ? 'Quick simulation' : 'Browser test run'}. Started by {r.created_by ?? r.trigger}, {shortWhen(r.created_at)}.{r.modules.length > 1 ? ` Areas: ${r.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}.` : ''} <span className="fpt-idpill">{r.run_id}</span>
|
| 132 |
+
</Text>
|
| 133 |
</div>
|
| 134 |
+
{gateTo && <Button size="xs" component={Link} to={gateTo}>Open your review</Button>}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 135 |
<Menu position="bottom-end" withinPortal>
|
| 136 |
<Menu.Target><ActionIcon variant="subtle" color="gray" aria-label={`actions for ${r.run_id}`}><IconDots size={15} /></ActionIcon></Menu.Target>
|
| 137 |
<Menu.Dropdown>
|
|
|
|
| 144 |
</Menu.Dropdown>
|
| 145 |
</Menu>
|
| 146 |
</div>
|
| 147 |
+
);
|
| 148 |
+
})}
|
| 149 |
</div>
|
| 150 |
{runs.data && <Pager total={runs.data.total} limit={limit} offset={offset} onChange={setOffset} />}
|
| 151 |
</div>
|
web/src/pages/ScenarioReview.tsx
CHANGED
|
@@ -3,7 +3,7 @@ import { IconChevronDown, IconChevronRight, IconCircleCheck, IconCircleX, IconCo
|
|
| 3 |
import { useId, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react';
|
| 4 |
import { useApproveCases, useCaseYaml, useGate, useRunScenarios } from '../api/hooks';
|
| 5 |
import type { AiDraft, ApproveGate, DryRun, PendingCase, Scenario } from '../api/types';
|
| 6 |
-
import { Can, Diff, ErrorAlert, Pill, Pre, Term } from '../components/common';
|
| 7 |
import { FilterChips } from '../components/shell/FilterChips';
|
| 8 |
import { useSidePanelOptional } from '../components/shell/SidePanel';
|
| 9 |
import { PRIORITY_WORDS } from '../glossary';
|
|
@@ -57,14 +57,14 @@ function NotRunnable({ list }: { list: AiDraft[] }) {
|
|
| 57 |
<div data-testid="ai-not-runnable" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
| 58 |
<UnstyledButton onClick={() => setOpen((o) => !o)} aria-expanded={open} className="fpt-notoffered">
|
| 59 |
{open ? <IconChevronDown size={14} /> : <IconChevronRight size={14} />}
|
| 60 |
-
<Text size="sm" fw={600} span>Written by the AI model, not offered</Text> <
|
| 61 |
</UnstyledButton>
|
| 62 |
<Collapse in={open}>
|
| 63 |
<Stack gap={8}>
|
| 64 |
<Text size="xs" c="dimmed">These new scenarios failed their dry run, so they are not part of this test run. They stay in staging.</Text>
|
| 65 |
{list.map((d, i) => (
|
| 66 |
<div key={d.id ?? `x${i}`} className="fpt-srow" data-testid={`ai-failed-${d.id ?? i}`}>
|
| 67 |
-
<Group gap={6} wrap="wrap"><Text size="sm">{d.title}</Text><
|
| 68 |
<DryRunLine d={d.dry_run} />
|
| 69 |
{d.problems.length > 0 && <Text size="xs" c="dimmed">{d.problems.slice(0, 3).join(' · ')}</Text>}
|
| 70 |
{d.steps.length > 0 && (
|
|
@@ -81,7 +81,7 @@ function NotRunnable({ list }: { list: AiDraft[] }) {
|
|
| 81 |
/** The dry-run result of an AI-written scenario as one line with an icon (passed / failed / simulated). */
|
| 82 |
function DryRunBadge({ d }: { d: DryRun | null | undefined }) {
|
| 83 |
if (!d) return <Text size="sm" c="dimmed">Not dry-run</Text>;
|
| 84 |
-
const when = d.at ? `
|
| 85 |
const tip = d.at ? utcTitle(d.at) : undefined;
|
| 86 |
if (d.simulated) return <Group gap={6} wrap="nowrap" className="fpt-dry" data-result="simulated" title={tip}><IconWorldOff size={15} aria-hidden /><Text size="sm">Dry run simulated: no browser, not on a pod{when}</Text></Group>;
|
| 87 |
if (d.status === 'passed') return <Group gap={6} wrap="nowrap" className="fpt-dry" data-result="passed" title={tip}><IconCircleCheck size={15} aria-hidden /><Text size="sm">Dry run passed on {d.pod ?? 'the pod'}{when}</Text></Group>;
|
|
@@ -95,14 +95,14 @@ export function ApprovalCard({ s, p, decision, onDecision, onShowSteps, editable
|
|
| 95 |
const steps = p?.ai?.steps.length ?? s.steps.length;
|
| 96 |
return (
|
| 97 |
<div className="fpt-card fpt-approval" data-testid={`approval-card-${s.id}`} data-decision={decision ?? 'undecided'}>
|
| 98 |
-
<Group gap={
|
| 99 |
-
<
|
| 100 |
-
<
|
| 101 |
</Group>
|
| 102 |
<Text fw={600} size="sm" mt={8}>{s.title}</Text>
|
| 103 |
<div style={{ marginTop: 6 }}><DryRunBadge d={p?.ai?.dry_run ?? s.dry_run} /></div>
|
| 104 |
<Text size="xs" c="dimmed" mt={6}>
|
| 105 |
-
{steps} step{steps === 1 ? '' : 's'}
|
| 106 |
</Text>
|
| 107 |
<Group justify="space-between" mt="sm" gap={8} wrap="wrap">
|
| 108 |
{onShowSteps ? <Button size="compact-xs" variant="subtle" leftSection={<IconListNumbers size={13} />} onClick={onShowSteps}>Show steps</Button> : <span />}
|
|
@@ -129,7 +129,7 @@ export function ScenarioBody({ s, p, children }: { s: Scenario; p?: PendingCase;
|
|
| 129 |
{s.preconditions.length > 0 && <Text size="sm"><b>Setup needed:</b> {s.preconditions.join(' ')}</Text>}
|
| 130 |
{s.steps.length > 0 && (
|
| 131 |
<div>
|
| 132 |
-
<Text size="sm" fw={
|
| 133 |
<ol style={{ margin: '4px 0 0', paddingLeft: 20, fontSize: 13 }}>
|
| 134 |
{s.steps.map((st) => <li key={st.n}>{st.text}{st.expected ? <Text span size="xs" c="dimmed"> → {st.expected}</Text> : null}</li>)}
|
| 135 |
</ol>
|
|
@@ -137,7 +137,7 @@ export function ScenarioBody({ s, p, children }: { s: Scenario; p?: PendingCase;
|
|
| 137 |
)}
|
| 138 |
{s.test_data.length > 0 && (
|
| 139 |
<div>
|
| 140 |
-
<Text size="sm" fw={
|
| 141 |
{s.test_data.map((d) => (
|
| 142 |
<div key={d.id} style={{ marginTop: 4 }}>
|
| 143 |
<Text size="xs"><b>{d.title}</b>{d.purpose ? `: ${d.purpose}` : ''}</Text>
|
|
@@ -192,10 +192,10 @@ export function ScenarioCard({ s, p, decision, onDecision, note, onNote, editabl
|
|
| 192 |
<Group gap={6} wrap="nowrap">
|
| 193 |
{open ? <IconChevronDown size={14} style={{ flex: '0 0 14px' }} /> : <IconChevronRight size={14} style={{ flex: '0 0 14px' }} />}
|
| 194 |
<Text size="sm" truncate={open ? undefined : 'end'} style={{ minWidth: 0 }}>{s.title}</Text>
|
| 195 |
-
<
|
| 196 |
-
{s.origin === 'generated' && <
|
| 197 |
-
{(s.origin === 'ai' || p?.origin === 'ai') && <
|
| 198 |
-
{p?.ai?.dry_run?.status === 'passed' && <
|
| 199 |
{out && <Pill tone={out.tone}>{out.label}</Pill>}
|
| 200 |
</Group>
|
| 201 |
</UnstyledButton>
|
|
@@ -227,7 +227,7 @@ export function ScenarioCard({ s, p, decision, onDecision, note, onNote, editabl
|
|
| 227 |
|
| 228 |
const byStep = (list: Scenario[]) => {
|
| 229 |
const m = new Map<string, Scenario[]>();
|
| 230 |
-
for (const s of list) { const k = s.step ?? '
|
| 231 |
return [...m.entries()];
|
| 232 |
};
|
| 233 |
|
|
@@ -263,7 +263,7 @@ function StepGroups({ list, kind, pending, decisions, decide, notes, setNote }:
|
|
| 263 |
<Accordion.Control>
|
| 264 |
<Group gap={8} wrap="wrap">
|
| 265 |
<Text size="sm" fw={600}>{step}</Text>
|
| 266 |
-
<Text size="xs" c="dimmed">{items.length} scenario{items.length === 1 ? '' : 's'}{decisions ? `
|
| 267 |
</Group>
|
| 268 |
</Accordion.Control>
|
| 269 |
{decide && (
|
|
@@ -310,6 +310,14 @@ export function ScenarioReview({ id, waiting }: { id: string; waiting: boolean }
|
|
| 310 |
const [filter, setFilter] = useState<ReviewFilter>('all');
|
| 311 |
const panel = useSidePanelOptional();
|
| 312 |
const all = useMemo(() => sc.data?.scenarios ?? [], [sc.data]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 313 |
const known = useMemo(() => new Map(all.map((s) => [s.id, s])), [all]);
|
| 314 |
const toReview = useMemo(() => [...pending.values()].map((p) => known.get(p.id) ?? stub(p)), [pending, known]);
|
| 315 |
const isChanged = (s: Scenario) => { const p = pending.get(s.id); return !!p && (p.changed_by_patch || p.new_or_changed || p.origin === 'generated' || p.origin === 'ai'); };
|
|
@@ -338,7 +346,7 @@ export function ScenarioReview({ id, waiting }: { id: string; waiting: boolean }
|
|
| 338 |
{g && (
|
| 339 |
<section aria-label="scenario review" style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
| 340 |
<Text size="sm" c="dimmed">
|
| 341 |
-
<Term k="Scenario review">
|
| 342 |
{g.policy !== 'L0' ? ' Some scenarios were approved automatically because this business area has a proven track record.' : ''}
|
| 343 |
</Text>
|
| 344 |
<FilterChips label="Show scenarios" value={filter} onChange={setFilter} options={[
|
|
@@ -361,7 +369,7 @@ export function ScenarioReview({ id, waiting }: { id: string; waiting: boolean }
|
|
| 361 |
<Text size="sm" fw={600}>New or changed by this patch ({changed.length})</Text>
|
| 362 |
{changed.length === 0
|
| 363 |
? <Text size="sm" c="dimmed">{filter === 'all' ? 'This patch does not add or change any scenario in this test run.' : 'No scenario of this kind among the new or changed ones.'}</Text>
|
| 364 |
-
: <StepGroups list={changed} kind="changed" {...groupProps} />}
|
| 365 |
{(g.ai_not_runnable ?? []).length > 0 && <NotRunnable list={g.ai_not_runnable ?? []} />}
|
| 366 |
{unchanged.length > 0 && (
|
| 367 |
<>
|
|
@@ -371,16 +379,16 @@ export function ScenarioReview({ id, waiting }: { id: string; waiting: boolean }
|
|
| 371 |
<Text size="xs" c="dimmed">Library scenarios this patch does not touch: {unchanged.filter((s) => decisions[s.id] === 'approve').length} approved</Text>
|
| 372 |
<Button size="compact-xs" variant="default" onClick={() => decide(unchanged.map((s) => s.id), 'approve')}>Approve all {unchanged.length} unchanged</Button>
|
| 373 |
</Group>
|
| 374 |
-
{showUnchanged && <StepGroups list={unchanged} kind="unchanged" {...groupProps} />}
|
| 375 |
</>
|
| 376 |
)}
|
| 377 |
<ErrorAlert error={approve.error} />
|
| 378 |
<div className="fpt-sticky-bar" data-testid="review-bar" role="group" aria-label="review summary">
|
| 379 |
-
<Text size="sm" data-testid="review-count"><b>{approved.length} of {ids.length} approved</b>{skipped.length ? `
|
| 380 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray" p={6}>Scenario approval needs the consultant (or admin) role.</Alert>}>
|
| 381 |
<Group gap={8}>
|
| 382 |
{undecided > 0 && <Button variant="default" size="xs" onClick={() => decide(ids.filter((i) => !decisions[i]), 'approve')}>Approve the remaining {undecided}</Button>}
|
| 383 |
-
<Button size="xs" onClick={submit} loading={approve.isPending} disabled={approve.isSuccess || undecided > 0}
|
| 384 |
title={undecided ? 'Approve or skip every scenario first' : undefined}>Submit review</Button>
|
| 385 |
{approve.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; testing continues.</Text>}
|
| 386 |
</Group>
|
|
|
|
| 3 |
import { useId, useMemo, useRef, useState, type KeyboardEvent as ReactKeyboardEvent, type ReactNode } from 'react';
|
| 4 |
import { useApproveCases, useCaseYaml, useGate, useRunScenarios } from '../api/hooks';
|
| 5 |
import type { AiDraft, ApproveGate, DryRun, PendingCase, Scenario } from '../api/types';
|
| 6 |
+
import { AiText, Can, Diff, ErrorAlert, Pill, Prio, Pre, Term } from '../components/common';
|
| 7 |
import { FilterChips } from '../components/shell/FilterChips';
|
| 8 |
import { useSidePanelOptional } from '../components/shell/SidePanel';
|
| 9 |
import { PRIORITY_WORDS } from '../glossary';
|
|
|
|
| 57 |
<div data-testid="ai-not-runnable" style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
|
| 58 |
<UnstyledButton onClick={() => setOpen((o) => !o)} aria-expanded={open} className="fpt-notoffered">
|
| 59 |
{open ? <IconChevronDown size={14} /> : <IconChevronRight size={14} />}
|
| 60 |
+
<Text size="sm" fw={600} span>Written by the AI model, not offered</Text> <span className="fpt-num fpt-dimtext">{list.length}</span>
|
| 61 |
</UnstyledButton>
|
| 62 |
<Collapse in={open}>
|
| 63 |
<Stack gap={8}>
|
| 64 |
<Text size="xs" c="dimmed">These new scenarios failed their dry run, so they are not part of this test run. They stay in staging.</Text>
|
| 65 |
{list.map((d, i) => (
|
| 66 |
<div key={d.id ?? `x${i}`} className="fpt-srow" data-testid={`ai-failed-${d.id ?? i}`}>
|
| 67 |
+
<Group gap={6} wrap="wrap"><Text size="sm">{d.title}</Text><AiText /><span className="fpt-statustext" data-tone="red">{d.dry_run ? 'dry run failed' : 'not written'}</span></Group>
|
| 68 |
<DryRunLine d={d.dry_run} />
|
| 69 |
{d.problems.length > 0 && <Text size="xs" c="dimmed">{d.problems.slice(0, 3).join(' · ')}</Text>}
|
| 70 |
{d.steps.length > 0 && (
|
|
|
|
| 81 |
/** The dry-run result of an AI-written scenario as one line with an icon (passed / failed / simulated). */
|
| 82 |
function DryRunBadge({ d }: { d: DryRun | null | undefined }) {
|
| 83 |
if (!d) return <Text size="sm" c="dimmed">Not dry-run</Text>;
|
| 84 |
+
const when = d.at ? `, ${shortWhen(d.at)}` : '';
|
| 85 |
const tip = d.at ? utcTitle(d.at) : undefined;
|
| 86 |
if (d.simulated) return <Group gap={6} wrap="nowrap" className="fpt-dry" data-result="simulated" title={tip}><IconWorldOff size={15} aria-hidden /><Text size="sm">Dry run simulated: no browser, not on a pod{when}</Text></Group>;
|
| 87 |
if (d.status === 'passed') return <Group gap={6} wrap="nowrap" className="fpt-dry" data-result="passed" title={tip}><IconCircleCheck size={15} aria-hidden /><Text size="sm">Dry run passed on {d.pod ?? 'the pod'}{when}</Text></Group>;
|
|
|
|
| 95 |
const steps = p?.ai?.steps.length ?? s.steps.length;
|
| 96 |
return (
|
| 97 |
<div className="fpt-card fpt-approval" data-testid={`approval-card-${s.id}`} data-decision={decision ?? 'undecided'}>
|
| 98 |
+
<Group gap={10} wrap="wrap">
|
| 99 |
+
<AiText />
|
| 100 |
+
<Prio words={s.priority_words} />
|
| 101 |
</Group>
|
| 102 |
<Text fw={600} size="sm" mt={8}>{s.title}</Text>
|
| 103 |
<div style={{ marginTop: 6 }}><DryRunBadge d={p?.ai?.dry_run ?? s.dry_run} /></div>
|
| 104 |
<Text size="xs" c="dimmed" mt={6}>
|
| 105 |
+
{steps} step{steps === 1 ? '' : 's'}, from Oracle's standard screen labels. No client data sent.{p?.ai?.model ? <> Model <span className="fpt-nowrap">{p.ai.model}</span>.</> : ''}
|
| 106 |
</Text>
|
| 107 |
<Group justify="space-between" mt="sm" gap={8} wrap="wrap">
|
| 108 |
{onShowSteps ? <Button size="compact-xs" variant="subtle" leftSection={<IconListNumbers size={13} />} onClick={onShowSteps}>Show steps</Button> : <span />}
|
|
|
|
| 129 |
{s.preconditions.length > 0 && <Text size="sm"><b>Setup needed:</b> {s.preconditions.join(' ')}</Text>}
|
| 130 |
{s.steps.length > 0 && (
|
| 131 |
<div>
|
| 132 |
+
<Text size="sm" fw={600}>Steps</Text>
|
| 133 |
<ol style={{ margin: '4px 0 0', paddingLeft: 20, fontSize: 13 }}>
|
| 134 |
{s.steps.map((st) => <li key={st.n}>{st.text}{st.expected ? <Text span size="xs" c="dimmed"> → {st.expected}</Text> : null}</li>)}
|
| 135 |
</ol>
|
|
|
|
| 137 |
)}
|
| 138 |
{s.test_data.length > 0 && (
|
| 139 |
<div>
|
| 140 |
+
<Text size="sm" fw={600}>Test data</Text>
|
| 141 |
{s.test_data.map((d) => (
|
| 142 |
<div key={d.id} style={{ marginTop: 4 }}>
|
| 143 |
<Text size="xs"><b>{d.title}</b>{d.purpose ? `: ${d.purpose}` : ''}</Text>
|
|
|
|
| 192 |
<Group gap={6} wrap="nowrap">
|
| 193 |
{open ? <IconChevronDown size={14} style={{ flex: '0 0 14px' }} /> : <IconChevronRight size={14} style={{ flex: '0 0 14px' }} />}
|
| 194 |
<Text size="sm" truncate={open ? undefined : 'end'} style={{ minWidth: 0 }}>{s.title}</Text>
|
| 195 |
+
<Prio words={s.priority_words} />
|
| 196 |
+
{s.origin === 'generated' && <span className="fpt-dimtext">new</span>}
|
| 197 |
+
{(s.origin === 'ai' || p?.origin === 'ai') && <AiText />}
|
| 198 |
+
{p?.ai?.dry_run?.status === 'passed' && <span className="fpt-dryok">{p.ai.dry_run.simulated ? <IconWorldOff size={14} aria-hidden /> : <IconCircleCheck size={14} aria-hidden />}{p.ai.dry_run.simulated ? 'dry run simulated' : 'dry run passed'}</span>}
|
| 199 |
{out && <Pill tone={out.tone}>{out.label}</Pill>}
|
| 200 |
</Group>
|
| 201 |
</UnstyledButton>
|
|
|
|
| 227 |
|
| 228 |
const byStep = (list: Scenario[]) => {
|
| 229 |
const m = new Map<string, Scenario[]>();
|
| 230 |
+
for (const s of list) { const k = s.step ?? 'No process step'; m.set(k, [...(m.get(k) ?? []), s]); }
|
| 231 |
return [...m.entries()];
|
| 232 |
};
|
| 233 |
|
|
|
|
| 263 |
<Accordion.Control>
|
| 264 |
<Group gap={8} wrap="wrap">
|
| 265 |
<Text size="sm" fw={600}>{step}</Text>
|
| 266 |
+
<Text size="xs" c="dimmed">{items.length} scenario{items.length === 1 ? '' : 's'}{decisions ? `, ${approved} approved${skipped ? `, ${skipped} skipped` : ''}` : ''}</Text>
|
| 267 |
</Group>
|
| 268 |
</Accordion.Control>
|
| 269 |
{decide && (
|
|
|
|
| 310 |
const [filter, setFilter] = useState<ReviewFilter>('all');
|
| 311 |
const panel = useSidePanelOptional();
|
| 312 |
const all = useMemo(() => sc.data?.scenarios ?? [], [sc.data]);
|
| 313 |
+
// The process step of each scenario comes from the run's scenario list: until it has loaded, show a skeleton,
|
| 314 |
+
// never a group of stubs without a step.
|
| 315 |
+
const listLoading = !sc.data && !sc.isError;
|
| 316 |
+
const groupsSkeleton = (
|
| 317 |
+
<Stack gap={8} aria-busy="true" aria-label="Loading the scenarios">
|
| 318 |
+
<Skeleton height={36} radius="md" /><Skeleton height={36} radius="md" /><Skeleton height={36} radius="md" />
|
| 319 |
+
</Stack>
|
| 320 |
+
);
|
| 321 |
const known = useMemo(() => new Map(all.map((s) => [s.id, s])), [all]);
|
| 322 |
const toReview = useMemo(() => [...pending.values()].map((p) => known.get(p.id) ?? stub(p)), [pending, known]);
|
| 323 |
const isChanged = (s: Scenario) => { const p = pending.get(s.id); return !!p && (p.changed_by_patch || p.new_or_changed || p.origin === 'generated' || p.origin === 'ai'); };
|
|
|
|
| 346 |
{g && (
|
| 347 |
<section aria-label="scenario review" style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
|
| 348 |
<Text size="sm" c="dimmed">
|
| 349 |
+
{toReview.length} <Term k="Scenario review" plain>{toReview.length === 1 ? 'scenario' : 'scenarios'} to review</Term>. Approve them, or skip some for this patch.
|
| 350 |
{g.policy !== 'L0' ? ' Some scenarios were approved automatically because this business area has a proven track record.' : ''}
|
| 351 |
</Text>
|
| 352 |
<FilterChips label="Show scenarios" value={filter} onChange={setFilter} options={[
|
|
|
|
| 369 |
<Text size="sm" fw={600}>New or changed by this patch ({changed.length})</Text>
|
| 370 |
{changed.length === 0
|
| 371 |
? <Text size="sm" c="dimmed">{filter === 'all' ? 'This patch does not add or change any scenario in this test run.' : 'No scenario of this kind among the new or changed ones.'}</Text>
|
| 372 |
+
: listLoading ? groupsSkeleton : <StepGroups list={changed} kind="changed" {...groupProps} />}
|
| 373 |
{(g.ai_not_runnable ?? []).length > 0 && <NotRunnable list={g.ai_not_runnable ?? []} />}
|
| 374 |
{unchanged.length > 0 && (
|
| 375 |
<>
|
|
|
|
| 379 |
<Text size="xs" c="dimmed">Library scenarios this patch does not touch: {unchanged.filter((s) => decisions[s.id] === 'approve').length} approved</Text>
|
| 380 |
<Button size="compact-xs" variant="default" onClick={() => decide(unchanged.map((s) => s.id), 'approve')}>Approve all {unchanged.length} unchanged</Button>
|
| 381 |
</Group>
|
| 382 |
+
{showUnchanged && (listLoading ? groupsSkeleton : <StepGroups list={unchanged} kind="unchanged" {...groupProps} />)}
|
| 383 |
</>
|
| 384 |
)}
|
| 385 |
<ErrorAlert error={approve.error} />
|
| 386 |
<div className="fpt-sticky-bar" data-testid="review-bar" role="group" aria-label="review summary">
|
| 387 |
+
<Text size="sm" data-testid="review-count"><b>{approved.length} of {ids.length} approved</b>{skipped.length ? `, ${skipped.length} skipped` : ''}{undecided ? `, ${undecided} not decided yet` : ''}</Text>
|
| 388 |
<Can perm="gate.approve_cases" fallback={<Alert color="gray" p={6}>Scenario approval needs the consultant (or admin) role.</Alert>}>
|
| 389 |
<Group gap={8}>
|
| 390 |
{undecided > 0 && <Button variant="default" size="xs" onClick={() => decide(ids.filter((i) => !decisions[i]), 'approve')}>Approve the remaining {undecided}</Button>}
|
| 391 |
+
<Button size="xs" variant="filled" onClick={submit} loading={approve.isPending} disabled={approve.isSuccess || undecided > 0}
|
| 392 |
title={undecided ? 'Approve or skip every scenario first' : undefined}>Submit review</Button>
|
| 393 |
{approve.isSuccess && <Text c="teal" size="sm" role="status">Review recorded; testing continues.</Text>}
|
| 394 |
</Group>
|
web/src/pages/ScheduledRunsPage.tsx
ADDED
|
@@ -0,0 +1,170 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { ActionIcon, Button, Drawer, Group, Menu, Modal, MultiSelect, NumberInput, SegmentedControl, Select, Skeleton, Stack, Switch, Text, TextInput } from '@mantine/core';
|
| 2 |
+
import { IconClock, IconDots, IconPlus, IconTrash } from '@tabler/icons-react';
|
| 3 |
+
import { useMutation, useQueryClient } from '@tanstack/react-query';
|
| 4 |
+
import { useState } from 'react';
|
| 5 |
+
import { MODULE_NAMES } from '../agents';
|
| 6 |
+
import { api, unwrap } from '../api/client';
|
| 7 |
+
import { usePatchWatch, useSchedules } from '../api/hooks';
|
| 8 |
+
import type { Schedule } from '../api/types';
|
| 9 |
+
import { Can, ErrorAlert, fmtTs, PageHeader } from '../components/common';
|
| 10 |
+
import { shortWhen } from '../runName';
|
| 11 |
+
|
| 12 |
+
const MODULES = ['P2P', 'O2C', 'R2R', 'A2R', 'EXP', 'HCM', 'P2M', 'PPM', 'SCM', 'SCP'];
|
| 13 |
+
const two = (n: number) => String(n).padStart(2, '0');
|
| 14 |
+
|
| 15 |
+
/** "02:00" (UTC) as the viewer's local time, for the "07:30 your time" helper. Empty when the input is not HH:MM. */
|
| 16 |
+
export function utcToLocal(at: string | null | undefined): string {
|
| 17 |
+
const m = /^(\d{1,2}):(\d{2})$/.exec(at ?? '');
|
| 18 |
+
if (!m) return '';
|
| 19 |
+
const d = new Date();
|
| 20 |
+
d.setUTCHours(Number(m[1]), Number(m[2]), 0, 0);
|
| 21 |
+
return `${two(d.getHours())}:${two(d.getMinutes())}`;
|
| 22 |
+
}
|
| 23 |
+
|
| 24 |
+
/** Every N minutes in words: "Every day", "Every 6 hours", "Every 90 minutes". */
|
| 25 |
+
export function everyWords(min: number | null | undefined): string {
|
| 26 |
+
const n = Number(min ?? 0);
|
| 27 |
+
if (n > 0 && n % 1440 === 0) return n === 1440 ? 'Every day' : `Every ${n / 1440} days`;
|
| 28 |
+
if (n > 0 && n % 60 === 0) return n === 60 ? 'Every hour' : `Every ${n / 60} hours`;
|
| 29 |
+
return n === 1 ? 'Every minute' : `Every ${n} minutes`;
|
| 30 |
+
}
|
| 31 |
+
|
| 32 |
+
/** A schedule as one sentence: "Every day at 02:00 UTC (07:30 your time). Procure-to-Pay, full browser run." */
|
| 33 |
+
export function scheduleSentence(x: Pick<Schedule, 'kind' | 'at' | 'every_minutes' | 'modules' | 'playwright_mode'>): { when: string; what: string } {
|
| 34 |
+
const local = x.kind === 'daily' ? utcToLocal(x.at) : '';
|
| 35 |
+
const when = x.kind === 'daily' ? `Every day at ${x.at} UTC${local && local !== x.at ? ` (${local} your time)` : ''}.` : `${everyWords(x.every_minutes)}.`;
|
| 36 |
+
const areas = x.modules.length ? x.modules.map((m) => MODULE_NAMES[m] ?? m).join(', ') : 'All areas';
|
| 37 |
+
const how = x.playwright_mode === 'stub' ? 'quick simulation' : 'full browser run';
|
| 38 |
+
return { when, what: `${areas}, ${how}.` };
|
| 39 |
+
}
|
| 40 |
+
|
| 41 |
+
function NewScheduleDrawer({ opened, onClose }: { opened: boolean; onClose: () => void }) {
|
| 42 |
+
const qc = useQueryClient();
|
| 43 |
+
const [kind, setKind] = useState<'daily' | 'interval'>('daily');
|
| 44 |
+
const [at, setAt] = useState('02:00');
|
| 45 |
+
const [every, setEvery] = useState<number | string>(6);
|
| 46 |
+
const [unit, setUnit] = useState<'hours' | 'minutes'>('hours');
|
| 47 |
+
const [mods, setMods] = useState<string[]>(['P2P']);
|
| 48 |
+
const [mode, setMode] = useState<'live' | 'stub'>('live');
|
| 49 |
+
const minutes = Number(every) * (unit === 'hours' ? 60 : 1);
|
| 50 |
+
const create = useMutation({
|
| 51 |
+
mutationFn: () => unwrap(api.POST('/api/schedules', { body: { kind, every_minutes: kind === 'interval' ? minutes : null, at: kind === 'daily' ? at : null, modules: mods, include_p2: false, playwright_mode: mode, enabled: true } })),
|
| 52 |
+
onSuccess: () => { qc.invalidateQueries({ queryKey: ['schedules'] }); onClose(); },
|
| 53 |
+
});
|
| 54 |
+
const local = utcToLocal(at);
|
| 55 |
+
const valid = kind === 'daily' ? !!local : minutes >= 1;
|
| 56 |
+
return (
|
| 57 |
+
<Drawer opened={opened} onClose={onClose} position="right" size={420} title="New scheduled run">
|
| 58 |
+
<Stack gap="md">
|
| 59 |
+
<div>
|
| 60 |
+
<Text size="sm" fw={600} mb={4}>Repeat</Text>
|
| 61 |
+
<SegmentedControl fullWidth aria-label="Repeat" value={kind} onChange={(v) => setKind(v as 'daily' | 'interval')}
|
| 62 |
+
data={[{ value: 'daily', label: 'Every day' }, { value: 'interval', label: 'Every few hours' }]} />
|
| 63 |
+
</div>
|
| 64 |
+
{kind === 'daily' ? (
|
| 65 |
+
<TextInput label="Time (UTC, HH:MM)" value={at} onChange={(e) => setAt(e.currentTarget.value)} w={180}
|
| 66 |
+
description={local ? `${local} your time` : 'Enter the time as HH:MM, for example 02:00.'} error={at && !local ? 'Use HH:MM' : undefined} />
|
| 67 |
+
) : (
|
| 68 |
+
<Group align="flex-end" gap="xs">
|
| 69 |
+
<NumberInput label="Every" min={1} value={every} onChange={setEvery} w={110} />
|
| 70 |
+
<Select aria-label="Unit" data={[{ value: 'hours', label: 'hours' }, { value: 'minutes', label: 'minutes' }]} value={unit} onChange={(v) => setUnit((v as 'hours' | 'minutes') ?? 'hours')} w={120} allowDeselect={false} />
|
| 71 |
+
</Group>
|
| 72 |
+
)}
|
| 73 |
+
<MultiSelect label="Business areas" description="Leave empty for all areas." data={MODULES.map((m) => ({ value: m, label: MODULE_NAMES[m] ?? m }))} value={mods} onChange={setMods} searchable />
|
| 74 |
+
<div>
|
| 75 |
+
<Text size="sm" fw={600} mb={4}>How</Text>
|
| 76 |
+
<SegmentedControl fullWidth aria-label="How" value={mode} onChange={(v) => setMode(v as 'live' | 'stub')}
|
| 77 |
+
data={[{ value: 'stub', label: 'Quick simulation (no browser)' }, { value: 'live', label: 'Full browser run' }]} />
|
| 78 |
+
</div>
|
| 79 |
+
<ErrorAlert error={create.error} title="Could not save the scheduled run" />
|
| 80 |
+
<Group justify="space-between">
|
| 81 |
+
<Button onClick={onClose}>Cancel</Button>
|
| 82 |
+
<Button variant="filled" onClick={() => create.mutate()} loading={create.isPending} disabled={!valid}>Save scheduled run</Button>
|
| 83 |
+
</Group>
|
| 84 |
+
</Stack>
|
| 85 |
+
</Drawer>
|
| 86 |
+
);
|
| 87 |
+
}
|
| 88 |
+
|
| 89 |
+
/** Scheduled runs on today's API: every day at a UTC time, or every N minutes; delete with a confirm; patch watch. */
|
| 90 |
+
export function ScheduledRunsPage() {
|
| 91 |
+
const s = useSchedules();
|
| 92 |
+
const pw = usePatchWatch();
|
| 93 |
+
const qc = useQueryClient();
|
| 94 |
+
const [adding, setAdding] = useState(false);
|
| 95 |
+
const [confirm, setConfirm] = useState<Schedule | null>(null);
|
| 96 |
+
const del = useMutation({
|
| 97 |
+
mutationFn: (sid: number) => unwrap(api.DELETE('/api/schedules/{sid}', { params: { path: { sid } } })),
|
| 98 |
+
onSuccess: () => { qc.invalidateQueries({ queryKey: ['schedules'] }); setConfirm(null); },
|
| 99 |
+
});
|
| 100 |
+
const setPw = useMutation({
|
| 101 |
+
mutationFn: (body: { enabled?: boolean; autostart?: boolean; interval_s?: number; modules?: string[] }) => unwrap(api.PUT('/api/patch-watch', { body })),
|
| 102 |
+
onSuccess: () => qc.invalidateQueries({ queryKey: ['patchwatch'] }),
|
| 103 |
+
});
|
| 104 |
+
const check = useMutation({ mutationFn: () => unwrap(api.POST('/api/patch-watch/check')), onSuccess: () => qc.invalidateQueries({ queryKey: ['patchwatch'] }) });
|
| 105 |
+
const newBtn = <Can perm="admin"><Button variant="filled" leftSection={<IconPlus size={13} />} onClick={() => setAdding(true)}>New scheduled run</Button></Can>;
|
| 106 |
+
const items = s.data ?? [];
|
| 107 |
+
return (
|
| 108 |
+
<Stack gap="lg">
|
| 109 |
+
<PageHeader crumbs={[]} title="Scheduled runs" extra={<span className="fpt-pagedesc">Test runs that start on their own, and the watch for a new Oracle release. Times are in UTC.</span>}>
|
| 110 |
+
{newBtn}
|
| 111 |
+
</PageHeader>
|
| 112 |
+
{/* inside Settings the top bar is hidden: the primary action shows here instead */}
|
| 113 |
+
<div className="fpt-embedded-only"><Text size="sm" c="dimmed" style={{ flex: 1 }}>Test runs that start on their own. Times are in UTC.</Text>{newBtn}</div>
|
| 114 |
+
<ErrorAlert error={s.error || del.error || setPw.error || check.error} />
|
| 115 |
+
|
| 116 |
+
<section aria-label="Patch watch" className="fpt-plainsection">
|
| 117 |
+
<Text fw={600}>Patch watch</Text>
|
| 118 |
+
<Text size="sm" c="dimmed" mt={2}>
|
| 119 |
+
Looks for a new Oracle release on the pod. Last seen {pw.data?.last_seen_release ?? 'nothing yet'}{pw.data?.last_checked_at ? `, checked ${shortWhen(pw.data.last_checked_at)}` : ''}.
|
| 120 |
+
{pw.data?.last_error ? <span style={{ color: 'var(--pill-red-fg)' }}> The last check failed: {pw.data.last_error}</span> : null}
|
| 121 |
+
</Text>
|
| 122 |
+
<Can perm="admin" fallback={<Text size="xs" c="dimmed" mt={6}>Patch watch is {pw.data?.enabled ? 'on' : 'off'}; automatic start is {pw.data?.autostart ? 'on' : 'off'}.</Text>}>
|
| 123 |
+
<Group mt="sm" align="flex-end" wrap="wrap" gap="lg">
|
| 124 |
+
<Switch label="Enabled" checked={!!pw.data?.enabled} onChange={(e) => setPw.mutate({ enabled: e.currentTarget.checked })} />
|
| 125 |
+
<Switch label="Start a test run automatically when a new release appears" checked={!!pw.data?.autostart} onChange={(e) => setPw.mutate({ autostart: e.currentTarget.checked })} />
|
| 126 |
+
<NumberInput label="Check every (seconds)" min={30} max={86400} w={170} value={pw.data?.interval_s ?? 300} onBlur={(e) => setPw.mutate({ interval_s: Number(e.currentTarget.value) })} />
|
| 127 |
+
<Button onClick={() => check.mutate()} loading={check.isPending}>Check now</Button>
|
| 128 |
+
</Group>
|
| 129 |
+
</Can>
|
| 130 |
+
</section>
|
| 131 |
+
|
| 132 |
+
<section>
|
| 133 |
+
<Text fw={600} mb={6}>Schedules</Text>
|
| 134 |
+
<div className="fpt-card" role="list" aria-label="schedules" style={{ overflow: 'hidden' }}>
|
| 135 |
+
{s.isLoading && <div style={{ padding: 12 }}><Skeleton height={36} /></div>}
|
| 136 |
+
{!s.isLoading && items.length === 0 && <Text size="sm" c="dimmed" p="md">No scheduled runs yet. Schedule one to test every night or after each update.</Text>}
|
| 137 |
+
{items.map((x, i) => {
|
| 138 |
+
const t = scheduleSentence(x);
|
| 139 |
+
return (
|
| 140 |
+
<div key={x.id} role="listitem" className="fpt-row" data-testid={`schedule-${x.id}`} style={{ borderTop: i ? '1px solid var(--fpt-border)' : 0, alignItems: 'flex-start' }}>
|
| 141 |
+
<IconClock size={16} color="var(--fpt-dim)" aria-hidden style={{ marginTop: 2, flex: '0 0 auto' }} />
|
| 142 |
+
<div style={{ flex: '1 1 auto', minWidth: 0 }}>
|
| 143 |
+
<Text size="sm"><b>{t.when}</b> {t.what}</Text>
|
| 144 |
+
<Text size="xs" c="dimmed" title={x.next_run_at ? fmtTs(x.next_run_at) : undefined}>
|
| 145 |
+
{x.next_run_at ? `Next run ${shortWhen(x.next_run_at)} your time.` : 'No next run planned.'} Created by {x.created_by}.
|
| 146 |
+
</Text>
|
| 147 |
+
</div>
|
| 148 |
+
<Can perm="admin">
|
| 149 |
+
<Menu position="bottom-end" withinPortal>
|
| 150 |
+
<Menu.Target><ActionIcon variant="subtle" color="gray" aria-label={`actions for schedule ${x.id}`}><IconDots size={15} /></ActionIcon></Menu.Target>
|
| 151 |
+
<Menu.Dropdown><Menu.Item color="red" leftSection={<IconTrash size={14} />} onClick={() => setConfirm(x)}>Delete</Menu.Item></Menu.Dropdown>
|
| 152 |
+
</Menu>
|
| 153 |
+
</Can>
|
| 154 |
+
</div>
|
| 155 |
+
);
|
| 156 |
+
})}
|
| 157 |
+
</div>
|
| 158 |
+
</section>
|
| 159 |
+
|
| 160 |
+
<NewScheduleDrawer opened={adding} onClose={() => setAdding(false)} />
|
| 161 |
+
<Modal opened={!!confirm} onClose={() => setConfirm(null)} title="Delete this scheduled run?" centered>
|
| 162 |
+
{confirm && <Text size="sm">{scheduleSentence(confirm).when} {scheduleSentence(confirm).what} Test runs it already started are kept.</Text>}
|
| 163 |
+
<Group justify="flex-end" mt="md">
|
| 164 |
+
<Button onClick={() => setConfirm(null)}>Keep it</Button>
|
| 165 |
+
<Button color="red" variant="filled" loading={del.isPending} onClick={() => confirm && del.mutate(confirm.id)}>Delete</Button>
|
| 166 |
+
</Group>
|
| 167 |
+
</Modal>
|
| 168 |
+
</Stack>
|
| 169 |
+
);
|
| 170 |
+
}
|
web/src/pages/SettingsPage.tsx
CHANGED
|
@@ -1,10 +1,12 @@
|
|
| 1 |
-
import {
|
| 2 |
import { IconAdjustments, IconBooks, IconBrain, IconCircleCheck, IconCircleX, IconPlugConnected, IconRobot, IconShieldCheck, IconWand } from '@tabler/icons-react';
|
| 3 |
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
| 4 |
import { useEffect, useState, type ReactNode } from 'react';
|
| 5 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 6 |
import { api, getJson, unwrap } from '../api/client';
|
| 7 |
-
import {
|
|
|
|
|
|
|
| 8 |
import { AutonomyPage, KillSwitchPage, SchedulerPage, UsersPage } from './AdminPages';
|
| 9 |
|
| 10 |
interface LLMView {
|
|
@@ -24,9 +26,9 @@ const PROVIDERS = [
|
|
| 24 |
function TestLine({ r }: { r: TestResult | null }) {
|
| 25 |
if (!r) return null;
|
| 26 |
return (
|
| 27 |
-
<
|
| 28 |
-
{r.detail}{r.ok && r.model ? ` Model: ${r.model}.` : ''}
|
| 29 |
-
</
|
| 30 |
);
|
| 31 |
}
|
| 32 |
|
|
@@ -60,8 +62,8 @@ export function AIModelsTab() {
|
|
| 60 |
|
| 61 |
return (
|
| 62 |
<Stack gap="md" aria-label="AI models">
|
| 63 |
-
<div
|
| 64 |
-
<Text size="sm" fw={
|
| 65 |
<Text size="sm" c="dimmed">
|
| 66 |
It works without any AI model, using built-in rules. Connecting models makes its research, scenario choice and explanations better.
|
| 67 |
Your business data never leaves your environment: only the <b>local</b> model sees it. The <b>external</b> model only ever receives public
|
|
@@ -72,11 +74,11 @@ export function AIModelsTab() {
|
|
| 72 |
|
| 73 |
<div className="fpt-cols">
|
| 74 |
<section className="fpt-card" style={{ padding: 16, flex: '1 1 380px' }} aria-label="Local model">
|
| 75 |
-
<Group justify="space-between" mb="xs"><Text fw={
|
| 76 |
<Text size="xs" c="dimmed" mb="sm">Runs inside your environment (Ollama). Used for failure analysis, self-heal, data planning, script writing and chat.</Text>
|
| 77 |
<Stack gap="sm">
|
| 78 |
<SegmentedControl aria-label="Local model" value={local.mode} onChange={(m) => setLocal((s) => ({ ...s, mode: m as 'stub' | 'ollama' }))}
|
| 79 |
-
data={[{ value: 'stub', label: 'Built-in rules (no AI)' }, { value: 'ollama', label: 'Ollama model' }]}
|
| 80 |
{local.mode === 'ollama' && (
|
| 81 |
<>
|
| 82 |
<TextInput label="Ollama address" description={`Must be on this server or an approved internal host (${(v?.local.allowed_hosts ?? []).join(', ')}).`}
|
|
@@ -86,7 +88,7 @@ export function AIModelsTab() {
|
|
| 86 |
</>
|
| 87 |
)}
|
| 88 |
<Group gap="xs">
|
| 89 |
-
<Button onClick={() => save.mutate({ llm_local: local.mode, ...(local.mode === 'ollama' ? { ollama_url: local.url, ollama_model: local.model } : {}) })} loading={save.isPending}>Save local model</Button>
|
| 90 |
<Button variant="default" leftSection={<IconPlugConnected size={13} />} onClick={() => test.mutate('local')} loading={test.isPending && test.variables === 'local'}>Test</Button>
|
| 91 |
</Group>
|
| 92 |
<TestLine r={tests.local} />
|
|
@@ -94,11 +96,11 @@ export function AIModelsTab() {
|
|
| 94 |
</section>
|
| 95 |
|
| 96 |
<section className="fpt-card" style={{ padding: 16, flex: '1 1 380px' }} aria-label="External model">
|
| 97 |
-
<Group justify="space-between" mb="xs"><Text fw={
|
| 98 |
<Text size="xs" c="dimmed" mb="sm">A hosted model for reading public release notes and writing summaries. It never receives client data.</Text>
|
| 99 |
<Stack gap="sm">
|
| 100 |
<SegmentedControl aria-label="External model" value={ext.mode} onChange={(m) => setExt((s) => ({ ...s, mode: m as 'off' | 'frontier' }))}
|
| 101 |
-
data={[{ value: 'off', label: 'Off' }, { value: 'frontier', label: 'On' }]}
|
| 102 |
{ext.mode === 'frontier' && (
|
| 103 |
<>
|
| 104 |
<Select label="Provider" data={PROVIDERS} value={provider} allowDeselect={false}
|
|
@@ -112,7 +114,7 @@ export function AIModelsTab() {
|
|
| 112 |
<Button variant="default" leftSection={<IconPlugConnected size={13} />} onClick={() => test.mutate('external')} loading={test.isPending && test.variables === 'external'}>Test</Button>
|
| 113 |
</Group>
|
| 114 |
<div>
|
| 115 |
-
<Group gap={6} mb={4}><Text size="sm" fw={
|
| 116 |
<Group gap="xs" align="flex-end">
|
| 117 |
<PasswordInput aria-label="API key" placeholder={v?.external.key_set ? 'enter a new key to replace it' : 'paste the key'} value={key} onChange={(e) => setKey(e.currentTarget.value)}
|
| 118 |
autoComplete="new-password" style={{ flex: 1, minWidth: 180 }} />
|
|
@@ -126,9 +128,23 @@ export function AIModelsTab() {
|
|
| 126 |
</section>
|
| 127 |
</div>
|
| 128 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
<section className="fpt-card" style={{ padding: 16 }} aria-label="What goes where">
|
| 130 |
-
<Text fw={
|
| 131 |
-
<Table fz="sm" verticalSpacing={6}>
|
| 132 |
<Table.Thead><Table.Tr><Table.Th>Work</Table.Th><Table.Th>Data it sees</Table.Th><Table.Th>Answered by</Table.Th></Table.Tr></Table.Thead>
|
| 133 |
<Table.Tbody>{(v?.routing ?? []).map((r) => <Table.Tr key={r.work}><Table.Td>{r.work}</Table.Td><Table.Td>{r.data}</Table.Td><Table.Td>{r.goes_to}</Table.Td></Table.Tr>)}</Table.Tbody>
|
| 134 |
</Table>
|
|
@@ -137,11 +153,26 @@ export function AIModelsTab() {
|
|
| 137 |
);
|
| 138 |
}
|
| 139 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 140 |
function AdvCard({ to, icon, title, body }: { to: string; icon: ReactNode; title: string; body: string }) {
|
| 141 |
return (
|
| 142 |
<Link to={to} className="fpt-card fpt-tile" style={{ flex: '1 1 240px' }}>
|
| 143 |
<span className="fpt-iconbtn" style={{ width: 34, height: 34, borderRadius: 10 }} aria-hidden>{icon}</span>
|
| 144 |
-
<span><Text size="sm" fw={
|
| 145 |
</Link>
|
| 146 |
);
|
| 147 |
}
|
|
@@ -152,10 +183,11 @@ const TABS = [['ai', 'AI models'], ['users', 'Users'], ['schedules', 'Schedules'
|
|
| 152 |
export function SettingsPage() {
|
| 153 |
const [params, setParams] = useSearchParams();
|
| 154 |
const tab = params.get('tab') ?? 'ai';
|
|
|
|
| 155 |
return (
|
| 156 |
<Stack gap="md">
|
| 157 |
<PageHeader crumbs={[]} title="Settings" />
|
| 158 |
-
<Tabs value={tab} onChange={(t) => setParams(t ? { tab: t } : {})} keepMounted={false} variant="pills"
|
| 159 |
<Tabs.List>{TABS.map(([v, label]) => <Tabs.Tab key={v} value={v}>{label}</Tabs.Tab>)}</Tabs.List>
|
| 160 |
<Tabs.Panel value="ai" pt="md"><AIModelsTab /></Tabs.Panel>
|
| 161 |
<Tabs.Panel value="users" pt="md" className="fpt-embedded"><UsersPage /></Tabs.Panel>
|
|
|
|
| 1 |
+
import { Button, Group, PasswordInput, SegmentedControl, Select, Stack, Table, Tabs, Text, TextInput } from '@mantine/core';
|
| 2 |
import { IconAdjustments, IconBooks, IconBrain, IconCircleCheck, IconCircleX, IconPlugConnected, IconRobot, IconShieldCheck, IconWand } from '@tabler/icons-react';
|
| 3 |
import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query';
|
| 4 |
import { useEffect, useState, type ReactNode } from 'react';
|
| 5 |
import { Link, useSearchParams } from 'react-router-dom';
|
| 6 |
import { api, getJson, unwrap } from '../api/client';
|
| 7 |
+
import { useMediaQuery } from '@mantine/hooks';
|
| 8 |
+
import { AGENTS, ENGINE_WORDS, stepName, type Engine } from '../agents';
|
| 9 |
+
import { ErrorAlert, PageHeader } from '../components/common';
|
| 10 |
import { AutonomyPage, KillSwitchPage, SchedulerPage, UsersPage } from './AdminPages';
|
| 11 |
|
| 12 |
interface LLMView {
|
|
|
|
| 26 |
function TestLine({ r }: { r: TestResult | null }) {
|
| 27 |
if (!r) return null;
|
| 28 |
return (
|
| 29 |
+
<Text size="sm" className="fpt-podtest" data-ok={r.ok} data-testid="llm-test-result" role="status">
|
| 30 |
+
{r.ok ? <IconCircleCheck size={15} aria-hidden /> : <IconCircleX size={15} aria-hidden />}{r.detail}{r.ok && r.model ? ` Model: ${r.model}.` : ''}
|
| 31 |
+
</Text>
|
| 32 |
);
|
| 33 |
}
|
| 34 |
|
|
|
|
| 62 |
|
| 63 |
return (
|
| 64 |
<Stack gap="md" aria-label="AI models">
|
| 65 |
+
<div>
|
| 66 |
+
<Text size="sm" fw={600}>Which AI models does the co-worker use?</Text>
|
| 67 |
<Text size="sm" c="dimmed">
|
| 68 |
It works without any AI model, using built-in rules. Connecting models makes its research, scenario choice and explanations better.
|
| 69 |
Your business data never leaves your environment: only the <b>local</b> model sees it. The <b>external</b> model only ever receives public
|
|
|
|
| 74 |
|
| 75 |
<div className="fpt-cols">
|
| 76 |
<section className="fpt-card" style={{ padding: 16, flex: '1 1 380px' }} aria-label="Local model">
|
| 77 |
+
<Group justify="space-between" mb="xs"><Text fw={600}>Local model</Text><span className="fpt-dimtext" data-testid="llm-local-active">Now: {v?.active.local ?? '…'}</span></Group>
|
| 78 |
<Text size="xs" c="dimmed" mb="sm">Runs inside your environment (Ollama). Used for failure analysis, self-heal, data planning, script writing and chat.</Text>
|
| 79 |
<Stack gap="sm">
|
| 80 |
<SegmentedControl aria-label="Local model" value={local.mode} onChange={(m) => setLocal((s) => ({ ...s, mode: m as 'stub' | 'ollama' }))}
|
| 81 |
+
data={[{ value: 'stub', label: 'Built-in rules (no AI)' }, { value: 'ollama', label: 'Ollama model' }]} />
|
| 82 |
{local.mode === 'ollama' && (
|
| 83 |
<>
|
| 84 |
<TextInput label="Ollama address" description={`Must be on this server or an approved internal host (${(v?.local.allowed_hosts ?? []).join(', ')}).`}
|
|
|
|
| 88 |
</>
|
| 89 |
)}
|
| 90 |
<Group gap="xs">
|
| 91 |
+
<Button variant="filled" onClick={() => save.mutate({ llm_local: local.mode, ...(local.mode === 'ollama' ? { ollama_url: local.url, ollama_model: local.model } : {}) })} loading={save.isPending}>Save local model</Button>
|
| 92 |
<Button variant="default" leftSection={<IconPlugConnected size={13} />} onClick={() => test.mutate('local')} loading={test.isPending && test.variables === 'local'}>Test</Button>
|
| 93 |
</Group>
|
| 94 |
<TestLine r={tests.local} />
|
|
|
|
| 96 |
</section>
|
| 97 |
|
| 98 |
<section className="fpt-card" style={{ padding: 16, flex: '1 1 380px' }} aria-label="External model">
|
| 99 |
+
<Group justify="space-between" mb="xs"><Text fw={600}>External model <Text span size="xs" c="dimmed">(optional)</Text></Text><span className="fpt-dimtext" data-testid="llm-external-active">Now: {v?.active.external ?? '…'}</span></Group>
|
| 100 |
<Text size="xs" c="dimmed" mb="sm">A hosted model for reading public release notes and writing summaries. It never receives client data.</Text>
|
| 101 |
<Stack gap="sm">
|
| 102 |
<SegmentedControl aria-label="External model" value={ext.mode} onChange={(m) => setExt((s) => ({ ...s, mode: m as 'off' | 'frontier' }))}
|
| 103 |
+
data={[{ value: 'off', label: 'Off' }, { value: 'frontier', label: 'On' }]} />
|
| 104 |
{ext.mode === 'frontier' && (
|
| 105 |
<>
|
| 106 |
<Select label="Provider" data={PROVIDERS} value={provider} allowDeselect={false}
|
|
|
|
| 114 |
<Button variant="default" leftSection={<IconPlugConnected size={13} />} onClick={() => test.mutate('external')} loading={test.isPending && test.variables === 'external'}>Test</Button>
|
| 115 |
</Group>
|
| 116 |
<div>
|
| 117 |
+
<Group gap={6} mb={4}><Text size="sm" fw={600}>API key</Text><span className="fpt-dotword" data-tone={v?.external.key_set ? 'green' : 'neutral'} data-testid="llm-key-state">{v?.external.key_set ? 'saved' : 'not set'}</span></Group>
|
| 118 |
<Group gap="xs" align="flex-end">
|
| 119 |
<PasswordInput aria-label="API key" placeholder={v?.external.key_set ? 'enter a new key to replace it' : 'paste the key'} value={key} onChange={(e) => setKey(e.currentTarget.value)}
|
| 120 |
autoComplete="new-password" style={{ flex: 1, minWidth: 180 }} />
|
|
|
|
| 128 |
</section>
|
| 129 |
</div>
|
| 130 |
|
| 131 |
+
<section className="fpt-card" style={{ padding: 16 }} aria-label="Which agent uses which model">
|
| 132 |
+
<Text fw={600} mb={2}>Which agent uses which model</Text>
|
| 133 |
+
<Text size="xs" c="dimmed" mb={8}>What each agent is designed to use, and what serves it now. A run's own team board says what actually ran.</Text>
|
| 134 |
+
<Table.ScrollContainer minWidth={620}>
|
| 135 |
+
<Table fz="sm" verticalSpacing={6} className="fpt-table">
|
| 136 |
+
<Table.Thead><Table.Tr><Table.Th>Agent</Table.Th><Table.Th>Job</Table.Th><Table.Th>Uses</Table.Th><Table.Th>Data it sees</Table.Th></Table.Tr></Table.Thead>
|
| 137 |
+
<Table.Tbody>{AGENTS.map((a) => (
|
| 138 |
+
<Table.Tr key={a.node}><Table.Td style={{ whiteSpace: 'nowrap' }}>{stepName(a.node)}</Table.Td><Table.Td>{a.job}</Table.Td>
|
| 139 |
+
<Table.Td>{usesNow(a.engine, v)}</Table.Td><Table.Td>{DATA_SEEN[a.engine]}</Table.Td></Table.Tr>
|
| 140 |
+
))}</Table.Tbody>
|
| 141 |
+
</Table>
|
| 142 |
+
</Table.ScrollContainer>
|
| 143 |
+
</section>
|
| 144 |
+
|
| 145 |
<section className="fpt-card" style={{ padding: 16 }} aria-label="What goes where">
|
| 146 |
+
<Text fw={600} mb={6}>What goes where</Text>
|
| 147 |
+
<Table fz="sm" verticalSpacing={6} className="fpt-table">
|
| 148 |
<Table.Thead><Table.Tr><Table.Th>Work</Table.Th><Table.Th>Data it sees</Table.Th><Table.Th>Answered by</Table.Th></Table.Tr></Table.Thead>
|
| 149 |
<Table.Tbody>{(v?.routing ?? []).map((r) => <Table.Tr key={r.work}><Table.Td>{r.work}</Table.Td><Table.Td>{r.data}</Table.Td><Table.Td>{r.goes_to}</Table.Td></Table.Tr>)}</Table.Tbody>
|
| 150 |
</Table>
|
|
|
|
| 153 |
);
|
| 154 |
}
|
| 155 |
|
| 156 |
+
const DATA_SEEN: Record<Engine, string> = {
|
| 157 |
+
deterministic: 'Runs inside the co-worker; no AI model sees anything.',
|
| 158 |
+
local: 'Client data, inside your environment only.',
|
| 159 |
+
frontier: 'Public release notes or redacted numbers only.',
|
| 160 |
+
human: 'Whatever you look at in the app.',
|
| 161 |
+
};
|
| 162 |
+
/** "Uses": the engine an agent is designed for, with what serves that engine now (from the settings). */
|
| 163 |
+
function usesNow(e: Engine, v?: LLMView): string {
|
| 164 |
+
const now = e === 'local' ? v?.active.local : e === 'frontier' ? v?.active.external : null;
|
| 165 |
+
if (e !== 'local' && e !== 'frontier') return ENGINE_WORDS[e];
|
| 166 |
+
if (!v) return ENGINE_WORDS[e];
|
| 167 |
+
// honest: with no model connected, the built-in rules do this work
|
| 168 |
+
return !now || now === 'off' || now === 'built-in rules' ? `Built-in rules now (${ENGINE_WORDS[e]} not connected)` : `${ENGINE_WORDS[e]}: ${now}`;
|
| 169 |
+
}
|
| 170 |
+
|
| 171 |
function AdvCard({ to, icon, title, body }: { to: string; icon: ReactNode; title: string; body: string }) {
|
| 172 |
return (
|
| 173 |
<Link to={to} className="fpt-card fpt-tile" style={{ flex: '1 1 240px' }}>
|
| 174 |
<span className="fpt-iconbtn" style={{ width: 34, height: 34, borderRadius: 10 }} aria-hidden>{icon}</span>
|
| 175 |
+
<span><Text size="sm" fw={600}>{title}</Text><Text size="xs" c="dimmed">{body}</Text></span>
|
| 176 |
</Link>
|
| 177 |
);
|
| 178 |
}
|
|
|
|
| 183 |
export function SettingsPage() {
|
| 184 |
const [params, setParams] = useSearchParams();
|
| 185 |
const tab = params.get('tab') ?? 'ai';
|
| 186 |
+
const wide = useMediaQuery('(min-width: 1024px)');
|
| 187 |
return (
|
| 188 |
<Stack gap="md">
|
| 189 |
<PageHeader crumbs={[]} title="Settings" />
|
| 190 |
+
<Tabs value={tab} onChange={(t) => setParams(t ? { tab: t } : {})} keepMounted={false} variant="pills" orientation={wide ? 'vertical' : 'horizontal'} className="fpt-settings-tabs">
|
| 191 |
<Tabs.List>{TABS.map(([v, label]) => <Tabs.Tab key={v} value={v}>{label}</Tabs.Tab>)}</Tabs.List>
|
| 192 |
<Tabs.Panel value="ai" pt="md"><AIModelsTab /></Tabs.Panel>
|
| 193 |
<Tabs.Panel value="users" pt="md" className="fpt-embedded"><UsersPage /></Tabs.Panel>
|
web/src/pages/SignOffReport.tsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
| 1 |
import { Accordion, Alert, Anchor, Button, CopyButton, Group, Menu, Stack, Table, Text, Textarea } from '@mantine/core';
|
| 2 |
import { IconCheck, IconChevronDown, IconDownload, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconSignature } from '@tabler/icons-react';
|
| 3 |
-
import { useEffect, useState } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
import { useReport, useRun, useRunReadiness, useSignOff, useTickets } from '../api/hooks';
|
| 7 |
-
import { Can, DecisionBadge, ErrorAlert, fmtTs,
|
| 8 |
import { shortWhen } from '../runName';
|
| 9 |
import { scriptUrl } from './RunGuide';
|
| 10 |
import { DECISION_WORDS } from '../glossary';
|
|
@@ -35,6 +35,13 @@ export function SignOffReport({ id }: { id: string }) {
|
|
| 35 |
const tickets = useTickets(id);
|
| 36 |
const sign = useSignOff(id);
|
| 37 |
const [comment, setComment] = useState('');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 38 |
const r = run.data;
|
| 39 |
const mods = rd.data?.modules ?? [];
|
| 40 |
const decisions = rep.data?.decisions ?? {};
|
|
@@ -54,13 +61,16 @@ export function SignOffReport({ id }: { id: string }) {
|
|
| 54 |
const fusionTarget = !!rep.data?.target?.startsWith('Oracle Fusion');
|
| 55 |
return (
|
| 56 |
<Stack gap="md" className="fpt-report">
|
| 57 |
-
{Object.entries(decisions).map(([m, d]) => {
|
| 58 |
const crit = rep.data?.criteria?.[m] ?? {};
|
| 59 |
return (
|
| 60 |
<section key={m} className="fpt-card" style={{ padding: 16 }} aria-label={`decision ${m}`}>
|
| 61 |
<Group justify="space-between" wrap="wrap">
|
| 62 |
<Group gap={8}><Text fw={600}>{MODULE_NAMES[m] ?? m}</Text><DecisionBadge decision={d} size="lg" /></Group>
|
| 63 |
<Group gap={6}>
|
|
|
|
|
|
|
|
|
|
| 64 |
{rep.data?.files?.[m]?.pdf && (
|
| 65 |
<Button component="a" href={`/api/runs/${encodeURIComponent(id)}/report/${m}/pdf`} download variant="default" size="xs" leftSection={<IconFileTypePdf size={13} />} data-testid="pdf-link">Download PDF</Button>
|
| 66 |
)}
|
|
@@ -98,12 +108,12 @@ export function SignOffReport({ id }: { id: string }) {
|
|
| 98 |
<Text fw={600} mb={6}>Results by business process</Text>
|
| 99 |
<Table.ScrollContainer minWidth={560}>
|
| 100 |
<Table aria-label="process summary" data-testid="process-summary" fz="sm">
|
| 101 |
-
<Table.Thead><Table.Tr><Table.Th>Process step</Table.Th><Table.Th>Scenarios</Table.Th><Table.Th>Passed</Table.Th><Table.Th>Failed</Table.Th><Table.Th>Not run</Table.Th>{patchCol && <Table.Th
|
| 102 |
<Table.Tbody>
|
| 103 |
{mods.flatMap((m) => m.steps.filter((s) => s.scenarios > 0 || s.state === 'gap').map((s) => (
|
| 104 |
<Table.Tr key={`${m.module}-${s.key}`}>
|
| 105 |
-
<Table.Td>{mods.length > 1 ? `${m.module}
|
| 106 |
-
<Table.Td>{s.scenarios}</Table.Td><Table.Td>{s.passed + s.flaky}</Table.Td><Table.Td>{s.failed}</Table.Td><Table.Td>{s.not_run}</Table.Td>
|
| 107 |
{patchCol && <Table.Td>{s.touched ? 'yes' : 'no'}</Table.Td>}
|
| 108 |
</Table.Tr>
|
| 109 |
)))}
|
|
@@ -115,7 +125,7 @@ export function SignOffReport({ id }: { id: string }) {
|
|
| 115 |
<section className="fpt-card" style={{ padding: 16 }}>
|
| 116 |
<Text fw={600} mb={6}>Open defects</Text>
|
| 117 |
{(tickets.data?.items ?? []).length === 0 ? <Text size="sm" c="dimmed">No defects raised in this test run.</Text> : (
|
| 118 |
-
<Stack gap={4}>{tickets.data!.items.map((t) => <Text key={t.ticket_id} size="sm"><Anchor component={Link} to="/tickets">{t.ticket_id}</Anchor>
|
| 119 |
)}
|
| 120 |
</section>
|
| 121 |
|
|
@@ -129,14 +139,14 @@ export function SignOffReport({ id }: { id: string }) {
|
|
| 129 |
</Stack>
|
| 130 |
</section>
|
| 131 |
|
| 132 |
-
<section className="fpt-card" style={{ padding: 16 }} aria-label="sign-off">
|
| 133 |
<Text fw={600} mb={6}><IconSignature size={15} style={{ verticalAlign: -2 }} /> Sign-off</Text>
|
| 134 |
{signed ? (
|
| 135 |
-
<Text size="sm" data-testid="signoff" className="fpt-signed" title={fmtTs(signed.at)}><IconCheck size={14} style={{ verticalAlign: -2 }} aria-hidden /> Signed off by <b>{signed.by}</b> on {shortWhen(signed.at)}{signed.comment ? `
|
| 136 |
) : (
|
| 137 |
<Can perm="run.signoff" fallback={<Text size="sm" c="dimmed">Not signed off yet. A QA approver signs off finished test runs.</Text>}>
|
| 138 |
<Text size="xs" c="dimmed" mb={6}>Signing off records who reviewed this report and when (audit log). It does not change the decision.</Text>
|
| 139 |
-
<Textarea size="xs" aria-label="sign-off comment" placeholder="Comment (optional)" value={comment} onChange={(e) => setComment(e.currentTarget.value)} autosize minRows={1} />
|
| 140 |
<Group mt={6}><Button onClick={() => sign.mutate(comment)} loading={sign.isPending} leftSection={<IconSignature size={13} />}>Sign off this report</Button></Group>
|
| 141 |
<ErrorAlert error={sign.error} />
|
| 142 |
</Can>
|
|
|
|
| 1 |
import { Accordion, Alert, Anchor, Button, CopyButton, Group, Menu, Stack, Table, Text, Textarea } from '@mantine/core';
|
| 2 |
import { IconCheck, IconChevronDown, IconDownload, IconFileSpreadsheet, IconFileTypePdf, IconLink, IconSignature } from '@tabler/icons-react';
|
| 3 |
+
import { useEffect, useRef, useState } from 'react';
|
| 4 |
import { Link } from 'react-router-dom';
|
| 5 |
import { MODULE_NAMES } from '../agents';
|
| 6 |
import { useReport, useRun, useRunReadiness, useSignOff, useTickets } from '../api/hooks';
|
| 7 |
+
import { Can, DecisionBadge, ErrorAlert, fmtTs, RuleResult } from '../components/common';
|
| 8 |
import { shortWhen } from '../runName';
|
| 9 |
import { scriptUrl } from './RunGuide';
|
| 10 |
import { DECISION_WORDS } from '../glossary';
|
|
|
|
| 35 |
const tickets = useTickets(id);
|
| 36 |
const sign = useSignOff(id);
|
| 37 |
const [comment, setComment] = useState('');
|
| 38 |
+
const signRef = useRef<HTMLElement>(null);
|
| 39 |
+
const commentRef = useRef<HTMLTextAreaElement>(null);
|
| 40 |
+
// "Go to sign-off": scroll to the sign-off form and put the cursor in its comment (one accent action in the header)
|
| 41 |
+
const goToSignOff = () => {
|
| 42 |
+
signRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' });
|
| 43 |
+
window.setTimeout(() => commentRef.current?.focus({ preventScroll: true }), 300);
|
| 44 |
+
};
|
| 45 |
const r = run.data;
|
| 46 |
const mods = rd.data?.modules ?? [];
|
| 47 |
const decisions = rep.data?.decisions ?? {};
|
|
|
|
| 61 |
const fusionTarget = !!rep.data?.target?.startsWith('Oracle Fusion');
|
| 62 |
return (
|
| 63 |
<Stack gap="md" className="fpt-report">
|
| 64 |
+
{Object.entries(decisions).map(([m, d], idx) => {
|
| 65 |
const crit = rep.data?.criteria?.[m] ?? {};
|
| 66 |
return (
|
| 67 |
<section key={m} className="fpt-card" style={{ padding: 16 }} aria-label={`decision ${m}`}>
|
| 68 |
<Group justify="space-between" wrap="wrap">
|
| 69 |
<Group gap={8}><Text fw={600}>{MODULE_NAMES[m] ?? m}</Text><DecisionBadge decision={d} size="lg" /></Group>
|
| 70 |
<Group gap={6}>
|
| 71 |
+
{idx === 0 && !signed && (
|
| 72 |
+
<Can perm="run.signoff"><Button size="xs" variant="filled" leftSection={<IconSignature size={13} />} onClick={goToSignOff}>Go to sign-off</Button></Can>
|
| 73 |
+
)}
|
| 74 |
{rep.data?.files?.[m]?.pdf && (
|
| 75 |
<Button component="a" href={`/api/runs/${encodeURIComponent(id)}/report/${m}/pdf`} download variant="default" size="xs" leftSection={<IconFileTypePdf size={13} />} data-testid="pdf-link">Download PDF</Button>
|
| 76 |
)}
|
|
|
|
| 108 |
<Text fw={600} mb={6}>Results by business process</Text>
|
| 109 |
<Table.ScrollContainer minWidth={560}>
|
| 110 |
<Table aria-label="process summary" data-testid="process-summary" fz="sm">
|
| 111 |
+
<Table.Thead><Table.Tr><Table.Th>Process step</Table.Th><Table.Th>Scenarios</Table.Th><Table.Th>Passed</Table.Th><Table.Th>Failed</Table.Th><Table.Th style={{ whiteSpace: 'nowrap' }}>Not run</Table.Th>{patchCol && <Table.Th title="Changed by this patch" style={{ whiteSpace: 'nowrap' }}>In patch</Table.Th>}</Table.Tr></Table.Thead>
|
| 112 |
<Table.Tbody>
|
| 113 |
{mods.flatMap((m) => m.steps.filter((s) => s.scenarios > 0 || s.state === 'gap').map((s) => (
|
| 114 |
<Table.Tr key={`${m.module}-${s.key}`}>
|
| 115 |
+
<Table.Td>{mods.length > 1 ? `${m.module}: ` : ''}{s.name}</Table.Td>
|
| 116 |
+
<Table.Td>{s.state === 'gap' && s.scenarios === 0 ? <span className="fpt-nocov">No scenario</span> : s.scenarios}</Table.Td><Table.Td>{s.passed + s.flaky}</Table.Td><Table.Td>{s.failed}</Table.Td><Table.Td>{s.not_run}</Table.Td>
|
| 117 |
{patchCol && <Table.Td>{s.touched ? 'yes' : 'no'}</Table.Td>}
|
| 118 |
</Table.Tr>
|
| 119 |
)))}
|
|
|
|
| 125 |
<section className="fpt-card" style={{ padding: 16 }}>
|
| 126 |
<Text fw={600} mb={6}>Open defects</Text>
|
| 127 |
{(tickets.data?.items ?? []).length === 0 ? <Text size="sm" c="dimmed">No defects raised in this test run.</Text> : (
|
| 128 |
+
<Stack gap={4}>{tickets.data!.items.map((t) => <Text key={t.ticket_id} size="sm"><Anchor component={Link} to="/tickets">{t.ticket_id}</Anchor>, scenario {t.case_id}: {t.status}</Text>)}</Stack>
|
| 129 |
)}
|
| 130 |
</section>
|
| 131 |
|
|
|
|
| 139 |
</Stack>
|
| 140 |
</section>
|
| 141 |
|
| 142 |
+
<section className="fpt-card" style={{ padding: 16, scrollMarginTop: 80 }} aria-label="sign-off" ref={signRef}>
|
| 143 |
<Text fw={600} mb={6}><IconSignature size={15} style={{ verticalAlign: -2 }} /> Sign-off</Text>
|
| 144 |
{signed ? (
|
| 145 |
+
<Text size="sm" data-testid="signoff" className="fpt-signed" title={fmtTs(signed.at)}><IconCheck size={14} style={{ verticalAlign: -2 }} aria-hidden /> Signed off by <b>{signed.by}</b> on {shortWhen(signed.at)}{signed.comment ? `, with the comment “${signed.comment}”` : ''}. Decision at sign-off: {Object.entries(signed.decisions).map(([m, d]) => `${MODULE_NAMES[m] ?? m} ${DECISION_WORDS[d] ?? d}`).join(', ')}.</Text>
|
| 146 |
) : (
|
| 147 |
<Can perm="run.signoff" fallback={<Text size="sm" c="dimmed">Not signed off yet. A QA approver signs off finished test runs.</Text>}>
|
| 148 |
<Text size="xs" c="dimmed" mb={6}>Signing off records who reviewed this report and when (audit log). It does not change the decision.</Text>
|
| 149 |
+
<Textarea ref={commentRef} size="xs" aria-label="sign-off comment" placeholder="Comment (optional)" value={comment} onChange={(e) => setComment(e.currentTarget.value)} autosize minRows={1} />
|
| 150 |
<Group mt={6}><Button onClick={() => sign.mutate(comment)} loading={sign.isPending} leftSection={<IconSignature size={13} />}>Sign off this report</Button></Group>
|
| 151 |
<ErrorAlert error={sign.error} />
|
| 152 |
</Can>
|
web/src/pages/StartRunWizard.tsx
CHANGED
|
@@ -78,7 +78,7 @@ export function StartRunForm({ initialModules = ['P2P'] }: { initialModules?: st
|
|
| 78 |
<UnstyledButton key={p.id} onClick={() => p.runnable && setPodId(p.id)} aria-pressed={podId === p.id} disabled={!p.runnable}
|
| 79 |
className="fpt-card" style={{ padding: 12, opacity: p.runnable ? 1 : 0.6, borderColor: podId === p.id ? 'var(--fpt-ink)' : undefined, cursor: p.runnable ? 'pointer' : 'not-allowed' }}>
|
| 80 |
<Group justify="space-between" wrap="nowrap">
|
| 81 |
-
<Group gap={8} wrap="nowrap"><IconServer size={16} /><div><Text size="sm" fw={
|
| 82 |
{podId === p.id ? <Pill tone="green" icon={<IconCheck size={11} />}>selected</Pill> : p.runnable ? <Pill>available</Pill> : <Pill tone="amber">not available</Pill>}
|
| 83 |
</Group>
|
| 84 |
{!p.runnable && <Text size="xs" c="dimmed" mt={4}>{p.not_runnable_reason}</Text>}
|
|
@@ -132,7 +132,7 @@ export function StartRunForm({ initialModules = ['P2P'] }: { initialModules?: st
|
|
| 132 |
</Stepper.Step>
|
| 133 |
<Stepper.Completed>
|
| 134 |
<Stack gap={6}>
|
| 135 |
-
<Text size="sm" fw={
|
| 136 |
<Text size="sm"><b>Environment:</b> {pod?.name}</Text>
|
| 137 |
<Text size="sm"><b>Business areas:</b> {modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}</Text>
|
| 138 |
<Text size="sm"><b>Run type:</b> {mode === 'stub' ? 'Quick simulation' : 'Full browser run'}{p2 ? ', including P2 tests' : ''}</Text>
|
|
@@ -145,8 +145,8 @@ export function StartRunForm({ initialModules = ['P2P'] }: { initialModules?: st
|
|
| 145 |
<Group justify="space-between">
|
| 146 |
<Button variant="default" onClick={() => setStep((s) => s - 1)} disabled={step === 0}>Back</Button>
|
| 147 |
{step < 3
|
| 148 |
-
? <Button onClick={() => setStep((s) => s + 1)} disabled={!canNext}>Next</Button>
|
| 149 |
-
: <Button onClick={() => void submit()} loading={start.isPending} disabled={kill.data?.engaged || !pod?.runnable || !modules.length} rightSection={<IconPlayerPlay size={13} />}>Start run</Button>}
|
| 150 |
</Group>
|
| 151 |
</Stack>
|
| 152 |
);
|
|
|
|
| 78 |
<UnstyledButton key={p.id} onClick={() => p.runnable && setPodId(p.id)} aria-pressed={podId === p.id} disabled={!p.runnable}
|
| 79 |
className="fpt-card" style={{ padding: 12, opacity: p.runnable ? 1 : 0.6, borderColor: podId === p.id ? 'var(--fpt-ink)' : undefined, cursor: p.runnable ? 'pointer' : 'not-allowed' }}>
|
| 80 |
<Group justify="space-between" wrap="nowrap">
|
| 81 |
+
<Group gap={8} wrap="nowrap"><IconServer size={16} /><div><Text size="sm" fw={600}>{p.name}</Text><Text size="xs" c="dimmed">{p.base_url}</Text></div></Group>
|
| 82 |
{podId === p.id ? <Pill tone="green" icon={<IconCheck size={11} />}>selected</Pill> : p.runnable ? <Pill>available</Pill> : <Pill tone="amber">not available</Pill>}
|
| 83 |
</Group>
|
| 84 |
{!p.runnable && <Text size="xs" c="dimmed" mt={4}>{p.not_runnable_reason}</Text>}
|
|
|
|
| 132 |
</Stepper.Step>
|
| 133 |
<Stepper.Completed>
|
| 134 |
<Stack gap={6}>
|
| 135 |
+
<Text size="sm" fw={600}>Ready to start</Text>
|
| 136 |
<Text size="sm"><b>Environment:</b> {pod?.name}</Text>
|
| 137 |
<Text size="sm"><b>Business areas:</b> {modules.map((m) => MODULE_NAMES[m] ?? m).join(', ')}</Text>
|
| 138 |
<Text size="sm"><b>Run type:</b> {mode === 'stub' ? 'Quick simulation' : 'Full browser run'}{p2 ? ', including P2 tests' : ''}</Text>
|
|
|
|
| 145 |
<Group justify="space-between">
|
| 146 |
<Button variant="default" onClick={() => setStep((s) => s - 1)} disabled={step === 0}>Back</Button>
|
| 147 |
{step < 3
|
| 148 |
+
? <Button variant="filled" onClick={() => setStep((s) => s + 1)} disabled={!canNext}>Next</Button>
|
| 149 |
+
: <Button variant="filled" onClick={() => void submit()} loading={start.isPending} disabled={kill.data?.engaged || !pod?.runnable || !modules.length} rightSection={<IconPlayerPlay size={13} />}>Start run</Button>}
|
| 150 |
</Group>
|
| 151 |
</Stack>
|
| 152 |
);
|
web/src/pages/TeamBoard.tsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
import { Button, Drawer,
|
| 2 |
import {
|
| 3 |
IconAlertTriangle, IconCircleCheck, IconCircleDashed, IconCircleMinus, IconCircleX, IconLoader2, IconPlayerPause, IconPlayerPlay, IconRepeat, IconRobot, IconUserCheck,
|
| 4 |
} from '@tabler/icons-react';
|
|
@@ -119,15 +119,15 @@ export function AgentCard({ agent, state, lastEvent, startedAt, finishedAt, ms,
|
|
| 119 |
: stoppedHere === 'cancelled' ? 'It was working when the test run was cancelled.'
|
| 120 |
: state === 'error' ? (stoppedHere ? 'It was working when the test run stopped.' : errorText ? (agent.node === 'executor' ? 'The test browser stopped without saving results.' : 'This step stopped with an error.') : 'This step stopped with an error.') : NOW_WORDS[agent.node] ?? agent.job;
|
| 121 |
const foot = staticMode ? null
|
| 122 |
-
: state === 'done' && finishedAt ? `
|
| 123 |
-
: state === 'running' && startedAt ? `
|
| 124 |
-
: state === 'waiting' && startedAt ? `
|
| 125 |
const body = (
|
| 126 |
<>
|
| 127 |
<div className="fpt-agent-top">
|
| 128 |
<span className="fpt-agent-avatar" data-tone={engine ? KIND_TONE[engine.kind] : staticMode ? KIND_TONE[DESIGN_KIND[agent.engine]] : 'neutral'} data-known={!!engine || staticMode || undefined} aria-hidden>{avatarText(name)}</span>
|
| 129 |
<span className="fpt-agent-name">{name}</span>
|
| 130 |
-
{human && <span className="fpt-
|
| 131 |
</div>
|
| 132 |
<div className="fpt-agent-line">{line}</div>
|
| 133 |
{!staticMode && (
|
|
@@ -137,8 +137,8 @@ export function AgentCard({ agent, state, lastEvent, startedAt, finishedAt, ms,
|
|
| 137 |
<div className="fpt-agent-foot fpt-agent-foot-static"><span>Designed for: {ENGINE_WORDS[agent.engine]}</span>{now && <span className="fpt-agent-now">{now}</span>}</div>
|
| 138 |
) : (foot || engine) ? (
|
| 139 |
<div className="fpt-agent-foot" title={engine?.detail ?? (engine ? undefined : `Can use: ${ENGINE_WORDS[agent.engine]}`)}>
|
| 140 |
-
{foot
|
| 141 |
-
{engine
|
| 142 |
</div>
|
| 143 |
) : (
|
| 144 |
<div className="fpt-agent-foot" title={`Can use: ${ENGINE_WORDS[agent.engine]}`}><span className="fpt-sr-only">Can use: {ENGINE_WORDS[agent.engine]}</span></div>
|
|
@@ -180,43 +180,42 @@ export function CoordinatorCard({ runId, states, status, gate, error, silent, st
|
|
| 180 |
if (status === 'completed') {
|
| 181 |
tone = 'green';
|
| 182 |
const ms = startedAt && endedAt ? new Date(endedAt).getTime() - new Date(startedAt).getTime() : 0;
|
| 183 |
-
line = `All steps finished${ms > 0 ? ` in ${duration(ms)}` : ''}.${decision ? ` Result: ${decisionWords(decision)}.` : ''}`;
|
| 184 |
} else if (status === 'interrupted') {
|
| 185 |
tone = 'amber';
|
| 186 |
line = 'This test run is paused. Carry on from where it stopped.';
|
| 187 |
-
act = <Can perm="run.control"><Button size="xs" leftSection={<IconPlayerPlay size={12} />} loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'resume' })}>Resume</Button></Can>;
|
| 188 |
} else if (status === 'cancelled') {
|
| 189 |
tone = 'neutral';
|
| 190 |
line = 'This test run was cancelled.';
|
| 191 |
} else if (TERMINAL.includes(status)) {
|
| 192 |
tone = 'red';
|
| 193 |
line = `This test run stopped: ${error ?? (status === 'cancelled' ? 'it was cancelled' : status === 'killed' ? 'the emergency stop was used' : status === 'interrupted' ? 'it was paused' : 'an error')}.`;
|
| 194 |
-
if (['failed', 'interrupted'].includes(status)) act = <Can perm="run.control"><Button size="xs" leftSection={<IconPlayerPlay size={12} />} loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'resume' })}>Resume</Button></Can>;
|
| 195 |
} else if (gate === 'approve_cases' || gate === 'human_review') {
|
| 196 |
tone = 'amber';
|
| 197 |
line = gate === 'approve_cases' ? 'Waiting for you: approve the scenarios.' : 'Waiting for you: decide on the failed scenarios.';
|
| 198 |
act = gate === 'approve_cases'
|
| 199 |
-
? <Can perm="gate.approve_cases"><Button size="xs" component={Link} to={`/runs/${runId}/scenarios`}>Open scenario review</Button></Can>
|
| 200 |
-
: <Can perm="gate.human_review"><Button size="xs" component={Link} to={`/runs/${runId}/failures`}>Open failure review</Button></Can>;
|
| 201 |
} else if (silent) {
|
| 202 |
tone = 'amber';
|
| 203 |
line = `${stepName(silent.node)} has been quiet for ${Math.max(1, Math.round(silent.ms / 60_000))} min. ${quick ? 'A quick simulation usually moves faster.' : 'It may be waiting on the test environment.'}`;
|
| 204 |
act = <Can perm="run.control"><Button size="xs" color="red" variant="light" loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'cancel', reason: 'cancelled from the team board (an agent went quiet)' })}>Cancel test run</Button></Can>;
|
| 205 |
} else {
|
| 206 |
tone = 'blue';
|
| 207 |
-
line = started ? 'The team is working. You will be asked when your review is needed.' : 'Starting the agents
|
| 208 |
}
|
| 209 |
return (
|
| 210 |
<section className="fpt-coord" data-tone={tone} aria-label="Coordinator">
|
| 211 |
<span className="fpt-agent-avatar" data-tone="neutral" aria-hidden><IconRobot size={16} /></span>
|
| 212 |
<div style={{ flex: '1 1 260px', minWidth: 0 }}>
|
| 213 |
-
<
|
| 214 |
-
|
| 215 |
-
<
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
{aiOnRun(llmCalls)}{can('admin') && <> · <Link to="/admin?tab=ai">AI models</Link></>}
|
| 220 |
</Text>
|
| 221 |
<ErrorAlert error={action.error} />
|
| 222 |
</div>
|
|
@@ -320,7 +319,7 @@ export function TeamBoardView({ runId, status, gate, error, events, quick, loadi
|
|
| 320 |
const ps = phaseState(p.nodes);
|
| 321 |
return (
|
| 322 |
<section key={p.phase} className="fpt-board-phase" data-state={ps} role="listitem" aria-label={`${PHASE_WORDS[p.phase] ?? p.phase}: ${STATE_WORDS[ps]}`}>
|
| 323 |
-
<header><
|
| 324 |
<div role="list" aria-label={`Agents in ${PHASE_WORDS[p.phase] ?? p.phase}`} className="fpt-board-cards">{p.nodes.map(card)}</div>
|
| 325 |
{p.phase === 'Execute' && <div className="fpt-flow-note"><IconRepeat size={13} aria-hidden />A failed scenario is tried once more</div>}
|
| 326 |
</section>
|
|
|
|
| 1 |
+
import { Button, Drawer, Popover, Skeleton, Stack, Text, UnstyledButton } from '@mantine/core';
|
| 2 |
import {
|
| 3 |
IconAlertTriangle, IconCircleCheck, IconCircleDashed, IconCircleMinus, IconCircleX, IconLoader2, IconPlayerPause, IconPlayerPlay, IconRepeat, IconRobot, IconUserCheck,
|
| 4 |
} from '@tabler/icons-react';
|
|
|
|
| 119 |
: stoppedHere === 'cancelled' ? 'It was working when the test run was cancelled.'
|
| 120 |
: state === 'error' ? (stoppedHere ? 'It was working when the test run stopped.' : errorText ? (agent.node === 'executor' ? 'The test browser stopped without saving results.' : 'This step stopped with an error.') : 'This step stopped with an error.') : NOW_WORDS[agent.node] ?? agent.job;
|
| 121 |
const foot = staticMode ? null
|
| 122 |
+
: state === 'done' && finishedAt ? `Took ${duration(ms ?? 0)}`
|
| 123 |
+
: state === 'running' && startedAt ? `Started ${hhmm(startedAt)}`
|
| 124 |
+
: state === 'waiting' && startedAt ? `Since ${hhmm(startedAt)}` : null;
|
| 125 |
const body = (
|
| 126 |
<>
|
| 127 |
<div className="fpt-agent-top">
|
| 128 |
<span className="fpt-agent-avatar" data-tone={engine ? KIND_TONE[engine.kind] : staticMode ? KIND_TONE[DESIGN_KIND[agent.engine]] : 'neutral'} data-known={!!engine || staticMode || undefined} aria-hidden>{avatarText(name)}</span>
|
| 129 |
<span className="fpt-agent-name">{name}</span>
|
| 130 |
+
{human && <span className="fpt-agent-you">You</span>}
|
| 131 |
</div>
|
| 132 |
<div className="fpt-agent-line">{line}</div>
|
| 133 |
{!staticMode && (
|
|
|
|
| 137 |
<div className="fpt-agent-foot fpt-agent-foot-static"><span>Designed for: {ENGINE_WORDS[agent.engine]}</span>{now && <span className="fpt-agent-now">{now}</span>}</div>
|
| 138 |
) : (foot || engine) ? (
|
| 139 |
<div className="fpt-agent-foot" title={engine?.detail ?? (engine ? undefined : `Can use: ${ENGINE_WORDS[agent.engine]}`)}>
|
| 140 |
+
{foot && <span className="fpt-agent-foot-line" title={finishedAt ? `Finished ${hhmm(finishedAt)}` : undefined}>{foot}</span>}
|
| 141 |
+
{engine && <span className="fpt-agent-foot-line">{engine.words}{engine.detail && <span className="fpt-sr-only"> ({engine.detail})</span>}</span>}
|
| 142 |
</div>
|
| 143 |
) : (
|
| 144 |
<div className="fpt-agent-foot" title={`Can use: ${ENGINE_WORDS[agent.engine]}`}><span className="fpt-sr-only">Can use: {ENGINE_WORDS[agent.engine]}</span></div>
|
|
|
|
| 180 |
if (status === 'completed') {
|
| 181 |
tone = 'green';
|
| 182 |
const ms = startedAt && endedAt ? new Date(endedAt).getTime() - new Date(startedAt).getTime() : 0;
|
| 183 |
+
line = `All ${total} steps finished${ms > 0 ? ` in ${duration(ms)}` : ''}.${decision ? ` Result: ${decisionWords(decision)}.` : ''}`;
|
| 184 |
} else if (status === 'interrupted') {
|
| 185 |
tone = 'amber';
|
| 186 |
line = 'This test run is paused. Carry on from where it stopped.';
|
| 187 |
+
act = <Can perm="run.control"><Button size="xs" variant="filled" leftSection={<IconPlayerPlay size={12} />} loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'resume' })}>Resume</Button></Can>;
|
| 188 |
} else if (status === 'cancelled') {
|
| 189 |
tone = 'neutral';
|
| 190 |
line = 'This test run was cancelled.';
|
| 191 |
} else if (TERMINAL.includes(status)) {
|
| 192 |
tone = 'red';
|
| 193 |
line = `This test run stopped: ${error ?? (status === 'cancelled' ? 'it was cancelled' : status === 'killed' ? 'the emergency stop was used' : status === 'interrupted' ? 'it was paused' : 'an error')}.`;
|
| 194 |
+
if (['failed', 'interrupted'].includes(status)) act = <Can perm="run.control"><Button size="xs" variant="filled" leftSection={<IconPlayerPlay size={12} />} loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'resume' })}>Resume</Button></Can>;
|
| 195 |
} else if (gate === 'approve_cases' || gate === 'human_review') {
|
| 196 |
tone = 'amber';
|
| 197 |
line = gate === 'approve_cases' ? 'Waiting for you: approve the scenarios.' : 'Waiting for you: decide on the failed scenarios.';
|
| 198 |
act = gate === 'approve_cases'
|
| 199 |
+
? <Can perm="gate.approve_cases"><Button size="xs" variant="filled" component={Link} to={`/runs/${runId}/scenarios`}>Open scenario review</Button></Can>
|
| 200 |
+
: <Can perm="gate.human_review"><Button size="xs" variant="filled" component={Link} to={`/runs/${runId}/failures`}>Open failure review</Button></Can>;
|
| 201 |
} else if (silent) {
|
| 202 |
tone = 'amber';
|
| 203 |
line = `${stepName(silent.node)} has been quiet for ${Math.max(1, Math.round(silent.ms / 60_000))} min. ${quick ? 'A quick simulation usually moves faster.' : 'It may be waiting on the test environment.'}`;
|
| 204 |
act = <Can perm="run.control"><Button size="xs" color="red" variant="light" loading={action.isPending} onClick={() => action.mutate({ id: runId, action: 'cancel', reason: 'cancelled from the team board (an agent went quiet)' })}>Cancel test run</Button></Can>;
|
| 205 |
} else {
|
| 206 |
tone = 'blue';
|
| 207 |
+
line = started ? 'The team is working. You will be asked when your review is needed.' : 'Starting the agents.';
|
| 208 |
}
|
| 209 |
return (
|
| 210 |
<section className="fpt-coord" data-tone={tone} aria-label="Coordinator">
|
| 211 |
<span className="fpt-agent-avatar" data-tone="neutral" aria-hidden><IconRobot size={16} /></span>
|
| 212 |
<div style={{ flex: '1 1 260px', minWidth: 0 }}>
|
| 213 |
+
<Text fw={600} size="sm">Coordinator</Text>
|
| 214 |
+
<Text size="sm" mt={2}>
|
| 215 |
+
<span role="status">{line}</span>
|
| 216 |
+
{status !== 'completed' && <span className="fpt-num">{` ${[`${done} of ${total} steps done`, waiting ? `${waiting} waiting for you` : '', stopped ? `${stopped} stopped` : ''].filter(Boolean).join(', ')}.`}</span>}
|
| 217 |
+
{' '}<span data-testid="ai-on-run">{aiOnRun(llmCalls)}</span>
|
| 218 |
+
{can('admin') && <> <Link to="/admin?tab=ai">AI models</Link></>}
|
|
|
|
| 219 |
</Text>
|
| 220 |
<ErrorAlert error={action.error} />
|
| 221 |
</div>
|
|
|
|
| 319 |
const ps = phaseState(p.nodes);
|
| 320 |
return (
|
| 321 |
<section key={p.phase} className="fpt-board-phase" data-state={ps} role="listitem" aria-label={`${PHASE_WORDS[p.phase] ?? p.phase}: ${STATE_WORDS[ps]}`}>
|
| 322 |
+
<header><b>{i + 1}. {PHASE_WORDS[p.phase] ?? p.phase}</b>{ps === 'done' && <span className="fpt-board-phase-done"><IconCircleCheck size={13} aria-hidden />Done</span>}</header>
|
| 323 |
<div role="list" aria-label={`Agents in ${PHASE_WORDS[p.phase] ?? p.phase}`} className="fpt-board-cards">{p.nodes.map(card)}</div>
|
| 324 |
{p.phase === 'Execute' && <div className="fpt-flow-note"><IconRepeat size={13} aria-hidden />A failed scenario is tried once more</div>}
|
| 325 |
</section>
|
web/src/pages/mustfix.test.tsx
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { act, screen } from '@testing-library/react';
|
| 2 |
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
| 3 |
+
import { ScenarioSteps } from '../components/shell/panelTabs';
|
| 4 |
+
import { jsonResponse, renderUi } from '../test/utils';
|
| 5 |
+
import { ScenarioReview } from './ScenarioReview';
|
| 6 |
+
|
| 7 |
+
const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
|
| 8 |
+
const scenario = { id: 'P2P-APR-001', title: 'Requisition below threshold approved by first-level approver', module: 'P2P', process: 'Requisition', step: 'Requisition',
|
| 9 |
+
priority: 'P1', priority_words: 'Critical', roles: [], preconditions: [], steps: [{ n: 1, text: 'Sign in as requester', expected: '' }], expected_result: 'Approved',
|
| 10 |
+
test_data: [], why: [], verification: 'UNVERIFIED', map_ids: [], approval_status: 'approved', origin: 'library', outcome: 'failed' };
|
| 11 |
+
const never = () => new Promise<Response>(() => undefined);
|
| 12 |
+
|
| 13 |
+
describe('must-fixes: Steps tab and scenario groups', () => {
|
| 14 |
+
afterEach(() => { vi.useRealTimers(); vi.restoreAllMocks(); });
|
| 15 |
+
|
| 16 |
+
it('the Steps tab shows the scenario from its own request while the run\'s big scenario list is still loading', async () => {
|
| 17 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
| 18 |
+
const u = urlOf(input);
|
| 19 |
+
if (u.includes('/api/runs/r1/scenarios')) return never();
|
| 20 |
+
if (u.includes('/api/scenarios/P2P-APR-001')) return jsonResponse(scenario);
|
| 21 |
+
return jsonResponse(null);
|
| 22 |
+
});
|
| 23 |
+
renderUi(<ScenarioSteps runId="r1" scenarioId="P2P-APR-001" />);
|
| 24 |
+
expect(await screen.findByText('Requisition below threshold approved by first-level approver')).toBeInTheDocument();
|
| 25 |
+
expect(screen.getByText(/^Steps of/)).toHaveTextContent('Steps of P2P-APR-001');
|
| 26 |
+
});
|
| 27 |
+
|
| 28 |
+
it('after 10 s without the scenario, the Steps tab shows an error line with Try again', async () => {
|
| 29 |
+
vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'], shouldAdvanceTime: true });
|
| 30 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(() => never());
|
| 31 |
+
renderUi(<ScenarioSteps runId="r1" scenarioId="P2P-APR-001" />);
|
| 32 |
+
expect(screen.getByLabelText('Loading the scenario')).toHaveAttribute('aria-busy', 'true');
|
| 33 |
+
await act(async () => { vi.advanceTimersByTime(10_500); });
|
| 34 |
+
expect(screen.getByRole('alert')).toHaveTextContent('The scenario is taking too long to load.');
|
| 35 |
+
expect(screen.getByRole('button', { name: 'Try again' })).toBeInTheDocument();
|
| 36 |
+
});
|
| 37 |
+
|
| 38 |
+
it('the scenario review shows a skeleton, not a group of stubs, until the scenario list has loaded', async () => {
|
| 39 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
| 40 |
+
const u = urlOf(input);
|
| 41 |
+
if (u.includes('/gate')) return jsonResponse({ gate: 'approve_cases', policy: 'L0', auto_approved: [],
|
| 42 |
+
pending: [{ id: 'P2P-APR-001', title: 'P2P-APR-001', module: 'P2P', priority: 'P1', origin: 'library', changed_by_patch: true, new_or_changed: true, yaml_path: 'x', diff: null }] });
|
| 43 |
+
if (u.includes('/scenarios')) return never();
|
| 44 |
+
if (u.endsWith('/api/auth/me')) return jsonResponse({ id: 1, username: 'c', role: 'consultant', permissions: ['read', 'gate.approve_cases'] });
|
| 45 |
+
return jsonResponse({});
|
| 46 |
+
});
|
| 47 |
+
renderUi(<ScenarioReview id="r1" waiting />, { auth: true });
|
| 48 |
+
expect(await screen.findByTestId('review-count')).toHaveTextContent('0 of 1 approved');
|
| 49 |
+
expect(screen.getByLabelText('Loading the scenarios')).toHaveAttribute('aria-busy', 'true');
|
| 50 |
+
expect(screen.queryByTestId(/^step-group-changed-/)).not.toBeInTheDocument();
|
| 51 |
+
});
|
| 52 |
+
});
|
web/src/pages/review3.test.tsx
CHANGED
|
@@ -33,7 +33,7 @@ describe('review 3', () => {
|
|
| 33 |
dry_run: { status: 'passed' as const, failed_step: null, message: null, pod: 'Local mock pod', at, simulated: false } } };
|
| 34 |
renderUi(<ApprovalCard s={s} p={p} editable onDecision={() => undefined} />);
|
| 35 |
const card = screen.getByTestId('approval-card-a');
|
| 36 |
-
expect(card).toHaveTextContent(`Dry run passed on Local mock pod
|
| 37 |
expect(card.querySelector('.fpt-dry')).toHaveAttribute('title', '2026-10-17 11:23 UTC');
|
| 38 |
const names = within(card).getAllByRole('button').map((b) => b.getAttribute('aria-label')).filter(Boolean);
|
| 39 |
expect(names).toEqual(['Approve AI requisition', 'Skip AI requisition for this patch']);
|
|
|
|
| 33 |
dry_run: { status: 'passed' as const, failed_step: null, message: null, pod: 'Local mock pod', at, simulated: false } } };
|
| 34 |
renderUi(<ApprovalCard s={s} p={p} editable onDecision={() => undefined} />);
|
| 35 |
const card = screen.getByTestId('approval-card-a');
|
| 36 |
+
expect(card).toHaveTextContent(`Dry run passed on Local mock pod, ${shortWhen(at)}`);
|
| 37 |
expect(card.querySelector('.fpt-dry')).toHaveAttribute('title', '2026-10-17 11:23 UTC');
|
| 38 |
const names = within(card).getAllByRole('button').map((b) => b.getAttribute('aria-label')).filter(Boolean);
|
| 39 |
expect(names).toEqual(['Approve AI requisition', 'Skip AI requisition for this patch']);
|
web/src/pages/step4.test.tsx
CHANGED
|
@@ -57,7 +57,7 @@ describe('step 4: approvals and failure decision', () => {
|
|
| 57 |
const card = await screen.findByTestId('approval-card-P2P-AI-001');
|
| 58 |
expect(card).toHaveTextContent('Dry run passed on Local mock pod');
|
| 59 |
expect(card).toHaveTextContent('2 steps');
|
| 60 |
-
expect(card).toHaveTextContent(
|
| 61 |
fireEvent.click(within(card).getByRole('button', { name: 'Skip AI requisition for this patch' }));
|
| 62 |
expect(card).toHaveAttribute('data-decision', 'skip');
|
| 63 |
expect(screen.getByTestId('scenario-P2P-AI-001')).toHaveAttribute('data-decision', 'skip');
|
|
|
|
| 57 |
const card = await screen.findByTestId('approval-card-P2P-AI-001');
|
| 58 |
expect(card).toHaveTextContent('Dry run passed on Local mock pod');
|
| 59 |
expect(card).toHaveTextContent('2 steps');
|
| 60 |
+
expect(card).toHaveTextContent(/model mistral-large/i);
|
| 61 |
fireEvent.click(within(card).getByRole('button', { name: 'Skip AI requisition for this patch' }));
|
| 62 |
expect(card).toHaveAttribute('data-decision', 'skip');
|
| 63 |
expect(screen.getByTestId('scenario-P2P-AI-001')).toHaveAttribute('data-decision', 'skip');
|
web/src/pages/step5.test.tsx
CHANGED
|
@@ -1,8 +1,7 @@
|
|
| 1 |
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
| 2 |
-
import { useState } from 'react';
|
| 3 |
import { afterEach, describe, expect, it, vi } from 'vitest';
|
| 4 |
import type { ModuleReadiness } from '../api/types';
|
| 5 |
-
import {
|
| 6 |
import { jsonResponse, renderUi } from '../test/utils';
|
| 7 |
import { ModuleCard } from './ReadinessPage';
|
| 8 |
import { SignOffReport } from './SignOffReport';
|
|
@@ -14,20 +13,35 @@ const mod = (module: string, verdict: string, run_id: string | null): ModuleRead
|
|
| 14 |
describe('step 5: result, report, readiness cockpit', () => {
|
| 15 |
afterEach(() => vi.restoreAllMocks());
|
| 16 |
|
| 17 |
-
it('
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 28 |
});
|
| 29 |
|
| 30 |
-
it('the release
|
| 31 |
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
| 32 |
const u = urlOf(input);
|
| 33 |
if (u.includes('/api/pods')) return jsonResponse([{ id: 1, name: 'Local mock pod', kind: 'mock', runnable: true, is_default: true, base_url: '', environment: 'test', modules: [], credentials: [], enabled: true }]);
|
|
@@ -35,13 +49,12 @@ describe('step 5: result, report, readiness cockpit', () => {
|
|
| 35 |
if (u.includes('/api/patch-watch')) return jsonResponse({ enabled: false, interval_s: 300, autostart: false, modules: [], last_seen_release: '26C', last_checked_at: null });
|
| 36 |
return jsonResponse({});
|
| 37 |
});
|
| 38 |
-
const { unmount } = renderUi(<
|
| 39 |
-
|
| 40 |
-
expect(screen.
|
| 41 |
-
expect(screen.queryByText(/Next update/)).not.toBeInTheDocument();
|
| 42 |
unmount();
|
| 43 |
-
renderUi(<
|
| 44 |
-
expect(await screen.findByText(/Next update:/)).toBeInTheDocument();
|
| 45 |
});
|
| 46 |
|
| 47 |
it('an area with no test run offers "Start a test run" into the intake for that area', async () => {
|
|
@@ -75,5 +88,6 @@ describe('step 5: result, report, readiness cockpit', () => {
|
|
| 75 |
expect(await href('run-summary.json')).toBe('/api/runs/r1/report/P2P/summary?download=true');
|
| 76 |
expect(await href('Results (Excel)')).toBe('/api/runs/r1/test-script.xlsx');
|
| 77 |
await waitFor(() => expect(screen.getByRole('button', { name: 'Sign off this report' })).toBeInTheDocument());
|
|
|
|
| 78 |
});
|
| 79 |
});
|
|
|
|
| 1 |
import { fireEvent, screen, waitFor } from '@testing-library/react';
|
|
|
|
| 2 |
import { afterEach, describe, expect, it, vi } from 'vitest';
|
| 3 |
import type { ModuleReadiness } from '../api/types';
|
| 4 |
+
import { ReleaseLine } from '../components/shell/cockpit';
|
| 5 |
import { jsonResponse, renderUi } from '../test/utils';
|
| 6 |
import { ModuleCard } from './ReadinessPage';
|
| 7 |
import { SignOffReport } from './SignOffReport';
|
|
|
|
| 13 |
describe('step 5: result, report, readiness cockpit', () => {
|
| 14 |
afterEach(() => vi.restoreAllMocks());
|
| 15 |
|
| 16 |
+
it('readiness: an area shows its last finished verdict, and a newer waiting run as a second line with Open your review', async () => {
|
| 17 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
| 18 |
+
const u = urlOf(input);
|
| 19 |
+
if (u.includes('/api/runs/old/readiness')) return jsonResponse({ modules: [{ ...mod('P2P', 'Not ready', 'old'), counts: { scenarios: 65, passed: 64, passed_on_retry: 0, failing: 1, not_run: 0, waiting_for_you: 0, library: 3 },
|
| 20 |
+
steps: [{ key: 'req', name: 'Requisition', state: 'failing', scenarios: 7, passed: 6, failed: 1, flaky: 0, not_run: 0, library: 7, touched: true, cross_cutting: false, group: null }] }],
|
| 21 |
+
signoff: { by: 'admin', role: 'admin', at: '2026-10-18T23:51:00Z', decisions: { P2P: 'NO-GO' }, comment: null } });
|
| 22 |
+
if (u.endsWith('/api/auth/me')) return jsonResponse({ id: 1, username: 'c', role: 'consultant', permissions: ['read', 'run.start', 'gate.approve_cases'] });
|
| 23 |
+
return jsonResponse({});
|
| 24 |
+
});
|
| 25 |
+
const newer = { ...mod('P2P', 'Waiting for you', 'new'), run_status: 'waiting_approval' };
|
| 26 |
+
const last = { run_id: 'old', status: 'completed', created_at: '2026-10-18T23:40:00Z', modules: ['P2P'], decisions: { P2P: 'NO-GO' }, orchestrator: 'langgraph', playwright_mode: 'stub', trigger: 'manual' };
|
| 27 |
+
renderUi(<ModuleCard m={newer} last={last} />, { auth: true });
|
| 28 |
+
expect(screen.getByTestId('verdict-P2P')).toHaveTextContent(/^Not ready$/);
|
| 29 |
+
await waitFor(() => expect(screen.getByTestId('summary-P2P')).toHaveTextContent('signed off by admin. 1 scenario failing in Requisition.'));
|
| 30 |
+
expect(screen.getByText('A newer test run is waiting for your approval.')).toBeInTheDocument();
|
| 31 |
+
expect(screen.getByRole('link', { name: 'Open your review' })).toHaveAttribute('href', '/runs/new');
|
| 32 |
+
expect(screen.getByRole('link', { name: 'Report' })).toHaveAttribute('href', '/runs/old/report');
|
| 33 |
+
});
|
| 34 |
+
|
| 35 |
+
it('readiness: an area with no finished run says "Not tested yet"; a testing run is a neutral line', () => {
|
| 36 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async () => jsonResponse({}));
|
| 37 |
+
renderUi(<ModuleCard m={{ ...mod('O2C', 'Testing', 'r9'), run_status: 'running' }} />, { auth: true });
|
| 38 |
+
expect(screen.getByTestId('verdict-O2C')).toHaveTextContent('Not tested yet');
|
| 39 |
+
expect(screen.getByTestId('summary-O2C')).toHaveTextContent('Not tested yet');
|
| 40 |
+
expect(screen.getByText('A newer test run is testing now.')).toBeInTheDocument();
|
| 41 |
+
expect(screen.queryByRole('link', { name: 'Open your review' })).not.toBeInTheDocument();
|
| 42 |
});
|
| 43 |
|
| 44 |
+
it('the release line never guesses "Next Oracle update"', async () => {
|
| 45 |
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => {
|
| 46 |
const u = urlOf(input);
|
| 47 |
if (u.includes('/api/pods')) return jsonResponse([{ id: 1, name: 'Local mock pod', kind: 'mock', runnable: true, is_default: true, base_url: '', environment: 'test', modules: [], credentials: [], enabled: true }]);
|
|
|
|
| 49 |
if (u.includes('/api/patch-watch')) return jsonResponse({ enabled: false, interval_s: 300, autostart: false, modules: [], last_seen_release: '26C', last_checked_at: null });
|
| 50 |
return jsonResponse({});
|
| 51 |
});
|
| 52 |
+
const { unmount } = renderUi(<ReleaseLine podId={1} patch="26C" />);
|
| 53 |
+
await waitFor(() => expect(screen.getByTestId('release-line')).toHaveTextContent('Patch 26C. Pod release 26C.'));
|
| 54 |
+
expect(screen.queryByText(/Next Oracle update/)).not.toBeInTheDocument();
|
|
|
|
| 55 |
unmount();
|
| 56 |
+
renderUi(<ReleaseLine podId={1} patch="26C" nextUpdate="2027-01-02T00:00:00Z" />);
|
| 57 |
+
expect(await screen.findByText(/Next Oracle update:/)).toBeInTheDocument();
|
| 58 |
});
|
| 59 |
|
| 60 |
it('an area with no test run offers "Start a test run" into the intake for that area', async () => {
|
|
|
|
| 88 |
expect(await href('run-summary.json')).toBe('/api/runs/r1/report/P2P/summary?download=true');
|
| 89 |
expect(await href('Results (Excel)')).toBe('/api/runs/r1/test-script.xlsx');
|
| 90 |
await waitFor(() => expect(screen.getByRole('button', { name: 'Sign off this report' })).toBeInTheDocument());
|
| 91 |
+
expect(screen.getAllByRole('button', { name: 'Go to sign-off' })).toHaveLength(1);
|
| 92 |
});
|
| 93 |
});
|
web/src/pages/step67.test.tsx
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { fireEvent, screen, waitFor, within } from '@testing-library/react';
|
| 2 |
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
| 3 |
+
import { jsonResponse, renderUi } from '../test/utils';
|
| 4 |
+
import { everyWords, ScheduledRunsPage, scheduleSentence, utcToLocal } from './ScheduledRunsPage';
|
| 5 |
+
import { TicketsPage } from './QueuesPages';
|
| 6 |
+
|
| 7 |
+
const urlOf = (input: RequestInfo | URL) => (typeof input === 'string' ? input : input instanceof URL ? input.href : input.url);
|
| 8 |
+
const admin = { id: 1, username: 'admin', role: 'admin', permissions: ['read', 'admin', 'run.start'] };
|
| 9 |
+
const daily = { id: 7, kind: 'daily', every_minutes: null, at: '02:00', modules: ['P2P'], include_p2: false, playwright_mode: 'live', enabled: true, next_run_at: '2026-10-21T02:00:00Z', created_by: 'admin' };
|
| 10 |
+
|
| 11 |
+
describe('steps 6 and 7: scheduled runs and defects', () => {
|
| 12 |
+
afterEach(() => vi.restoreAllMocks());
|
| 13 |
+
|
| 14 |
+
it('schedules read as sentences', () => {
|
| 15 |
+
expect(scheduleSentence(daily as never).when).toMatch(/^Every day at 02:00 UTC/);
|
| 16 |
+
expect(scheduleSentence(daily as never).what).toBe('Procure-to-Pay, full browser run.');
|
| 17 |
+
expect(scheduleSentence({ kind: 'interval', every_minutes: 360, at: null, modules: [], playwright_mode: 'stub' }).when).toBe('Every 6 hours.');
|
| 18 |
+
expect(scheduleSentence({ kind: 'interval', every_minutes: 360, at: null, modules: [], playwright_mode: 'stub' }).what).toBe('All areas, quick simulation.');
|
| 19 |
+
expect(everyWords(1440)).toBe('Every day');
|
| 20 |
+
expect(everyWords(90)).toBe('Every 90 minutes');
|
| 21 |
+
expect(utcToLocal('25:99x')).toBe('');
|
| 22 |
+
});
|
| 23 |
+
|
| 24 |
+
it('creates a daily and an every-few-hours schedule on the current API, and deletes one after a confirm', async () => {
|
| 25 |
+
const posts: unknown[] = [];
|
| 26 |
+
const deletes: string[] = [];
|
| 27 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input, init) => {
|
| 28 |
+
const u = urlOf(input);
|
| 29 |
+
const method = (init?.method ?? (input instanceof Request ? input.method : 'GET')).toUpperCase();
|
| 30 |
+
if (u.endsWith('/api/auth/me')) return jsonResponse(admin);
|
| 31 |
+
if (u.includes('/api/schedules/7') && method === 'DELETE') { deletes.push(u); return new Response(null, { status: 204 }); }
|
| 32 |
+
if (u.includes('/api/schedules') && method === 'POST') {
|
| 33 |
+
const body = input instanceof Request ? await input.clone().json() : JSON.parse(String(init?.body));
|
| 34 |
+
posts.push(body); return jsonResponse({ ...daily, id: 8 }, 201);
|
| 35 |
+
}
|
| 36 |
+
if (u.includes('/api/schedules')) return jsonResponse([daily]);
|
| 37 |
+
if (u.includes('/api/pods')) return jsonResponse([]);
|
| 38 |
+
if (u.includes('/api/patch-watch')) return jsonResponse({ enabled: false, interval_s: 300, autostart: false, modules: [], last_seen_release: '26C', last_checked_at: null });
|
| 39 |
+
return jsonResponse({});
|
| 40 |
+
});
|
| 41 |
+
renderUi(<ScheduledRunsPage />, { auth: true });
|
| 42 |
+
expect(await screen.findByTestId('schedule-7')).toHaveTextContent('Every day at 02:00 UTC');
|
| 43 |
+
expect(screen.getByRole('list', { name: 'schedules' })).toBeInTheDocument();
|
| 44 |
+
|
| 45 |
+
fireEvent.click((await screen.findAllByRole('button', { name: 'New scheduled run' }))[0]);
|
| 46 |
+
fireEvent.click(await screen.findByRole('button', { name: 'Save scheduled run' }));
|
| 47 |
+
await waitFor(() => expect(posts).toHaveLength(1));
|
| 48 |
+
expect(posts[0]).toMatchObject({ kind: 'daily', at: '02:00', every_minutes: null, modules: ['P2P'], playwright_mode: 'live' });
|
| 49 |
+
|
| 50 |
+
fireEvent.click((await screen.findAllByRole('button', { name: 'New scheduled run' }))[0]);
|
| 51 |
+
fireEvent.click(await screen.findByRole('radio', { name: 'Every few hours' }));
|
| 52 |
+
fireEvent.click(screen.getByRole('radio', { name: 'Quick simulation (no browser)' }));
|
| 53 |
+
fireEvent.click(screen.getByRole('button', { name: 'Save scheduled run' }));
|
| 54 |
+
await waitFor(() => expect(posts).toHaveLength(2));
|
| 55 |
+
expect(posts[1]).toMatchObject({ kind: 'interval', at: null, every_minutes: 360, playwright_mode: 'stub' });
|
| 56 |
+
|
| 57 |
+
fireEvent.click(screen.getByRole('button', { name: 'actions for schedule 7' }));
|
| 58 |
+
fireEvent.click(await screen.findByRole('menuitem', { name: 'Delete' }));
|
| 59 |
+
const dialog = await screen.findByRole('dialog', { name: 'Delete this scheduled run?' });
|
| 60 |
+
expect(deletes).toHaveLength(0);
|
| 61 |
+
fireEvent.click(within(dialog).getByRole('button', { name: 'Delete' }));
|
| 62 |
+
await waitFor(() => expect(deletes).toHaveLength(1));
|
| 63 |
+
});
|
| 64 |
+
|
| 65 |
+
it('defects: an open defect is a red dot and word; other statuses are neutral', async () => {
|
| 66 |
+
vi.spyOn(globalThis, 'fetch').mockImplementation(async (input) => (urlOf(input).includes('/api/tickets')
|
| 67 |
+
? jsonResponse({ items: [
|
| 68 |
+
{ ticket_id: 'T-1', case_id: 'P2P-APR-001', run_id: 'r1', sink: 'file', status: 'open', created_by: 'qa', created_at: '2026-10-20T10:00:00Z' },
|
| 69 |
+
{ ticket_id: 'T-2', case_id: 'P2P-APR-002', run_id: 'r1', sink: 'file', status: 'closed', created_by: 'qa', created_at: '2026-10-20T10:00:00Z' },
|
| 70 |
+
], total: 2, limit: 50, offset: 0 }) : urlOf(input).includes('/api/pods') ? jsonResponse([]) : jsonResponse({})));
|
| 71 |
+
renderUi(<TicketsPage />);
|
| 72 |
+
expect(await screen.findByTestId('status-open')).toHaveAttribute('data-tone', 'red');
|
| 73 |
+
expect(screen.getByTestId('status-closed')).toHaveAttribute('data-tone', 'neutral');
|
| 74 |
+
expect(screen.getByRole('table', { name: 'tickets' })).toHaveTextContent('P2P-APR-001');
|
| 75 |
+
});
|
| 76 |
+
});
|