forked from gitbutlerapp/gitbutler
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request gitbutlerapp#4695 from gitbutlerapp/Edit-mode-actions
Add edit mode actions
- Loading branch information
Showing
23 changed files
with
571 additions
and
39 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<script lang="ts"> | ||
import DecorativeSplitView from './DecorativeSplitView.svelte'; | ||
import ProjectNameLabel from '../shared/ProjectNameLabel.svelte'; | ||
import dzenPc from '$lib/assets/dzen-pc.svg?raw'; | ||
import { Project } from '$lib/backend/projects'; | ||
import { ModeService, type EditModeMetadata } from '$lib/modes/service'; | ||
import { getContext } from '$lib/utils/context'; | ||
import Button from '@gitbutler/ui/Button.svelte'; | ||
interface Props { | ||
editModeMetadata: EditModeMetadata; | ||
} | ||
const { editModeMetadata }: Props = $props(); | ||
const project = getContext(Project); | ||
const modeService = getContext(ModeService); | ||
let modeServiceSaving = $state<'inert' | 'loading' | 'completed'>('inert'); | ||
async function save() { | ||
modeServiceSaving = 'loading'; | ||
await modeService.saveEditAndReturnToWorkspace(); | ||
modeServiceSaving = 'completed'; | ||
} | ||
</script> | ||
|
||
<DecorativeSplitView img={dzenPc}> | ||
<div class="switchrepo"> | ||
<div class="project-name"> | ||
<ProjectNameLabel projectName={project?.title} /> | ||
</div> | ||
<p class="switchrepo__title text-18 text-body text-bold"> | ||
You are currently editing commit <span class="code-string"> | ||
{editModeMetadata.commitOid.slice(0, 7)} | ||
</span> | ||
</p> | ||
|
||
<p class="switchrepo__message text-13 text-body">Bla bla bla</p> | ||
|
||
<div class="switchrepo__actions"> | ||
<Button | ||
style="pop" | ||
kind="solid" | ||
icon="undo-small" | ||
reversedDirection | ||
onclick={save} | ||
loading={modeServiceSaving === 'loading'} | ||
> | ||
Save changes | ||
</Button> | ||
</div> | ||
</div> | ||
</DecorativeSplitView> | ||
|
||
<style lang="postcss"> | ||
.project-name { | ||
margin-bottom: 12px; | ||
} | ||
.switchrepo__title { | ||
color: var(--clr-scale-ntrl-30); | ||
margin-bottom: 12px; | ||
} | ||
.switchrepo__message { | ||
color: var(--clr-scale-ntrl-50); | ||
margin-bottom: 20px; | ||
} | ||
.switchrepo__actions { | ||
display: flex; | ||
gap: 8px; | ||
padding-bottom: 24px; | ||
flex-wrap: wrap; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.