Skip to content

Commit 45aeb7f

Browse files
author
Akos Kitta
committed
fix: white-space regression in changelog markdown
- switched back to `[email protected]`, - spinner when module is loading Signed-off-by: Akos Kitta <[email protected]>
1 parent 21f3858 commit 45aeb7f

File tree

4 files changed

+463
-206
lines changed

4 files changed

+463
-206
lines changed

Diff for: arduino-ide-extension/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
"ps-tree": "^1.2.0",
9595
"query-string": "^7.0.1",
9696
"react-disable": "^0.1.1",
97-
"react-markdown": "^6.0.3",
97+
"react-markdown": "^8.0.0",
9898
"react-perfect-scrollbar": "^1.5.8",
9999
"react-select": "^5.6.0",
100100
"react-tabs": "^3.1.2",

Diff for: arduino-ide-extension/src/browser/dialogs/ide-updater/ide-updater-component.tsx

+27-12
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1-
import { nls } from '@theia/core/lib/common';
1+
import { nls } from '@theia/core/lib/common/nls';
22
import * as React from '@theia/core/shared/react';
3-
import ReactMarkdown from 'react-markdown';
3+
// @ts-expect-error see https://github.com/microsoft/TypeScript/issues/49721#issuecomment-1319854183
4+
import type { Options } from 'react-markdown';
45
import { ProgressInfo, UpdateInfo } from '../../../common/protocol/ide-updater';
56
import ProgressBar from '../../components/ProgressBar';
67

8+
const ReactMarkdown = React.lazy<React.ComponentType<Options>>(
9+
// @ts-expect-error see above
10+
() => import('react-markdown')
11+
);
12+
713
export interface UpdateProgress {
814
progressInfo?: ProgressInfo | undefined;
915
downloadFinished?: boolean;
@@ -96,17 +102,26 @@ export const IDEUpdaterComponent = ({
96102
{changelog && (
97103
<div className="dialogRow changelog-container">
98104
<div className="changelog">
99-
<ReactMarkdown
100-
components={{
101-
a: ({ href, children, ...props }) => (
102-
<a onClick={() => href && openExternal(href)} {...props}>
103-
{children}
104-
</a>
105-
),
106-
}}
105+
<React.Suspense
106+
fallback={
107+
<div className="fallback">
108+
<div className="spinner" />
109+
</div>
110+
}
107111
>
108-
{changelog}
109-
</ReactMarkdown>
112+
<ReactMarkdown
113+
components={{
114+
// @ts-expect-error see imports. There is no ESM type-only import in CommonJS modules.
115+
a: ({ href, children, ...props }) => (
116+
<a onClick={() => href && openExternal(href)} {...props}>
117+
{children}
118+
</a>
119+
),
120+
}}
121+
>
122+
{changelog}
123+
</ReactMarkdown>
124+
</React.Suspense>
110125
</div>
111126
</div>
112127
)}

Diff for: arduino-ide-extension/src/browser/style/ide-updater-dialog.css

+18
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,17 @@
4141
overflow: auto;
4242
padding: 0 12px;
4343
cursor: text;
44+
width: 100%;
45+
}
46+
47+
.ide-updater-dialog .changelog .fallback {
48+
min-height: 180px;
49+
width: 100%;
50+
display: flex;
51+
}
52+
53+
.ide-updater-dialog .changelog .fallback .spinner {
54+
align-self: center;
4455
}
4556

4657
.dialogContent.ide-updater-dialog
@@ -104,3 +115,10 @@
104115
margin-left: 79px;
105116
margin-right: auto;
106117
}
118+
119+
/* https://github.com/arduino/arduino-ide/pull/2027#issuecomment-1533174638 */
120+
/* https://github.com/eclipse-theia/theia/commit/1b5ff9ee459df14cedc0e8266dd02dae93fcd1bf#diff-d8d45a890507a01141c010ad4a6891edf2ae727cfa6dfe604cebbd667812cccbR68 */
121+
/* Use normal whitespace handling for the changelog content in the update dialog. */
122+
.p-Widget.dialogOverlay .dialogContent.ide-updater-dialog {
123+
white-space: normal;
124+
}

0 commit comments

Comments
 (0)