File tree 4 files changed +87
-16
lines changed
4 files changed +87
-16
lines changed Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ defineProps({
15
15
type: Number ,
16
16
required: true ,
17
17
},
18
- labels: Array as () => Array <string | { name: string , color: string }>,
18
+ labels: Array as () => Array <string | { name: string , color? : string }>,
19
19
// eslint-disable-next-line vue/prop-name-casing
20
20
updated_at: {
21
21
type: String ,
@@ -47,7 +47,7 @@ function labelColors(color: string) {
47
47
:href =" url"
48
48
target =" _blank"
49
49
>
50
- {{ title }}
50
+ {{ title?.trim() }}
51
51
</NuxtLink >
52
52
<div
53
53
class =" text-xs relative md:absolute md:mt-6 text-gray-400 mb-1"
@@ -72,7 +72,19 @@ function labelColors(color: string) {
72
72
relative
73
73
/>
74
74
· ;
75
- {{ Math.floor(avgSimilarity * 100) }}% similar
75
+ <NuxtLink
76
+ class =" no-underline hover:underline color-current"
77
+ :to =" owner && repository ? {
78
+ name: 'owner-repo-issue',
79
+ params: {
80
+ owner: owner,
81
+ repo: repository,
82
+ issue: number,
83
+ },
84
+ } : ''"
85
+ >
86
+ {{ Math.floor(avgSimilarity * 100) }}% similar
87
+ </NuxtLink >
76
88
</div >
77
89
<div class =" flex flex-row gap-1 items-baseline flex-wrap md:flex-nowrap" >
78
90
<span
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <article >
3
+ <div class =" flex flex-row gap-2 leading-tightest no-underline color-current" >
4
+ <div class =" flex-shrink-0 text-gray-500 i-tabler-circle-dot inline-block w-5 h-5" />
5
+ <div class =" rounded-full h-4 bg-gray-500 w-70" />
6
+ </div >
7
+ </article >
8
+ </template >
Original file line number Diff line number Diff line change
1
+ <script setup lang="ts">
2
+ const route = useRoute (' owner-repo-issue' )
3
+ const { data : issues, status } = useFetch (` /api/similarity/${route .params .owner }/${route .params .repo }/${route .params .issue } ` , {
4
+ baseURL: useRuntimeConfig ().public .remote ,
5
+ default : () => [],
6
+ transform : data => data .filter ((i ): i is NonNullable <typeof i > => !! (i && i .url )),
7
+ })
8
+ </script >
9
+
10
+ <template >
11
+ <div >
12
+ <section
13
+ v-if =" status === 'pending' || status === 'idle'"
14
+ class =" flex flex-col gap-4 md:rounded-md md:border-solid border border-gray-700 md:px-4 pb-8 mt-6 columns-1 lg:columns-2 border-b-solid animate-pulse"
15
+ :style =" { '--section-index': 1 }"
16
+ >
17
+ <h2 class =" flex items-center" >
18
+ <span class =" text-gray-500 inline-block mr-1 font-normal" >#</span >
19
+ <span class =" inline-block rounded-md h-5 bg-gray-500 w-5" />
20
+ </h2 >
21
+ <GitHubIssueLoading
22
+ v-for =" s in Math.round(Math.random() * 4) + 1"
23
+ :key =" s"
24
+ />
25
+ </section >
26
+ <section
27
+ v-else
28
+ class =" flex flex-col gap-4 md:rounded-md md:border-solid border border-gray-700 md:px-4 pb-8 mt-6 columns-1 lg:columns-2 border-b-solid"
29
+ :style =" { '--section-index': 1 }"
30
+ >
31
+ <h2 class =" flex items-center" >
32
+ <span class =" text-gray-500 inline-block mr-1 font-normal" >#</span >
33
+ {{ issues[0]?.title }}
34
+ </h2 >
35
+ <GitHubIssue
36
+ v-for =" issue in issues"
37
+ :key =" issue.url"
38
+ :url =" issue.url"
39
+ :title =" issue.title"
40
+ :owner =" issue.owner"
41
+ :repository =" issue.repository"
42
+ :number =" issue.number"
43
+ :avg-similarity =" 1 - issue.score"
44
+ :labels =" issue.labels"
45
+ :updated_at =" issue.updated_at"
46
+ />
47
+ </section >
48
+ </div >
49
+ </template >
50
+
51
+ <style scoped>
52
+ section :first-of-type {
53
+ view-transition-name : var (--section-index );
54
+ }
55
+ </style >
Original file line number Diff line number Diff line change @@ -34,8 +34,10 @@ const openState = reactive<Record<string, boolean>>({})
34
34
<template >
35
35
<div >
36
36
<form @submit.prevent =" () => refresh()" >
37
- <p class =" flex gap-2 items-center" >
38
- {{ selectedRepo }}
37
+ <div class =" flex gap-2 items-center" >
38
+ <h2 class =" text-base font-normal" >
39
+ {{ selectedRepo }}
40
+ </h2 >
39
41
<button
40
42
class =" rounded-full w-7 h-7 flex items-center justify-center border-solid border border-gray-700 bg-transparent color-gray-400 hover:color-gray-200 active:color-white focus:color-gray-200 hover:border-gray-400 active:border-white focus:border-gray-400 transition-colors flex-shrink-0"
41
43
:class =" { 'animate-spin opacity-50 pointer-events-none': status === 'pending' || status === 'idle' }"
@@ -47,7 +49,7 @@ const openState = reactive<Record<string, boolean>>({})
47
49
/>
48
50
<span class =" sr-only" >refresh data</span >
49
51
</button >
50
- </p >
52
+ </div >
51
53
<label class =" w-full border-solid border border-gray-600 rounded-md flex flex-row items-center relative" >
52
54
<span class =" sr-only" >pick a repository to cluster issues</span >
53
55
<select
@@ -79,16 +81,10 @@ const openState = reactive<Record<string, boolean>>({})
79
81
<span class =" text-gray-500 inline-block mr-1 font-normal" >#</span >
80
82
<span class =" inline-block rounded-md h-5 bg-gray-500 w-5" />
81
83
</h2 >
82
- <article >
83
- <div
84
- class =" flex flex-row gap-2 leading-tightest no-underline color-current"
85
- >
86
- <span
87
- class =" flex-shrink-0 text-gray-500 i-tabler-circle-dot inline-block w-5 h-5"
88
- />
89
- <div class =" rounded-full h-4 bg-gray-500 w-70" />
90
- </div >
91
- </article >
84
+ <GitHubIssueLoading
85
+ v-for =" s in Math.round(Math.random() * 3) + 1"
86
+ :key =" s"
87
+ />
92
88
</section >
93
89
</template >
94
90
<template v-else-if =" ! clusters .length " >
You can’t perform that action at this time.
0 commit comments