Tweak issue/patch assignee/label/embed layout

This commit is contained in:
Rūdolfs Ošiņš
2024-05-16 15:45:48 +02:00
parent 3f4c65321d
commit 67da51f964
6 changed files with 93 additions and 63 deletions
-2
View File
@@ -29,8 +29,6 @@
white-space: nowrap;
align-items: center;
gap: 0.25rem;
/* This is aprox. a DID assignee */
max-width: 16rem;
}
.background {
color: currentColor;
+40 -28
View File
@@ -97,7 +97,12 @@
position: relative;
margin-top: 0.5rem;
}
.input {
width: 100%;
display: flex;
align-items: center;
gap: 0.5rem;
}
@media (max-width: 1349.98px) {
.wrapper {
display: flex;
@@ -111,11 +116,17 @@
display: flex;
align-items: center;
}
.body {
align-items: flex-start;
}
.no-assignees {
height: 2rem;
display: flex;
align-items: center;
}
.input {
width: 18rem;
}
}
</style>
@@ -127,12 +138,12 @@
<Badge
variant="neutral"
size="small"
style="cursor: pointer;"
style="cursor: pointer; max-width: 14rem;"
on:click={() =>
(removeToggles[assignee.id] = !removeToggles[assignee.id])}>
<div class="assignee">
<Avatar inline nodeId={assignee.id} />
<span>{formatNodeId(assignee.id)}</span>
<span class="txt-overflow">{formatNodeId(assignee.id)}</span>
{#if removeToggles[assignee.id]}
<IconButton title="remove assignee">
<IconSmall
@@ -144,32 +155,33 @@
</Badge>
{/each}
{#if showInput}
<div
style="width:100%; display: flex; align-items: center; gap: 0.5rem;">
<TextInput
autofocus
disabled={submitInProgress}
bind:value={inputValue}
placeholder="Add assignee"
on:submit={addAssignee} />
<IconButton
title="discard assignee"
on:click={() => {
inputValue = "";
validationMessage = undefined;
showInput = false;
}}>
<IconSmall name="cross" />
</IconButton>
<IconButton title="save assignee" on:click={addAssignee}>
<IconSmall name="checkmark" />
</IconButton>
</div>
{#if validationMessage}
<div class="validation-message">
<IconSmall name="exclamation-circle" />{validationMessage}
<div>
<div class="input">
<TextInput
autofocus
disabled={submitInProgress}
bind:value={inputValue}
placeholder="Add assignee"
on:submit={addAssignee} />
<IconButton
title="discard assignee"
on:click={() => {
inputValue = "";
validationMessage = undefined;
showInput = false;
}}>
<IconSmall name="cross" />
</IconButton>
<IconButton title="save assignee" on:click={addAssignee}>
<IconSmall name="checkmark" />
</IconButton>
</div>
{/if}
{#if validationMessage}
<div class="validation-message">
<IconSmall name="exclamation-circle" />{validationMessage}
</div>
{/if}
</div>
{:else}
<div class="global-hide-on-mobile-down">
<Badge
+9 -3
View File
@@ -25,10 +25,16 @@
display: flex;
flex-direction: row;
gap: 1rem;
align-items: flex-start;
align-items: flex;
}
.header {
margin-bottom: 0;
height: 2rem;
display: flex;
align-items: center;
}
.no-attachments {
height: 2rem;
display: flex;
align-items: center;
}
@@ -39,12 +45,12 @@
<div class="header">Attachments</div>
<div class="body">
{#each embeds as embed}
<Badge variant="neutral">
<Badge variant="neutral" size="small" style="max-width: 14rem;">
<span class="txt-overflow">{embed.name}</span>
<Clipboard text={`![${embed.name}](${embed.content.substring(4)})`} />
</Badge>
{:else}
<div class="txt-missing">No attachments</div>
<div class="txt-missing no-attachments">No attachments</div>
{/each}
</div>
</div>
+40 -27
View File
@@ -77,6 +77,12 @@
position: relative;
margin-top: 0.5rem;
}
.input {
width: 100%;
display: flex;
align-items: center;
gap: 0.5rem;
}
@media (max-width: 1349.98px) {
.wrapper {
display: flex;
@@ -90,11 +96,17 @@
display: flex;
align-items: center;
}
.body {
align-items: flex-start;
}
.no-labels {
height: 2rem;
display: flex;
align-items: center;
}
.input {
width: 18rem;
}
}
</style>
@@ -106,9 +118,9 @@
<Badge
variant="neutral"
size="small"
style="cursor: pointer;"
style="cursor: pointer; max-width: 14rem;"
on:click={() => (removeToggles[label] = !removeToggles[label])}>
<div class="label">{label}</div>
<div class="label txt-overflow">{label}</div>
{#if removeToggles[label]}
<IconButton title="remove label">
<IconSmall name="cross" on:click={() => removeLabel(label)} />
@@ -117,32 +129,33 @@
</Badge>
{/each}
{#if showInput}
<div
style="width:100%; display: flex; align-items: center; gap: 0.5rem;">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Add label"
bind:value={inputValue}
on:submit={addLabel} />
<IconButton
title="discard label"
on:click={() => {
inputValue = "";
showInput = false;
}}>
<IconSmall name="cross" />
</IconButton>
<IconButton title="save label" on:click={addLabel}>
<IconSmall name="checkmark" />
</IconButton>
</div>
{#if !valid && validationMessage}
<div class="validation-message">
<IconSmall name="exclamation-circle" />{validationMessage}
<div>
<div class="input">
<TextInput
autofocus
{valid}
disabled={submitInProgress}
placeholder="Add label"
bind:value={inputValue}
on:submit={addLabel} />
<IconButton
title="discard label"
on:click={() => {
inputValue = "";
showInput = false;
}}>
<IconSmall name="cross" />
</IconButton>
<IconButton title="save label" on:click={addLabel}>
<IconSmall name="checkmark" />
</IconButton>
</div>
{/if}
{#if !valid && validationMessage}
<div class="validation-message">
<IconSmall name="exclamation-circle" />{validationMessage}
</div>
{/if}
</div>
{:else}
<div class="global-hide-on-mobile-down">
<Badge
+3
View File
@@ -39,6 +39,9 @@
}
.header {
margin-bottom: 0;
height: 2rem;
display: flex;
align-items: center;
}
.no-reviews {
display: flex;
+1 -3
View File
@@ -589,9 +589,7 @@
labels={issue.labels}
submitInProgress={labelState === "submit"}
on:save={({ detail: newLabels }) => void saveLabels(newLabels)} />
<div class="global-hide-on-mobile-down">
<Embeds embeds={uniqueEmbeds} />
</div>
<Embeds embeds={uniqueEmbeds} />
</div>
</div>
<svelte:fragment slot="description">