Skip to content

Commit 59010dd

Browse files
authored
Misc fixes (#212)
* Misc fixes * Add comment * Fix for cancelled panels
1 parent fe6b642 commit 59010dd

File tree

6 files changed

+27
-4
lines changed

6 files changed

+27
-4
lines changed

ui/PageList.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ export function makeReevalPanel(
5959
// Important! Just needs to trigger a state reload.
6060
updatePanelInternal(panel);
6161

62+
if (panel.resultMeta.exception) {
63+
return;
64+
}
65+
6266
// Re-run all dependent visual panels
6367
if (!VISUAL_PANELS.includes(panel.type)) {
6468
for (const dep of page.panels) {

ui/Panel.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,14 @@ export function Panel({
306306
async function evalThis() {
307307
if (killable) {
308308
await killProcess();
309-
setLoading(false);
309+
310+
// Only don't reeval if we think it's already not running. //
311+
// This allows the UI to kill any background running process that
312+
// might have started on a different page or something like that.
313+
if (loading) {
314+
setLoading(false);
315+
return;
316+
}
310317
}
311318

312319
setLoading(true);
@@ -416,7 +423,7 @@ export function Panel({
416423
</Button>
417424
</span>
418425

419-
<label className="ml-2 text-muted">
426+
<label className="ml-2 text-muted" title={panel.id}>
420427
{PANEL_UI_DETAILS[panel.type].label}
421428
</label>
422429

ui/PanelList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ export function PanelList({
139139
});
140140
}
141141

142-
updatePanel(next, panelIndex, true);
142+
updatePanel(next, panelIndex + 1, true);
143143
}
144144

145145
const offerToTable =

ui/app.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export function App<T extends DefaultView = DefaultView>({
165165
>
166166
<div className={`app app--${MODE} app--${settings.theme}`}>
167167
{MODE_FEATURES.appHeader && <Header />}
168-
<main className={'view-' + (urlState.view || 'editor')}>
168+
<main className={'view view-' + (urlState.view || 'editor')}>
169169
{urlState.projectId && <Navigation pages={routes} />}
170170
{main}
171171
</main>

ui/components/CodeEditor.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,14 @@ export function CodeEditor({
8484
return;
8585
}
8686

87+
// Without this the clearSelection call below moves the cursor to the end of the textarea destroying in-action edits
88+
if (editorNode.editor.container.contains(document.activeElement)) {
89+
return;
90+
}
91+
8792
editorNode.editor.setValue(value);
93+
// setValue() also highlights the inserted values so this gets rid
94+
// of the highlight. Kind of a weird API really
8895
editorNode.editor.clearSelection();
8996
}, [value, editorNode]);
9097

ui/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,11 @@ a:hover {
7878
display: block;
7979
}
8080

81+
.view {
82+
/* Very important! Gives the main panel list it's overflow so it scrolls independent of the sidebar */
83+
width: 100%;
84+
}
85+
8186
.main-body {
8287
flex: 1;
8388
overflow-y: auto;

0 commit comments

Comments
 (0)