Channel cards to unstable#5696
Conversation
Unstable to channel cards branch
KDS has recently started providing visuallyhidden so is not needed.
and related re-organization of files and tests. Also adds more tests to some components.
fb06598 to
bec64b0
Compare
e5ef964 to
6588fd0
Compare
shape of loaded cards.
Fix few regressions, refactor approach to configuration footer.
6588fd0 to
5182209
Compare
4176428 to
3a07c26
Compare
3a07c26 to
86d267e
Compare
calculations. The feature is not needed in these use-cases.
3b2e264 to
cc563d2
Compare
f4dae95 to
18f4f26
Compare
16ab7ae to
82f701b
Compare
| loading.value = true; | ||
| store.dispatch('channel/loadChannelList', { listType }).then(() => { | ||
| loading.value = false; | ||
| }); |
There was a problem hiding this comment.
If this fails to load (like it times out), what happens from the user perspective?
| <KModal | ||
| v-if="deleteDialog" | ||
| :title="$tr('deleteTitle')" | ||
| :submitText="$tr('deleteChannel')" | ||
| :cancelText="$tr('cancel')" | ||
| data-testid="delete-modal" | ||
| appendToOverlay | ||
| @submit="handleDelete" | ||
| @cancel="deleteDialog = false" | ||
| > | ||
| {{ $tr('deletePrompt') }} | ||
| </KModal> | ||
| <KModal | ||
| v-if="removeDialog" | ||
| :title="$tr('removeTitle')" | ||
| :submitText="$tr('removeBtn')" | ||
| :cancelText="$tr('cancel')" | ||
| data-testid="remove-modal" | ||
| appendToOverlay | ||
| @submit="handleRemove" | ||
| @cancel="removeDialog = false" | ||
| > | ||
| {{ $tr('removePrompt') }} | ||
| </KModal> |
There was a problem hiding this comment.
Including these modals within the card component is a bit of a monolithic approach. Even though they're conditional under v-if, a large list of cards will still incur more memory usage than if these were broken out separately and used at the list level. Additionally, since these modals are not always necessary (i.e. the view-only list), composing their use alongside the use of the cards does make more sense IMO.
This isn't a blocker but I think it's worthwhile for consideration.
There was a problem hiding this comment.
Thanks @bjester, makes sense. I will address this now.
There was no particular intention in keeping them within the card component ~ I think I just didn't think about this place that much. Moving them out will be well aligned with the aim of this work. And since these are used on some of the most important pages, such as catalog that can be very long, then yes saving some memory will definitely be good too.
There was a problem hiding this comment.
I thought about this and technically I think I'd like to:
- Abstract modals to
DeleteChannelModal.vue,RemoveChannelFromList.vue, ... - Remove
footerButtonsanddropdownOptionsconfig props fromStudioChannelCardand instead just provide afooterslot - Let the 4 pages utilizing
StudioChannelCardprovide- Template for the
footerslot - A subset of page-level abstracted modals that are needed
- Template for the
I think this will mean a tiny bit more of duplicates in some areas, but I don't expect to be anything concerning. Alternatively, StudioChannelCard could also emit events when buttons or dropdown options clicked, but the resulting API and other implications feel rather convoluted to me.
Makes sense to you too @bjester? It's not complicated, but will be more changes, so if we could confirm the direction beforehand, I'd be grateful.
There was a problem hiding this comment.
I think that sounds like a great plan! The reduction of the dropdownOptions in particular should make it pretty clean, and easily make up for any small duplication around the implementation of the cards.
| }); | ||
| }, | ||
| onCardClick(channel) { | ||
| window.location.href = window.Urls.channel(channel.id); |
There was a problem hiding this comment.
Nitpick: I prefer window.location.assign()
|
I've just noticed on screenshots that I lost the invitations box being a bit wider than cards. Will fix this ~ is good for visual priority. |
| if (windowBreakpoint.value >= 5) return '50%'; | ||
| if (windowBreakpoint.value === 4) return '66.66%'; | ||
| if (windowBreakpoint.value === 3) return '83.33%'; | ||
| return '100%'; |
| <h1 class="visuallyhidden">{{ $tr('title') }}</h1> | ||
| <!-- minHeight to prevent layout shifts when loading state changes --> | ||
| <p | ||
| class="mb-2 ml-1 title" |
There was a problem hiding this comment.
I wonder whether we should continue to use Vuetify's styling classes especially when we want to move away from them (I see other places where its used as well). This is more of a thought than a comment and something to think about long term?
| }, | ||
| onCardClick(channel) { | ||
| if (this.loggedIn) { | ||
| window.location.href = window.Urls.channel(channel.id); |
There was a problem hiding this comment.
akolson
left a comment
There was a problem hiding this comment.
I think code is clear and understandable. Thanks Misha for this refactor!
Summary
Replaces Vuetify-based implementation by
KCardon My Channels, Starred Channels, View-only Channels, and Content Library pages. On this opportunity introduces a new architecture of the related pages and resolves problems with understanding & maintaining monolithic and condition-heavyChannelList+ChannelItem.References
Closes #5227
Closes #5524
Closes #5525
Closes #5526
Reviewer guidance
Code review:
Local preview:
pnpm installfirstNotes
Before merging, [TODO REVERT] Temporarily install KDS fork commit needs to be reverted and a newly released KDS version with learningequality/kolibri-design-system#1203 installed.