diff --git a/pdl-live-react/src/Page.css b/pdl-live-react/src/Page.css new file mode 100644 index 00000000..a0a1771c --- /dev/null +++ b/pdl-live-react/src/Page.css @@ -0,0 +1,4 @@ +.pdl-content-section { + /* This places the content e.g. editors flush with the tabs */ + padding-top: 0; +} diff --git a/pdl-live-react/src/Page.tsx b/pdl-live-react/src/Page.tsx index 7905f545..f57b10da 100644 --- a/pdl-live-react/src/Page.tsx +++ b/pdl-live-react/src/Page.tsx @@ -14,6 +14,8 @@ import DrawerContent from "./DrawerContent" import DrawerContext from "./DrawerContentContext" import DarkModeContext, { getDarkModeUserSetting } from "./DarkModeContext" +import "./Page.css" + const notFilled = { isFilled: false } type Props = PropsWithChildren<{ @@ -67,6 +69,7 @@ export default function PDLPage({ breadcrumb1, breadcrumb2, children }: Props) { diff --git a/pdl-live-react/src/view/transcript/FinalResult.css b/pdl-live-react/src/view/transcript/FinalResult.css index e69de29b..98209085 100644 --- a/pdl-live-react/src/view/transcript/FinalResult.css +++ b/pdl-live-react/src/view/transcript/FinalResult.css @@ -0,0 +1,3 @@ +.pdl-final-result { + margin-top: 2em; +} diff --git a/pdl-live-react/src/view/transcript/Output.tsx b/pdl-live-react/src/view/transcript/Output.tsx index c7edae27..e9b17998 100644 --- a/pdl-live-react/src/view/transcript/Output.tsx +++ b/pdl-live-react/src/view/transcript/Output.tsx @@ -1,28 +1,39 @@ import { match, P } from "ts-pattern" +import { Card, CardBody } from "@patternfly/react-core" import Markdown from "../Markdown" import { isMarkdownish, type PdlBlock } from "../../helpers" export default function Output({ data }: { data: PdlBlock }) { - return match(data) - .with( - P.string, - (output) => - output.trim().length > 0 && - (!isMarkdownish(output) ? ( - {output.trim()} - ) : ( - {output} - )), - ) - .with(P.union(P.number, P.boolean, P.nullish), (output) => String(output)) - .with({ contribute: P.union([], ["context"]) }, () => { - //div.classList.add('pdl_show_result_false'); // @nickm TODO - return "☐" - }) - .with({ result: P.string }, (data) => {data.result}) - .with({ result: P._ }, (data) => ( -
{JSON.stringify(data.result, undefined, 2)}
- )) - .otherwise(() => "☐") + return ( + + + {match(data) + .with( + P.string, + (output) => + output.trim().length > 0 && + (!isMarkdownish(output) ? ( + {output.trim()} + ) : ( + {output} + )), + ) + .with(P.union(P.number, P.boolean, P.nullish), (output) => + String(output), + ) + .with({ contribute: P.union([], ["context"]) }, () => { + //div.classList.add('pdl_show_result_false'); // @nickm TODO + return "☐" + }) + .with({ result: P.string }, (data) => ( + {data.result} + )) + .with({ result: P._ }, (data) => ( +
{JSON.stringify(data.result, undefined, 2)}
+ )) + .otherwise(() => "☐")} +
+
+ ) } diff --git a/pdl-live-react/src/view/transcript/Transcript.css b/pdl-live-react/src/view/transcript/Transcript.css index 8952e6c9..9d914b13 100644 --- a/pdl-live-react/src/view/transcript/Transcript.css +++ b/pdl-live-react/src/view/transcript/Transcript.css @@ -1,30 +1,41 @@ .pdl-transcript-item { + --pdl-transcript-item-border: var(--pf-v6-c-card--BorderColor) + var(--pf-v6-c-card--BorderStyle) var(--pf-v6-c-card--BorderWidth); + border-radius: 0; + &:before { border: none; + border-top: var(--pdl-transcript-item-border); + border-bottom: var(--pdl-transcript-item-border); } &:hover { cursor: pointer; background-color: var(--pf-t--global--background--color--primary--hover); } - &:not(:first-child) { - border-top: var(--pf-v6-c-card--BorderColor) - var(--pf-v6-c-card--BorderStyle) var(--pf-v6-c-card--BorderWidth); +} + +.pdl-transcript-item:not(.pf-m-secondary) + .pdl-transcript-item { + &:before { + border-top: none; + } +} + +.pdl-output + .pdl-output { + .pf-v6-c-card__body { + padding-top: 0; } } +.pdl-output + .pdl-transcript-item { +} + .pdl-block-icon { font-size: 1.375em; } -.pdl-transcript { +.pdl-transcript, +.pdl-final-result { max-width: 800px; - - .pf-v6-c-accordion__expandable-content { - background-color: transparent; - } - - .pdl-result-panel { - --pf-v6-c-panel--BackgroundColor: transparent; - } + height: auto; } diff --git a/pdl-live-react/src/view/transcript/Transcript.tsx b/pdl-live-react/src/view/transcript/Transcript.tsx index fef40d2a..67513a8e 100644 --- a/pdl-live-react/src/view/transcript/Transcript.tsx +++ b/pdl-live-react/src/view/transcript/Transcript.tsx @@ -33,9 +33,11 @@ export default function Transcript({ data }: Props) { }, [darkMode, setDrawerContent]) return ( - - + <> + + + {hasResult(data) && } - + ) }