Skip to content

Commit

Permalink
fix: file conflict resolution (#6272)
Browse files Browse the repository at this point in the history
* fix: file conflict resolution

* cleanup and janet feedback

* cleanup and test fixes

* cleanup and test fixes

* abstract diff bar and further cleanup

* correct property access

* reverting a file should never autosave

* remove comment

* fix comment inconsistency

* fix issue when saving a file with the same content

* extend autosave debounce

* no unsaved change fix

* type fixes
  • Loading branch information
briangregoryholmes authored Dec 19, 2024
1 parent 671a1a6 commit 86123e3
Show file tree
Hide file tree
Showing 28 changed files with 588 additions and 304 deletions.
15 changes: 15 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions web-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"@codemirror/lang-yaml": "^6.1.1",
"@codemirror/language": "^6.10.3",
"@codemirror/lint": "^6.8.2",
"@codemirror/merge": "^6.7.4",
"@codemirror/search": "^6.5.6",
"@codemirror/state": "^6.4.1",
"@codemirror/view": "^6.34.1",
Expand Down
38 changes: 13 additions & 25 deletions web-common/src/components/button/Button.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<script lang="ts">
import { builderActions, getAttrs, type Builder } from "bits-ui";
import { createEventDispatcher } from "svelte";
import LoadingSpinner from "../icons/LoadingSpinner.svelte";
const dispatch = createEventDispatcher();
Expand Down Expand Up @@ -40,6 +41,7 @@
export let gray = false;
export let danger = false;
export let preload = true;
export let loadingCopy = "Loading";
// needed to set certain style that could be overridden by the style block in this component
export let forcedStyle = "";
Expand Down Expand Up @@ -78,6 +80,7 @@
form={submitForm ? form : undefined}
aria-label={label}
{target}
aria-disabled={disabled}
rel={target === "_blank" ? "noopener noreferrer" : rel}
{...getAttrs(builders)}
use:builderActions={{ builders }}
Expand All @@ -86,32 +89,9 @@
{...href ? { "data-sveltekit-preload-data": preload } : {}}
>
{#if loading}
<svg
xmlns="http://www.w3.org/2000/svg"
width="15"
height="15"
viewBox="0 0 24 24"
>
<path
fill="currentColor"
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
opacity=".25"
/>
<path
fill="currentColor"
d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"
>
<animateTransform
attributeName="transform"
dur="0.75s"
repeatCount="indefinite"
type="rotate"
values="0 12 12;360 12 12"
/>
</path>
</svg>
<LoadingSpinner size="15px" />
{#if !square && !circle && !compact}
<span>Loading</span>
<span>{loadingCopy}</span>
{/if}
{:else}
<slot />
Expand Down Expand Up @@ -340,6 +320,14 @@
@apply text-red-600;
}
.danger.subtle {
@apply bg-red-50 text-red-600;
}
.danger.subtle:hover {
@apply bg-red-100;
}
/* SHAPE STYLES */
.square,
Expand Down
4 changes: 4 additions & 0 deletions web-common/src/components/forms/FieldSwitcher.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
@apply capitalize;
}
button:hover:not(.selected) {
@apply bg-slate-50;
}
.option-wrapper {
@apply flex h-6 text-sm w-fit mb-1 rounded-[2px];
}
Expand Down
26 changes: 26 additions & 0 deletions web-common/src/components/icons/LoadingSpinner.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<script>
export let size = "1em";
</script>

<svg height={size} viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path
d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"
opacity=".25"
/>
<path
d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"
class="spinner"
/>
</svg>

<style>
.spinner {
transform-origin: center;
animation: spinner_StKS 0.75s infinite linear;
}
@keyframes spinner_StKS {
100% {
transform: rotate(360deg);
}
}
</style>
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@
}}
typeahead={!showSelector}
>
<DropdownMenu.Trigger asChild let:builder>
<DropdownMenu.Trigger asChild let:builder {disabled}>
<button
{disabled}
aria-disabled={disabled}
use:builder.action
{...builder}
aria-label="Select time comparison option"
Expand Down
Loading

1 comment on commit 86123e3

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.