-
Notifications
You must be signed in to change notification settings - Fork 81
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
updated lib/KListWithOverflow.vue and lib/KBreadcrumbs.vue #857
base: develop
Are you sure you want to change the base?
Conversation
Converting to draft #693 (comment) |
@shruti862 Also referencing @AlexVelezLl's comments that touches on some areas you mentioned, perhaps it helps #693 (comment) |
@AlexVelezLl Hi Alex, @shruti862 continues this work and already followed some of your guidance. @shruti862 experienced some blockers and I asked to elaborate in this PR on some specific places. Would you please be available for giving a direction? |
Thanks @shruti862! I will take a look later today :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @shruti862!! This is a great start! I have left some instructions to solve the issues you were experiencing, along with some other things I noticed. Thank you!!
lib/KListWithOverflow.vue
Outdated
@@ -274,7 +284,15 @@ | |||
} | |||
|
|||
.more-button-wrapper { | |||
visibility: hidden; | |||
visibility: visible; | |||
order: 0; /* Ensure it remains in its original position for keyboard navigation */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We cant have this solution for the position of the button, because Keyboard navigation would not be the same. We need to keep the current behaviour in KBreadcrumbs that if the more button appears at the beginning, the keyboard navigation should focus it first, before the rest items.
@@ -274,7 +284,15 @@ | |||
} | |||
|
|||
.more-button-wrapper { | |||
visibility: hidden; | |||
visibility: visible; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm interested to know why is this change needed? The more button starts as hidden because we measure its width first, before doing the next computations, so to avoid it being visible for that first render we initialize its visibility as hidden.
@@ -129,6 +137,8 @@ | |||
*/ | |||
setOverflowItems() { | |||
const { list, listWrapper, moreButtonWrapper } = this.$refs; | |||
|
|||
// Exit early if necessary refs are not available |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets remove these comments, as the code itself is descriptive
const itemWidth = itemsSizes[i].width; | ||
|
||
// If the item dont fit in the available space or if we have already |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets get back these comments that describes a behaviour a little bit more complex
lib/KBreadcrumbs.vue
Outdated
appearance="raised-button" | ||
> | ||
<template #menu> | ||
<!-- issue :: dropdown menu shows only text of the overflowItems but not the link , I don't know whether i am doing the right way to reference link or not --> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this you can add these lines in KDropdownMenu:
<UiMenu
ref="menu"
:options="options"
:hasIcons="hasIcons"
@select="handleSelection"
>
<template #option="{ option }">
<slot name="option" :option="option"/>
</template>
</UiMenu>
And then you will be able to customize these dropdown options using this option slot in KDropdownMenu. There we can handle the link behaviour
lib/KBreadcrumbs.vue
Outdated
} | ||
// Add separators between items | ||
return crumbs.flatMap((item, index) => | ||
index > 0 ? [{ type: 'separator' }, item] : [item] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason the dividers are not being visible is because we are passing this as type: "separator"
while the correct name is type: "divider"
lib/KBreadcrumbs.vue
Outdated
<style scoped> | ||
.breadcrumbs-divider { | ||
margin: 0 10px; | ||
color: black; /* Adjust color for the ">" separator */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets standarize the name, and lets call it always "divider" instead of "separator"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, lets not use burned colors. Instead we can use our color tokens, we cant reference these in css, so we will need to set this color in the vue template
lib/KBreadcrumbs.vue
Outdated
<!-- issue :: dropdown menu shows only text of the overflowItems but not the link , I don't know whether i am doing the right way to reference link or not --> | ||
<KDropdownMenu | ||
:options="overflowItems | ||
.filter(item => item.type !== 'separator') // Filter out separators |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idem "divider" instead of separator
lib/KListWithOverflow.vue
Outdated
.list-wrapper { | ||
display: flex; | ||
justify-content: space-between; | ||
justify-content: space-between; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add a alignItems: center
instruction here, so the default behaviour is that the items are centered
77c86a0
to
6c6b208
Compare
…tem into new-change3
This reverts commit 4ada24c.
|
|
Description
Updated lib/KListWithOverflow.vue and lib/KBreadcrumbs.vue files
Issue addressed
Addresses issue #693
Addresses #PR# HERE
Before/after screenshots
Changelog
Steps to test
(optional) Implementation notes
At a high level, how did you implement this?
Does this introduce any tech-debt items?
Testing checklist
Reviewer guidance
Comments