Skip to content

Commit b1bb364

Browse files
authored
Improve context popup rendering (#30824)
Before, lot of empty space when no labels or body: <img width="281" alt="Screenshot 2024-05-02 at 13 51 29" src="https://github.com/go-gitea/gitea/assets/115237/8a980ccd-d53c-43a3-a059-dc8c614621e1"> After, empty space collapsed: <img width="306" alt="Screenshot 2024-05-02 at 13 51 16" src="https://github.com/go-gitea/gitea/assets/115237/8d9c154d-5de1-43d0-8536-afd9194d99b3"> All `<p>` (unsuitable) and `<small>` (discouraged in favor of css) tags are removed.
1 parent eb8bb82 commit b1bb364

File tree

2 files changed

+15
-8
lines changed

2 files changed

+15
-8
lines changed

web_src/js/components/.eslintrc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ rules:
1818
vue/attributes-order: [0]
1919
vue/html-closing-bracket-spacing: [2, {startTag: never, endTag: never, selfClosingTag: never}]
2020
vue/max-attributes-per-line: [0]
21+
vue/singleline-html-element-content-newline: [0]
2122
vue-scoped-css/enforce-style-type: [0]

web_src/js/components/ContextPopup.vue

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,22 @@ export default {
9191
<template>
9292
<div ref="root">
9393
<div v-if="loading" class="tw-h-12 tw-w-12 is-loading"/>
94-
<div v-if="!loading && issue !== null">
95-
<p><small>{{ issue.repository.full_name }} on {{ createdAt }}</small></p>
96-
<p><svg-icon :name="icon" :class="['text', color]"/> <strong>{{ issue.title }}</strong> #{{ issue.number }}</p>
97-
<p>{{ body }}</p>
94+
<div v-if="!loading && issue !== null" class="tw-flex tw-flex-col tw-gap-2">
95+
<div class="tw-text-12">{{ issue.repository.full_name }} on {{ createdAt }}</div>
96+
<div class="flex-text-block">
97+
<svg-icon :name="icon" :class="['text', color]"/>
98+
<span class="issue-title tw-font-semibold tw-break-anywhere">
99+
{{ issue.title }}
100+
<span class="index">#{{ issue.number }}</span>
101+
</span>
102+
</div>
103+
<div v-if="body">{{ body }}</div>
98104
<!-- eslint-disable-next-line vue/no-v-html -->
99-
<div v-html="renderedLabels"/>
105+
<div v-if="issue.labels.length" v-html="renderedLabels"/>
100106
</div>
101-
<div v-if="!loading && issue === null">
102-
<p><small>{{ i18nErrorOccurred }}</small></p>
103-
<p>{{ i18nErrorMessage }}</p>
107+
<div class="tw-flex tw-flex-col tw-gap-2" v-if="!loading && issue === null">
108+
<div class="tw-text-12">{{ i18nErrorOccurred }}</div>
109+
<div>{{ i18nErrorMessage }}</div>
104110
</div>
105111
</div>
106112
</template>

0 commit comments

Comments
 (0)