File tree Expand file tree Collapse file tree 10 files changed +35
-25
lines changed
shared/src/lib/organizations Expand file tree Collapse file tree 10 files changed +35
-25
lines changed Original file line number Diff line number Diff line change 257
257
.commit-view {
258
258
position : relative ;
259
259
/* Limit the commit view to at most 40vh to ensure other sections remain visible */
260
- max-height : 40 vh ;
260
+ max-height : 50 vh ;
261
261
background-color : var (--clr-bg-1 );
262
262
}
263
263
Original file line number Diff line number Diff line change 2
2
import { MergeMethod } from ' $lib/forge/interface/types' ;
3
3
import { persisted , type Persisted } from ' @gitbutler/shared/persisted' ;
4
4
5
- import { ContextMenuItem , ContextMenuSection , DropDownButton } from ' @gitbutler/ui' ;
5
+ import { ContextMenuItem , ContextMenuSection , DropdownButton } from ' @gitbutler/ui' ;
6
6
import type { ButtonProps } from ' @gitbutler/ui' ;
7
7
8
8
interface Props {
32
32
33
33
const action = persistedAction (projectId );
34
34
35
- let dropDown: ReturnType <typeof DropDownButton > | undefined ;
35
+ let dropDown: ReturnType <typeof DropdownButton > | undefined ;
36
36
let loading = $state (false );
37
37
38
38
const labels = {
42
42
};
43
43
</script >
44
44
45
- <DropDownButton
45
+ <DropdownButton
46
46
bind:this ={dropDown }
47
47
onclick ={async () => {
48
48
loading = true ;
73
73
{/each }
74
74
</ContextMenuSection >
75
75
{/ snippet }
76
- </DropDownButton >
76
+ </DropdownButton >
Original file line number Diff line number Diff line change 386
386
messageEditor ?.focus ();
387
387
}
388
388
389
+ if (e .key === ' Enter' && (e .ctrlKey || e .metaKey )) {
390
+ e .preventDefault ();
391
+ createReview ();
392
+ return true ;
393
+ }
394
+
389
395
if (e .key === ' Escape' ) {
390
396
e .preventDefault ();
391
397
onClose ();
Original file line number Diff line number Diff line change 5
5
Button ,
6
6
ContextMenuItem ,
7
7
ContextMenuSection ,
8
- DropDownButton ,
8
+ DropdownButton ,
9
9
TestId
10
10
} from ' @gitbutler/ui' ;
11
11
22
22
$props ();
23
23
24
24
const unit = $derived (reviewUnit ?? ' PR' );
25
- let commitButton = $state <DropDownButton >();
25
+ let commitButton = $state <DropdownButton >();
26
26
27
27
const createDraft = persisted <boolean >(false , ' createDraftPr' );
28
28
</script >
36
36
onclick ={onCancel }>Cancel</Button
37
37
>
38
38
39
- <DropDownButton
39
+ <DropdownButton
40
40
testId ={TestId .ReviewCreateButton }
41
41
bind:this ={commitButton }
42
42
onclick ={() => {
47
47
style =" pop"
48
48
loading ={isSubmitting }
49
49
disabled ={submitDisabled }
50
+ hotkey =" ⌘↵"
50
51
>
51
52
{$createDraft ? ` Create ${unit } draft ` : ` Create ${unit } ` }
52
53
70
71
/>
71
72
</ContextMenuSection >
72
73
{/ snippet }
73
- </DropDownButton >
74
+ </DropdownButton >
74
75
</div >
75
76
76
77
<style lang =" postcss" >
Original file line number Diff line number Diff line change 24
24
Checkbox ,
25
25
ContextMenuItem ,
26
26
ContextMenuSection ,
27
- DropDownButton ,
27
+ DropdownButton ,
28
28
EmojiPickerButton ,
29
29
Modal ,
30
30
RichTextEditor ,
416
416
{/if }
417
417
{/if }
418
418
</div >
419
- <DropDownButton
419
+ <DropdownButton
420
420
kind =" outline"
421
421
icon =" ai-small"
422
422
shrinkable
448
448
</ContextMenuItem >
449
449
</ContextMenuSection >
450
450
{/ snippet }
451
- </DropDownButton >
451
+ </DropdownButton >
452
452
</div >
453
453
</div >
454
454
</div >
Original file line number Diff line number Diff line change 20
20
Button ,
21
21
ContextMenuItem ,
22
22
ContextMenuSection ,
23
- DropDownButton ,
23
+ DropdownButton ,
24
24
EmojiPickerButton ,
25
25
Mention as MentionsPlugin ,
26
26
RichTextEditor
169
169
type Action = keyof typeof actionLabels ;
170
170
171
171
let action = $state <Action >(' approve' );
172
- let dropDownButton = $state <ReturnType <typeof DropDownButton >>();
172
+ let dropDownButton = $state <ReturnType <typeof DropdownButton >>();
173
173
174
174
async function approve() {
175
175
await patchCommitService .updatePatch (branchUuid , changeId , {
312
312
313
313
<div class =" chat-input__action-buttons" >
314
314
{#if isPatchAuthor === false }
315
- <DropDownButton
315
+ <DropdownButton
316
316
bind:this ={dropDownButton }
317
317
loading ={isSendingMessage || isExecuting }
318
318
style =" neutral"
345
345
/>
346
346
</ContextMenuSection >
347
347
{/ snippet }
348
- </DropDownButton >
348
+ </DropdownButton >
349
349
{/if }
350
350
<Button
351
351
style =" pop"
Original file line number Diff line number Diff line change 8
8
CommitStatusBadge ,
9
9
ContextMenuItem ,
10
10
ContextMenuSection ,
11
- DropDownButton
11
+ DropdownButton
12
12
} from ' @gitbutler/ui' ;
13
13
14
14
interface Props {
45
45
let loginModal = $state <LoginModal >();
46
46
let action = $state <Action >(' approve' );
47
47
let isExecuting = $state (false );
48
- let dropDownButton = $state <ReturnType <typeof DropDownButton >>();
48
+ let dropDownButton = $state <ReturnType <typeof DropdownButton >>();
49
49
50
50
const buttonColor = $derived .by (() => {
51
51
switch (action ) {
134
134
</button >
135
135
</div >
136
136
{:else }
137
- <DropDownButton
137
+ <DropdownButton
138
138
bind:this ={dropDownButton }
139
139
loading ={isExecuting }
140
140
menuPosition =" top"
161
161
/>
162
162
</ContextMenuSection >
163
163
{/ snippet }
164
- </DropDownButton >
164
+ </DropdownButton >
165
165
{/if }
166
166
167
167
<LoginModal bind:this ={loginModal }>
Original file line number Diff line number Diff line change 4
4
import { PROJECT_SERVICE } from ' $lib/organizations/projectService' ;
5
5
import { getProjectByRepositoryId } from ' $lib/organizations/projectsPreview.svelte' ;
6
6
import { ShareLevel } from ' $lib/permissions' ;
7
- import { ContextMenuItem , ContextMenuSection , DropDownButton } from ' @gitbutler/ui' ;
7
+ import { ContextMenuItem , ContextMenuSection , DropdownButton } from ' @gitbutler/ui' ;
8
8
9
9
type Props = {
10
10
repositoryId: string ;
41
41
}
42
42
}
43
43
44
- let dropDownButton = $state <DropDownButton >();
44
+ let dropDownButton = $state <DropdownButton >();
45
45
let dropDownEnabled = $state (true );
46
46
</script >
47
47
48
48
<Loading loadable ={project .current }>
49
49
{#snippet children (project )}
50
- <DropDownButton bind:this ={dropDownButton } loading ={! dropDownEnabled } kind =" outline" >
50
+ <DropdownButton bind:this ={dropDownButton } loading ={! dropDownEnabled } kind =" outline" >
51
51
{options .find ((option ) => option .key === project .permissions .shareLevel )?.label }
52
52
53
53
{#snippet contextMenuSlot ()}
61
61
{/each }
62
62
</ContextMenuSection >
63
63
{/ snippet }
64
- </DropDownButton >
64
+ </DropdownButton >
65
65
{/ snippet }
66
66
</Loading >
Original file line number Diff line number Diff line change 21
21
type? : ' button' | ' submit' | ' reset' ;
22
22
menuPosition? : ' top' | ' bottom' ;
23
23
shrinkable? : boolean ;
24
+ hotkey? : string ;
24
25
children? : Snippet ;
25
26
contextMenuSlot: Snippet ;
26
27
onclick? : (e : MouseEvent ) => void ;
41
42
tooltip,
42
43
menuPosition = ' bottom' ,
43
44
shrinkable,
45
+ hotkey,
44
46
children,
45
47
contextMenuSlot,
46
48
onclick
76
78
{shrinkable }
77
79
{type }
78
80
{width }
81
+ {hotkey }
79
82
reversedDirection
80
83
disabled ={disabled || loading }
81
84
dropdownChild
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ export {
11
11
export { default as ContextMenu } from '$components/ContextMenu.svelte' ;
12
12
export { default as ContextMenuItem } from '$components/ContextMenuItem.svelte' ;
13
13
export { default as ContextMenuSection } from '$components/ContextMenuSection.svelte' ;
14
- export { default as DropDownButton } from '$components/DropDownButton .svelte' ;
14
+ export { default as DropdownButton } from '$components/DropdownButton .svelte' ;
15
15
export { default as EditorLogo } from '$components/EditorLogo.svelte' ;
16
16
export { default as EmptyStatePlaceholder } from '$components/EmptyStatePlaceholder.svelte' ;
17
17
export { default as HunkDiff , type LineClickParams } from '$components/hunkDiff/HunkDiff.svelte' ;
You can’t perform that action at this time.
0 commit comments