Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truncate and add ellipses for long witnesses #520

Merged
merged 2 commits into from
Nov 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/components/annotations/variants/VariantItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
:data-annotation-id="annotation.id"
@click="handleClick"
>
<div class="t-w-4/12 t-flex">
<div class="t-w-1/3 t-flex">
<div
class="t-relative t-rounded-3xl t-box-border t-px-2 t-py-1 t-text-xs t-flex-grow-0 t-flex t-items-center t-font-semibold t-whitespace-nowrap"
class="t-relative t-truncate t-w-7/8 t-rounded-3xl t-box-border t-px-2 t-py-1 t-text-xs t-flex-grow-0 t-font-semibold"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a title attribute with the full name, so it will be shown on hover?

:style="{
'background': colors[witnessColor]['100'],
'color': colors[witnessColor]['600']
}"
:title = witness

Check warning on line 18 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (18)

Unexpected spaces found around equal signs

Check warning on line 18 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (18)

Expected to be enclosed by double quotes

Check warning on line 18 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (20)

Unexpected spaces found around equal signs

Check warning on line 18 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (20)

Expected to be enclosed by double quotes
>
{{ witness ?? '-' }}
</div>
Expand All @@ -25,7 +26,7 @@
v-html="entry"
/>
</div>
<hr class="t-slate-200 t-my-[6px] t-rounded-none" v-if="showSeparator" data-cy="variant-sep-line"/>

Check warning on line 29 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (18)

Disallow self-closing on HTML void elements (<hr/>)

Check warning on line 29 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (18)

Attribute "v-if" should go before "class"

Check warning on line 29 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (20)

Disallow self-closing on HTML void elements (<hr/>)

Check warning on line 29 in src/components/annotations/variants/VariantItem.vue

View workflow job for this annotation

GitHub Actions / build (20)

Attribute "v-if" should go before "class"
</template>

<script setup lang="ts">
Expand All @@ -33,7 +34,7 @@
import colors from "tailwindcss/colors";

const entry = computed(() => props.annotation.body.value.entry)
const witness = computed(() => props.annotation.body.value.witness)
const witness= computed(() => props.annotation.body.value.witness)

export interface Props {
annotation: Annotation,
Expand Down
Loading