mirror of
https://github.com/andy-stack/vaultkeeper-ai.git
synced 2026-07-22 06:42:03 +00:00
- Add clickable artifact cards with keyboard support - Create new ArtifactView for displaying file diffs - Update button styles with solid backgrounds and faster transitions - Add auto-cleanup of stale diff and plan approval views on startup - Fix artifact deletion to preserve original file path
90 lines
2 KiB
Svelte
90 lines
2 KiB
Svelte
<script lang="ts">
|
|
import { Resolve } from "Services/DependencyService";
|
|
import type { PlanApprovalService } from "Services/PlanApprovalService";
|
|
import { Services } from "Services/Services";
|
|
import { Copy } from "Enums/Copy";
|
|
import { tick } from "svelte";
|
|
|
|
export let planApprovalOpen = false;
|
|
|
|
const planApprovalService: PlanApprovalService = Resolve<PlanApprovalService>(Services.PlanApprovalService);
|
|
|
|
let contentDiv: HTMLDivElement;
|
|
let height = 0;
|
|
|
|
$: planApprovalOpen, updateHeight();
|
|
|
|
function updateHeight() {
|
|
tick().then(() => {
|
|
if (contentDiv) {
|
|
height = contentDiv.scrollHeight;
|
|
}
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<div id="plan-approval-controls-wrapper" style:height="{height}px">
|
|
<div id="plan-approval-controls" bind:this={contentDiv}>
|
|
{#if planApprovalOpen}
|
|
<button
|
|
id="plan-approve"
|
|
class="plan-approval-button"
|
|
aria-label={Copy.ButtonApprove}
|
|
on:click={() => planApprovalService.onApprove()}>
|
|
{Copy.ButtonApprove}
|
|
</button>
|
|
<button
|
|
id="plan-reject"
|
|
class="plan-approval-button"
|
|
aria-label={Copy.ButtonReject}
|
|
on:click={() => planApprovalService.onReject()}>
|
|
{Copy.ButtonReject}
|
|
</button>
|
|
{/if}
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
#plan-approval-controls-wrapper {
|
|
transition: height 0.2s ease-out;
|
|
overflow: hidden;
|
|
}
|
|
|
|
#plan-approval-controls {
|
|
display: grid;
|
|
grid-template-columns: 1fr var(--size-4-2) 1fr;
|
|
grid-template-rows: auto;
|
|
}
|
|
|
|
#plan-approve {
|
|
grid-column: 1;
|
|
color: white;
|
|
background-color: #38533a;
|
|
}
|
|
|
|
#plan-approve:hover {
|
|
background-color: #537555;
|
|
}
|
|
|
|
#plan-approve:focus {
|
|
background-color: #537555;
|
|
}
|
|
|
|
#plan-reject {
|
|
grid-column: 3;
|
|
color: white;
|
|
background-color: #593030;
|
|
}
|
|
|
|
#plan-reject:hover {
|
|
background-color: #774545;
|
|
}
|
|
|
|
#plan-reject:focus {
|
|
background-color: #774545;
|
|
}
|
|
|
|
.plan-approval-button {
|
|
transition: background-color 0.2s ease-out;
|
|
}
|
|
</style>
|