-
Notifications
You must be signed in to change notification settings - Fork 11
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(app-layout): add pageinfosection component [KHCP-14578] #1888
Conversation
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.
suggestion: can you add this to the appropriate README documentation in the package?
packages/core/app-layout/src/components/collapsibleSection/CollapsibleSection.vue
Outdated
Show resolved
Hide resolved
<div | ||
v-if="title" | ||
class="collapsible-section-title" | ||
> | ||
{{ title }} | ||
</div> |
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.
suggestion: should this be an actual header tag? e.g. h3
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.
Added a titleTag
prop
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.
What do you think of having a slot to control this instead of multiple props? Then I can just <template #title><h3 id="bookmarkable-h3">{{ title }}</h3></template>
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.
It is slottable <slot name="header">
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.
There's already a header
slot for this. It wraps only the title and description.
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.
This PR was merged early by mistake (I forgot to disable auto-merge). If there is anything to follow up on, please drop comments on #1890
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.
No prob! Umm did you have any thoughts on the props vs slots thing in relation to #1888 (comment) or shall I move it to the other PR? FYI: Its totally fine to say, "I hear your comment, just we don't want to get into it atm", we can discuss another time also.
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.
Can't quite understand what the ask is in that comment.. if you're suggesting we add slot for description then I think it's a bit of an overkill at this stage? We don't really have use-cases for it yet and if one-off cases start appearing header
prop and some custom CSS can handle that. If that becomes a common occurrence then I think it's worth adding a slot for that.
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.
Here's my remaining question from this thread:
is there a use-case for slotting the header in the first place? The whole point of the component is to allow for a consistent UI across apps, so if we can remove slots where not needed, that would be ideal TBH
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.
I suppose this is turning into a more general props vs slots comment, so I guess I'm asking whether we should generally default to using slots for these sorts of things instead of props because of the difficulties consumers have when they are just given props to work with. I suppose maybe depends if we are making these components to make the our lives easier or making these components to make consumers lives easier?
I guess theres maybe a lot of opinion here, so happy to finish this up and resolve this convo if nobody has any more to add?
packages/core/app-layout/src/components/collapsibleSection/CollapsibleSection.vue
Outdated
Show resolved
Hide resolved
packages/core/app-layout/src/components/collapsibleSection/CollapsibleSection.vue
Outdated
Show resolved
Hide resolved
Co-authored-by: Adam DeHaven <[email protected]>
Done |
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.
LGTM, just one comment about the naming
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.
Having collapsible
in the component name might be misrepresentation since the section can be non-collapsible too, so we can end up with a non-collapsible CollapsibleSection
component.
How about PageSection
, similar to PageHeader
component we already have.
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.
Valid point but PageSection
doesn't suggest that it can be collapsible, engineers would have to know it is from previous experience in order to know to use this component when they need collapsible section.. not sure what's the right approach here. @adamdehaven thought?
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.
Great point 👏
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.
How about something like PageConfigSection
or PageInfoSection
; something that conveys the use case?
PageSection
is a bit too vague IMO.
Knowing that it can be collapsible is really just a documentation issue.
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.
Renamed to PageInfoSection
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.
How about KSection? Come to think of it how come this isn't being added to kongponents? Feels like it should live over there?
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.
Just noticed we typically prefix with App*
in this repo. AppPageConfigSection
maybe?
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.
How about KSection? Come to think of it how come this isn't being added to kongponents? Feels like it should live over there?
This is Konnect specific and will likely change over time.
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.
Just noticed we typically prefix with App* in this repo. AppPageConfigSection maybe?
Don't want to use the word config so it doesn't get mixed up with EntityConfigCard but AppPageInfoSection sounds good to me.
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.
This PR was merged early by mistake (I forgot to disable auto-merge). If there is anything to follow up on, please drop comments on #1890
For the image you shared, the icon would go in the |
Ah missed that, thanks! |
@@ -0,0 +1,74 @@ | |||
# PageInfoSection.vue |
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.
You didn't update the docs for the naming, etc.
Summary
Addresses: https://konghq.atlassian.net/browse/KHCP-14578
Adds CollapsibleSection component exported by
app-layout
package