refactor(multimedia): change design and refactor multimedia detail - #1077
Conversation
- remove all old code and start multimedia detail page - get data from useMultimedia composable - add property to type multimedia - add widgets-breadcrumb component in page - create multimedia-preview-card for handle oreview powerpoint or video and show data
- add content detail component - enhance layout for multimedia page - pdf type in previewcard component
- add download button component and integrate with multimedia detail page
- add random box question
-add related content component with dynamic ID and source
… rigth folder and use again
…ith flexbox structure
-create folder for component and replace them in folder and change name in page
… update references
|
@alireza013013 is attempting to deploy a commit to the GamaEdtech Team on Vercel. A member of the Team first needs to authorize it. |
sanaderi
left a comment
There was a problem hiding this comment.
Review
Overall this is a solid restructuring of the multimedia detail page (consolidated modals, new composable-driven fetch, related exams/multimedia sections). Requesting changes for a few concrete bugs found while reading the diff and confirmed by running the branch locally.
Bugs to fix before merge
-
Stale content when navigating between multimedia detail pages —
app/pages/multimedia/[id]/[[slug]].vue
TheuseAsyncDatakey changed from a reactive getter (() => \multimedia-${route.params.id}`) to a static string, and the old{ watch: [() => route.params.id] }option was dropped. Since Vue Router reuses this route component when navigating between two multimedia items (e.g. via a "Related Multimedias" card), the fetch won't re-run and the page shows the previous item's data until a hard refresh. Please restore the reactive key +watch`. -
Download button gets stuck spinning —
app/components/multimedia/downloadButton.vuependingDownloadis declared and read inhandleCoinPaymentClosebut never assigned anywhere, so when asucceeded: trueresponse comes back withupgradeSuggestions(nourl), the coin-payment modal opens but the item is never cleared fromdownloadingItems/downloadProgress— the button spins forever even after closing the modal.xhr.onloadonly handlesstatus === 200; any non-200 response (4xx/5xx) leaves the download stuck in its loading state with no toast/error, sinceonerroronly covers network-level failures.
-
title-urlbound to the wrong value —app/pages/multimedia/[id]/[[slug]].vue:title="contentData.title" :title-url="contentData.title"Both props get
contentData.title; should becontentData.title_url(already used correctly a few lines later for the canonical link). This flows intodownloadButton.vue'strackFileDownloadcall asfile_url, so download analytics end up recording the title text instead of a URL.
Please confirm intentional
- Crash report removed from the multimedia page entirely — still present on paper/tutorial detail pages. Verified by running the page locally; there's no trigger or modal for it here.
- Inline title/description editing removed (the old
editMode/updateDetailsflow for content owners) with no replacement. Not mentioned in the PR description.
Minor
- Title row has
‹ ›chevron icons that read as prev/next navigation but have no click handler orcursor-pointer— confirmed in the browser, they're inert. Either wire them up or drop them to avoid confusing users. - Typo:
messgage→messageindownloadButton.vue. - No tests added (checklist item unchecked) despite the download-flow state machine being exactly where the bugs above live.
…wnload handling and use in past paper detail and multimedia detail
- add edit modal for title and description in detai multi media - add new type for edit
sanaderi
left a comment
There was a problem hiding this comment.
Review (follow-up)
Nice work on the previous round of fixes — crash report, inline editing, the title-url prop, and the download spinner bugs (via the new shared useDownloadWithProgress composable) all look correctly addressed.
One small thing left to clean up:
Edit modal Discard button shares the Submit loading state
app/components/multimedia/modal/edit.vue — both the "Discard" and "Submit" buttons are bound to :loading="loadingEditItem":
<v-btn ... :loading="loadingEditItem" @click="closeModal">
Discard
</v-btn>
<v-btn ... :loading="loadingEditItem" :disabled="!isFormValid" @click="save">
Submit
</v-btn>
Since loadingEditItem only reflects the in-flight save request, clicking "Discard" while a save is submitting will show the Discard button spinning too, which is confusing — it isn't doing anything itself. Recommend removing :loading="loadingEditItem" from the Discard button (and/or disabling it while a save is in progress, if that's the intended UX).
Cosmetic, not blocking, but worth a quick fix.
Description
Type of Change
Checklist