Skip to content

Commit 74f5737

Browse files
committed
feat(patch-detail): don't mention revision in events if its sole
Signed-off-by: Konstantinos Maninakis <[email protected]>
1 parent d8bf571 commit 74f5737

File tree

2 files changed

+32
-23
lines changed

2 files changed

+32
-23
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
- the aforementioned coupled with the pre-existing feature of optimally auto-aligning the form as it resizes should seamlessly provide a smooth authoring experience
3636
- adjust the hover text of all form buttons to advertise their respective keyboard shortcut (if any)
3737
- **patch-detail:** preselect the merged revision, if any, in the revision selector instead of always the latest
38+
- **patch-detail:** don't mention the revision and its identifier in events in the Activity section if there's only one revision
3839
- **patch-detail:** align the UX for every revision identifier shown in the patch-major-events section (top of the view) with the behaviour of those in the Activity section, i.e. showing the revision description on hover, and when clicked scrolling to the Revision section wherin more info about it is shown
3940
- **patch-detail:** don't mention the related commit in the patch-major-events section (~~"Last updated by W with revision X at commit Y Z time ago"~~). This information is still available in the Revision section.
4041
- **patch-detail:** keep the labels of the main buttons (top-right of the view) as a single line of text, even if the viewport is narrow enough to compress them

src/webviews/src/components/PatchDetailActivity.vue

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -260,13 +260,16 @@ function discardPatchCommentForm() {
260260
{{ `${event.review.verdict}ing` }}
261261
</span>
262262
<template v-else>with <span class="font-mono">no verdict</span> for</template>
263-
revision
264-
<span
265-
@click="$emit('showRevision', event.revision)"
266-
:title="getRevisionHoverTitle(event.revision.description)"
267-
class="font-mono hover:cursor-pointer"
268-
>{{ shortenHash(event.revision.id) }}</span
269-
>
263+
<template v-if="patch.revisions.length > 1">
264+
revision
265+
<span
266+
@click="$emit('showRevision', event.revision)"
267+
:title="getRevisionHoverTitle(event.revision.description)"
268+
class="font-mono hover:cursor-pointer"
269+
>{{ shortenHash(event.revision.id) }}</span
270+
>
271+
</template>
272+
<template v-else> patch</template>
270273
posted
271274
<span v-if="event.review.inline?.length">with code-inlined comments</span>
272275
by
@@ -302,13 +305,16 @@ function discardPatchCommentForm() {
302305
<span v-if="!event.discussion.resolved"
303306
>(<span class="font-mono">unresolved</span>)</span
304307
>
305-
posted on revision
306-
<span
307-
@click="$emit('showRevision', event.revision)"
308-
:title="getRevisionHoverTitle(event.revision.description)"
309-
class="font-mono hover:cursor-pointer"
310-
>{{ shortenHash(event.revision.id) }}</span
311-
>
308+
posted
309+
<template v-if="patch.revisions.length > 1">
310+
on revision
311+
<span
312+
@click="$emit('showRevision', event.revision)"
313+
:title="getRevisionHoverTitle(event.revision.description)"
314+
class="font-mono hover:cursor-pointer"
315+
>{{ shortenHash(event.revision.id) }}</span
316+
>
317+
</template>
312318
by
313319
<span :title="event.discussion.author.id" class="font-mono">{{
314320
getIdentityAliasOrId(event.discussion.author)
@@ -346,15 +352,17 @@ function discardPatchCommentForm() {
346352
<span :title="event.merge.author.id" class="font-mono">{{
347353
getIdentityAliasOrId(event.merge.author)
348354
}}</span>
349-
using revision
350-
<span
351-
v-if="event.revision"
352-
@click="$emit('showRevision', event.revision)"
353-
:title="getRevisionHoverTitle(event.revision.description)"
354-
class="font-mono hover:cursor-pointer"
355-
>{{ shortenHash(event.revision.id) }}</span
356-
>
357-
<span v-else class="font-mono">{{ shortenHash(event.merge.revision) }}</span>
355+
<template v-if="patch.revisions.length > 1">
356+
using revision
357+
<span
358+
v-if="event.revision"
359+
@click="$emit('showRevision', event.revision)"
360+
:title="getRevisionHoverTitle(event.revision.description)"
361+
class="font-mono hover:cursor-pointer"
362+
>{{ shortenHash(event.revision.id) }}</span
363+
>
364+
<span v-else class="font-mono">{{ shortenHash(event.merge.revision) }}</span>
365+
</template>
358366
</EventItem>
359367
</template>
360368
</EventList>

0 commit comments

Comments
 (0)