diff --git a/services/web/frontend/js/features/preview/components/pdf-code-check-failed-notice.js b/services/web/frontend/js/features/preview/components/pdf-code-check-failed-notice.js
new file mode 100644
index 0000000000..05d1d93b2b
--- /dev/null
+++ b/services/web/frontend/js/features/preview/components/pdf-code-check-failed-notice.js
@@ -0,0 +1,22 @@
+import { memo } from 'react'
+import { useTranslation } from 'react-i18next'
+import Icon from '../../../shared/components/icon'
+
+function PdfCodeCheckFailedNotice() {
+ const { t } = useTranslation()
+
+ return (
+
+ )
+}
+
+export default memo(PdfCodeCheckFailedNotice)
diff --git a/services/web/frontend/js/features/preview/components/pdf-logs-pane-info-notice.js b/services/web/frontend/js/features/preview/components/pdf-logs-pane-info-notice.js
new file mode 100644
index 0000000000..0cf493a46d
--- /dev/null
+++ b/services/web/frontend/js/features/preview/components/pdf-logs-pane-info-notice.js
@@ -0,0 +1,49 @@
+import { memo } from 'react'
+import { useTranslation } from 'react-i18next'
+import usePersistedState from '../../../shared/hooks/use-persisted-state'
+
+function PdfLogsPaneInfoNotice() {
+ const { t } = useTranslation()
+
+ const [dismissed, setDismissed] = usePersistedState(
+ 'logs_pane.dismissed_info_notice',
+ false
+ )
+
+ if (dismissed) {
+ return null
+ }
+
+ return (
+
+ )
+}
+
+export default memo(PdfLogsPaneInfoNotice)
diff --git a/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js b/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
index ff5baf43bc..8f0ae3831b 100644
--- a/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
+++ b/services/web/frontend/js/features/preview/components/preview-logs-pane-entry.js
@@ -78,6 +78,16 @@ function PreviewLogEntryContent({
return (
+ {formattedContent ? (
+
{formattedContent}
+ ) : null}
+ {extraInfoURL ? (
+
+ ) : null}
{rawContent ? (
@@ -104,16 +114,6 @@ function PreviewLogEntryContent({
) : null}
) : null}
- {formattedContent ? (
-
{formattedContent}
- ) : null}
- {extraInfoURL ? (
-
- ) : null}
)
}
diff --git a/services/web/frontend/stories/pdf-preview.stories.js b/services/web/frontend/stories/pdf-preview.stories.js
index 609c45b533..a0725978c1 100644
--- a/services/web/frontend/stories/pdf-preview.stories.js
+++ b/services/web/frontend/stories/pdf-preview.stories.js
@@ -14,6 +14,7 @@ import { buildFileList } from '../js/features/pdf-preview/util/file-list'
import PdfLogsViewer from '../js/features/pdf-preview/components/pdf-logs-viewer'
import examplePdf from './fixtures/storybook-example.pdf'
import PdfPreviewError from '../js/features/pdf-preview/components/pdf-preview-error'
+import PdfPreviewHybridToolbar from '../js/features/pdf-preview/components/pdf-preview-hybrid-toolbar'
setupContext()
@@ -22,6 +23,7 @@ export default {
component: PdfPreview,
subcomponents: {
PdfPreviewToolbar,
+ PdfPreviewHybridToolbar,
PdfFileList,
PdfPreviewError,
},
@@ -496,6 +498,22 @@ export const Toolbar = () => {
)
}
+export const HybridToolbar = () => {
+ useFetchMock(fetchMock => {
+ mockCompile(fetchMock, 500)
+ mockBuildFile(fetchMock)
+ })
+
+ return withContextRoot(
+
+
+ ,
+ scope
+ )
+}
+
export const FileList = () => {
const fileList = useMemo(() => {
return buildFileList(outputFiles)
diff --git a/services/web/frontend/stylesheets/app/editor/logs.less b/services/web/frontend/stylesheets/app/editor/logs.less
index 90eda75052..86bcf15b0b 100644
--- a/services/web/frontend/stylesheets/app/editor/logs.less
+++ b/services/web/frontend/stylesheets/app/editor/logs.less
@@ -137,6 +137,7 @@
background-color: @ol-blue-gray-1;
border-radius: @border-radius-base;
overflow: hidden;
+ margin-top: @margin-sm;
}
.log-entry-content-raw {
diff --git a/services/web/frontend/stylesheets/app/editor/pdf.less b/services/web/frontend/stylesheets/app/editor/pdf.less
index b395a05a0c..f8bac33a70 100644
--- a/services/web/frontend/stylesheets/app/editor/pdf.less
+++ b/services/web/frontend/stylesheets/app/editor/pdf.less
@@ -12,6 +12,7 @@
.toolbar-small-mixin;
.toolbar-alt-mixin;
padding-right: 5px;
+ margin-left: 0;
&.changes-to-autocompile {
// prettier-ignore
#gradient > .striped(@color: rgba(255, 255, 255, 0.1), @angle: -45deg);
@@ -56,6 +57,61 @@
padding-left: @line-height-computed / 4;
}
+.toolbar-pdf-hybrid {
+ .btn:not(.btn-recompile) {
+ display: inline-block;
+ color: @toolbar-btn-color;
+ background-color: transparent;
+ padding: 4px 2px;
+ line-height: 1;
+ height: 24px;
+ border-radius: 2px;
+
+ &:hover,
+ &:active,
+ &:focus {
+ color: @toolbar-btn-color;
+ }
+
+ .label {
+ position: absolute;
+ top: 0;
+ right: 0;
+ padding: 0.15em 0.6em 0.2em;
+ font-size: 60%;
+ pointer-events: none;
+ }
+
+ .btn {
+ display: inline-block;
+ color: #fff;
+ background-color: transparent;
+ padding: 4px 2px;
+ line-height: 1;
+ height: 24px;
+ border-radius: 2px;
+ }
+
+ &.log-btn {
+ margin-right: 3px;
+
+ &.active {
+ color: white;
+ background-color: @link-color;
+ box-shadow: @toolbar-icon-btn-hover-boxshadow;
+
+ &:hover {
+ color: white;
+ }
+ }
+
+ &:focus {
+ outline: none;
+ }
+ }
+ }
+}
+
.pdf {
background-color: @pdf-bg;
}
diff --git a/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js b/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js
index ee735e3e1b..4a6c1329ba 100644
--- a/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js
+++ b/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js
@@ -317,7 +317,7 @@ describe('
', function () {
await screen.findByRole('button', { name: 'Recompile' })
const logsButton = screen.getByRole('button', {
- name: 'This project has an error',
+ name: 'View logs',
})
logsButton.click()
@@ -350,7 +350,7 @@ describe('
', function () {
// show the logs UI
const logsButton = screen.getByRole('button', {
- name: 'This project has an error',
+ name: 'View logs',
})
logsButton.click()