Skip to content

Commit df103a4

Browse files
authored
Merge pull request #9759 from gitbutlerapp/remove-asyncrender-component
remove-asyncrender-component
2 parents 055423a + e5bc8f2 commit df103a4

File tree

7 files changed

+339
-412
lines changed

7 files changed

+339
-412
lines changed

apps/desktop/src/components/AsyncRender.svelte

Lines changed: 0 additions & 45 deletions
This file was deleted.

apps/desktop/src/components/CreateReviewBox.svelte

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import AsyncRender from '$components/AsyncRender.svelte';
32
import FloatingCommitBox from '$components/FloatingCommitBox.svelte';
43
import ReviewCreation from '$components/ReviewCreation.svelte';
54
import ReviewCreationControls from '$components/ReviewCreationControls.svelte';
@@ -43,29 +42,21 @@
4342
</script>
4443

4544
{#snippet editor()}
46-
<AsyncRender>
47-
<div class="create-review-box" data-testid={TestId.CreateReviewBox}>
48-
<ReviewCreation
49-
bind:this={reviewCreation}
50-
{projectId}
51-
{stackId}
52-
{branchName}
53-
onClose={close}
54-
/>
55-
<ReviewCreationControls
56-
isSubmitting={!!reviewCreation?.imports.isLoading}
57-
{canPublishPR}
58-
{reviewUnit}
59-
onCancel={() => {
60-
close();
61-
oncancel?.();
62-
}}
63-
onSubmit={async () => {
64-
await reviewCreation?.createReview();
65-
}}
66-
/>
67-
</div>
68-
</AsyncRender>
45+
<div class="create-review-box" data-testid={TestId.CreateReviewBox}>
46+
<ReviewCreation bind:this={reviewCreation} {projectId} {stackId} {branchName} onClose={close} />
47+
<ReviewCreationControls
48+
isSubmitting={!!reviewCreation?.imports.isLoading}
49+
{canPublishPR}
50+
{reviewUnit}
51+
onCancel={() => {
52+
close();
53+
oncancel?.();
54+
}}
55+
onSubmit={async () => {
56+
await reviewCreation?.createReview();
57+
}}
58+
/>
59+
</div>
6960
{/snippet}
7061

7162
{#if useFloatingBox.current}

apps/desktop/src/components/FileTreeNode.svelte

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import AsyncRender from '$components/AsyncRender.svelte';
32
import Self from '$components/FileTreeNode.svelte';
43
import TreeListFolder from '$components/TreeListFolder.svelte';
54
import { TestId } from '@gitbutler/ui';
@@ -56,17 +55,15 @@
5655
/>
5756

5857
{#if isExpanded}
59-
<AsyncRender>
60-
{#each node.children as childNode (childNode.name)}
61-
<Self
62-
{stackId}
63-
depth={depth + 1}
64-
node={childNode}
65-
{showCheckboxes}
66-
{changes}
67-
{fileTemplate}
68-
/>
69-
{/each}
70-
</AsyncRender>
58+
{#each node.children as childNode (childNode.name)}
59+
<Self
60+
{stackId}
61+
depth={depth + 1}
62+
node={childNode}
63+
{showCheckboxes}
64+
{changes}
65+
{fileTemplate}
66+
/>
67+
{/each}
7168
{/if}
7269
{/if}

apps/desktop/src/components/MainViewport.svelte

Lines changed: 46 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ the window, then enlarge it and retain the original widths of the layout.
2424
```
2525
-->
2626
<script lang="ts">
27-
import AsyncRender from '$components/AsyncRender.svelte';
2827
import Resizer from '$components/Resizer.svelte';
2928
import { DefinedFocusable } from '$lib/focus/focusManager.svelte';
3029
import { focusable } from '$lib/focus/focusable.svelte';
@@ -146,24 +145,22 @@ the window, then enlarge it and retain the original widths of the layout.
146145
parentId: DefinedFocusable.MainViewport
147146
}}
148147
>
149-
<AsyncRender>
150-
<div class="left-section__content">
151-
{@render left()}
152-
</div>
153-
<Resizer
154-
viewport={leftDiv}
155-
direction="right"
156-
minWidth={leftMinWidth}
157-
defaultValue={leftDefaultWidth}
158-
maxWidth={leftMaxWidth}
159-
imitateBorder
160-
borderRadius={!preview ? 'ml' : 'none'}
161-
persistId="viewport-${name}-left-section"
162-
onWidth={(width) => {
163-
leftPreferredWidth = width;
164-
}}
165-
/>
166-
</AsyncRender>
148+
<div class="left-section__content">
149+
{@render left()}
150+
</div>
151+
<Resizer
152+
viewport={leftDiv}
153+
direction="right"
154+
minWidth={leftMinWidth}
155+
defaultValue={leftDefaultWidth}
156+
maxWidth={leftMaxWidth}
157+
imitateBorder
158+
borderRadius={!preview ? 'ml' : 'none'}
159+
persistId="viewport-${name}-left-section"
160+
onWidth={(width) => {
161+
leftPreferredWidth = width;
162+
}}
163+
/>
167164
</div>
168165

169166
{#if preview}
@@ -177,23 +174,21 @@ the window, then enlarge it and retain the original widths of the layout.
177174
parentId: DefinedFocusable.MainViewport
178175
}}
179176
>
180-
<AsyncRender>
181-
<div class="left-sideview-content dotted-pattern">
182-
{@render preview()}
183-
</div>
184-
<Resizer
185-
viewport={previewDiv}
186-
direction="right"
187-
minWidth={previewMinWidth}
188-
maxWidth={previewMaxWidth}
189-
borderRadius="ml"
190-
persistId="viewport-${name}-left-sideview"
191-
defaultValue={pxToRem(previewWidth?.default, zoom)}
192-
onWidth={(width) => {
193-
previewPreferredWidth = width;
194-
}}
195-
/>
196-
</AsyncRender>
177+
<div class="left-sideview-content dotted-pattern">
178+
{@render preview()}
179+
</div>
180+
<Resizer
181+
viewport={previewDiv}
182+
direction="right"
183+
minWidth={previewMinWidth}
184+
maxWidth={previewMaxWidth}
185+
borderRadius="ml"
186+
persistId="viewport-${name}-left-sideview"
187+
defaultValue={pxToRem(previewWidth?.default, zoom)}
188+
onWidth={(width) => {
189+
previewPreferredWidth = width;
190+
}}
191+
/>
197192
</div>
198193
{/if}
199194
{:else}
@@ -224,23 +219,21 @@ the window, then enlarge it and retain the original widths of the layout.
224219
parentId: DefinedFocusable.MainViewport
225220
}}
226221
>
227-
<AsyncRender>
228-
<Resizer
229-
viewport={rightDiv}
230-
direction="left"
231-
minWidth={rightMinWidth}
232-
defaultValue={pxToRem(rightWidth.default, zoom)}
233-
maxWidth={rightMaxWidth}
234-
borderRadius="ml"
235-
persistId="viewport-${name}-right-sideview"
236-
onWidth={(width) => {
237-
rightPreferredWidth = width;
238-
}}
239-
/>
240-
<div class="right-sideview-content">
241-
{@render right()}
242-
</div>
243-
</AsyncRender>
222+
<Resizer
223+
viewport={rightDiv}
224+
direction="left"
225+
minWidth={rightMinWidth}
226+
defaultValue={pxToRem(rightWidth.default, zoom)}
227+
maxWidth={rightMaxWidth}
228+
borderRadius="ml"
229+
persistId="viewport-${name}-right-sideview"
230+
onWidth={(width) => {
231+
rightPreferredWidth = width;
232+
}}
233+
/>
234+
<div class="right-sideview-content">
235+
{@render right()}
236+
</div>
244237
</div>
245238
{/if}
246239
</div>

apps/desktop/src/components/NewCommitView.svelte

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<script lang="ts">
2-
import AsyncRender from '$components/AsyncRender.svelte';
32
import CommitMessageEditor from '$components/CommitMessageEditor.svelte';
43
import { projectRunCommitHooks } from '$lib/config/config';
54
import { HOOKS_SERVICE } from '$lib/hooks/hooksService';
@@ -211,20 +210,18 @@
211210
}
212211
</script>
213212

214-
<AsyncRender>
215-
<div data-testid={TestId.NewCommitView}>
216-
<CommitMessageEditor
217-
bind:this={input}
218-
{projectId}
219-
{stackId}
220-
actionLabel="Create commit"
221-
action={({ title, description }) => handleCommitCreation(title, description)}
222-
onChange={({ title, description }) => handleMessageUpdate(title, description)}
223-
onCancel={cancel}
224-
disabledAction={!canCommit}
225-
loading={commitCreation.current.isLoading || newStackResult.current.isLoading || isCooking}
226-
title={stackState.newCommitMessage.current.title}
227-
description={stackState.newCommitMessage.current.description}
228-
/>
229-
</div>
230-
</AsyncRender>
213+
<div data-testid={TestId.NewCommitView}>
214+
<CommitMessageEditor
215+
bind:this={input}
216+
{projectId}
217+
{stackId}
218+
actionLabel="Create commit"
219+
action={({ title, description }) => handleCommitCreation(title, description)}
220+
onChange={({ title, description }) => handleMessageUpdate(title, description)}
221+
onCancel={cancel}
222+
disabledAction={!canCommit}
223+
loading={commitCreation.current.isLoading || newStackResult.current.isLoading || isCooking}
224+
title={stackState.newCommitMessage.current.title}
225+
description={stackState.newCommitMessage.current.description}
226+
/>
227+
</div>

0 commit comments

Comments
 (0)