diff --git a/src/components/Border.svelte b/src/components/Border.svelte
index c1b6c58f2..c2c175185 100644
--- a/src/components/Border.svelte
+++ b/src/components/Border.svelte
@@ -11,10 +11,12 @@
styleHeight?: string;
styleMinHeight?: string;
styleWidth?: string;
+ styleDisplay?: string;
styleCursor?: "default" | "pointer" | "text";
styleGap?: string;
styleOverflow?: string;
flatTop?: boolean;
+ flatBottom?: boolean;
styleBackgroundColor?: string;
styleFlexDirection?: string;
styleAlignItems?: string;
@@ -31,10 +33,12 @@
styleMinHeight,
stylePosition,
styleWidth,
+ styleDisplay = "flex",
styleCursor = "default",
styleGap = "0.5rem",
styleOverflow,
flatTop = false,
+ flatBottom = false,
styleBackgroundColor = "var(--color-background-default)",
styleFlexDirection = "row",
styleAlignItems = "center",
@@ -130,7 +134,6 @@
}
.p3-3 {
grid-area: p3-3;
- display: flex;
background-color: var(--local-background-color);
}
.p3-4 {
@@ -196,6 +199,21 @@
.flat-top > .p2-5 {
background-color: var(--local-button-color-1);
}
+
+ .flat-bottom > .p4-2,
+ .flat-bottom > .p4-4 {
+ background-color: transparent;
+ }
+
+ .flat-bottom > .p4-1,
+ .flat-bottom > .p4-5,
+ .flat-bottom > .p5-3,
+ .flat-bottom > .p5-1,
+ .flat-bottom > .p5-2,
+ .flat-bottom > .p5-4,
+ .flat-bottom > .p5-5 {
+ background-color: var(--local-button-color-1);
+ }
@@ -204,6 +222,7 @@
style:cursor={styleCursor}
class="container"
class:flat-top={flatTop}
+ class:flat-bottom={flatBottom}
{onclick}
role="button"
tabindex={onclick !== undefined ? 0 : -1}
@@ -226,6 +245,7 @@
{#each diff.files as file}
-
+
.header {
display: flex;
- height: 3rem;
align-items: center;
- padding: 0 0.5rem 0 1rem;
+ height: 2.5rem;
+ padding-left: 1rem;
z-index: 2;
font-size: var(--font-size-small);
}
@@ -46,6 +46,7 @@
.container {
position: relative;
overflow-x: auto;
+ z-index: 1;
}
.container::after {
position: absolute;
diff --git a/src/components/Tab.svelte b/src/components/Tab.svelte
new file mode 100644
index 000000000..ec12fd8f6
--- /dev/null
+++ b/src/components/Tab.svelte
@@ -0,0 +1,75 @@
+
+
+
+
+
+
+
+ {@render children()}
+
+
diff --git a/src/views/repo/Patch.svelte b/src/views/repo/Patch.svelte
index 5045fd548..c2066b3ea 100644
--- a/src/views/repo/Patch.svelte
+++ b/src/views/repo/Patch.svelte
@@ -27,7 +27,6 @@
import AssigneeInput from "@app/components/AssigneeInput.svelte";
import Border from "@app/components/Border.svelte";
- import Button from "@app/components/Button.svelte";
import Changeset from "@app/components/Changeset.svelte";
import CommentComponent from "@app/components/Comment.svelte";
import CopyableId from "@app/components/CopyableId.svelte";
@@ -40,6 +39,7 @@
import PatchTeaser from "@app/components/PatchTeaser.svelte";
import PatchTimeline from "@app/components/PatchTimeline.svelte";
import Sidebar from "@app/components/Sidebar.svelte";
+ import Tab from "@app/components/Tab.svelte";
import TextInput from "@app/components/TextInput.svelte";
interface Props {
@@ -335,8 +335,9 @@
}
.patch-body {
- margin: 1rem 0;
+ margin-bottom: 1rem;
position: relative;
+ z-index: 1;
}
/* We put the background and clip-path in a separate element to prevent
popovers being clipped in the main element. */
@@ -471,113 +472,142 @@
{/if}
-
-
+
+
+
+
{
+ tab = "patch";
+ }}>
+ {formatOid(patch.id)}
+
+ Initial
+
+
-
-
-
- delegate.did),
- patch.author.did,
- )}
- labels={patch.labels}
- submitInProgress={labelSaveInProgress}
- save={saveLabels} />
-
-
-
-
-
-
-
-
- {
- tab = "patch";
- }}>
- Patch
-
-
- {
- tab = "revisions";
- }}>
- Revision: {formatOid(revisions.slice(-1)[0].id)}
- latest
-
+ {
+ tab = "revisions";
+ }}>
+ {formatOid(revisions.slice(-1)[0].id)}
+
+ Latest
+
+
+
+
{#if tab === "patch"}
-
- 1
- ? revisions[0].description.at(-1)
- : undefined}
- author={revisions[0].author}
- reactions={revisions[0].reactions}
- timestamp={revisions[0].timestamp}
- body={revisions[0].description.slice(-1)[0].body}
- reactOnComment={partial(
- reactOnRevision,
- config.publicKey,
- revisions[0].id,
- )}
- editComment={roles.isDelegateOrAuthor(
- config.publicKey,
- repo.delegates.map(delegate => delegate.did),
- revisions[0].author.did,
- ) && partial(editRevision, revisions[0].id)}>
-
-
+
+
+ 1
+ ? revisions[0].description.at(-1)
+ : undefined}
+ author={revisions[0].author}
+ reactions={revisions[0].reactions}
+ timestamp={revisions[0].timestamp}
+ body={revisions[0].description.slice(-1)[0].body}
+ reactOnComment={partial(
+ reactOnRevision,
+ config.publicKey,
+ revisions[0].id,
+ )}
+ editComment={roles.isDelegateOrAuthor(
+ config.publicKey,
+ repo.delegates.map(delegate => delegate.did),
+ revisions[0].author.did,
+ ) && partial(editRevision, revisions[0].id)}>
+
+
-
-
-
(hideTimeline = !hideTimeline)}>
-
Timeline
+
+
+
+
+
+
+ delegate.did),
+ patch.author.did,
+ )}
+ labels={patch.labels}
+ submitInProgress={labelSaveInProgress}
+ save={saveLabels} />
+
+
+
+
+
+
+
+
+
+
(hideTimeline = !hideTimeline)}>
+ Timeline
+
+
-
-
+
{:else}
- {@const revision = revisions.slice(-1)[0]}
- {#await loadHighlightedDiff(repo.rid, revision.base, revision.head) then diff}
-
+
+ {@const revision = revisions.slice(-1)[0]}
+ {#await loadHighlightedDiff(repo.rid, revision.base, revision.head) then diff}
-
- {/await}
+ {/await}
+
{/if}