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

refactor: rework details page and make responsive #616

Merged
merged 6 commits into from
Feb 10, 2021
Merged

Conversation

heyhippari
Copy link
Contributor

  • Refactors the way we get URLs for details pages, by querying vue-router directly for a name and parameters. This means we're not using straight strings anymore, making future changes easier.
  • Splits some of the details page to remove complexity in the templates. We currently have:
    • artist
    • item (generic one)
    • musicalbum
    • person
    • series
  • Creates a two-column layout component for details pages, making it easier to create new ones
  • Uses said component on all details pages, to make them responsive
  • Makes some small adjustments to improve small device versions of pages

@heyhippari heyhippari mentioned this pull request Jan 23, 2021
16 tasks
locales/en-US.json Outdated Show resolved Hide resolved
mixins/itemHelper.ts Outdated Show resolved Hide resolved
components/Item/Card.vue Outdated Show resolved Hide resolved
components/Players/TrackList.vue Outdated Show resolved Hide resolved
locales/en-US.json Outdated Show resolved Hide resolved
Comment on lines 168 to 171
this.setPageTitle({ title: this.item.Name });
this.setAppBarOpacity({ opaqueAppBar: false });
const hash = this.getBlurhash(this.item, ImageType.Backdrop);
this.setBackdrop({ hash });
Copy link
Member

Choose a reason for hiding this comment

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

Hmm, what about setting this in an immediate watcher, so changes of the metadata while in the page are applied (and you also don't need beforeMount anymore)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to a deep, immediate watcher on all the pages. setAppBarOpacity was moved to created, so that it's earlier in the lifecycle and happens server-side for the SSR version.

pages/series/_itemId/index.vue Outdated Show resolved Hide resolved
locales/en-US.json Outdated Show resolved Hide resolved
</h2>
<v-col cols="12" sm="9" class="pl-0 pr-0">
<!-- eslint-disable-next-line vue/no-v-html -->
<p class="item-overview" v-html="overview" />
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<p class="item-overview" v-html="overview" />
<p class="item-overview" v-text="overview" />

Why not v-text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because some providers have markup or paragraphs in them, and these don't work without this.

Copy link
Member

Choose a reason for hiding this comment

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

Imo we should just accept raw text from overviews, but that needs discussion and it's for another PR.

pages/item/_itemId/index.vue Outdated Show resolved Hide resolved
v-if="item.Taglines && item.Taglines.length > 0"
class="text-subtitle-1 text-truncate"
>
{{ item.Taglines[0] }}
Copy link
Member

Choose a reason for hiding this comment

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

Why we don't show all of them?

@ferferga
Copy link
Member

ferferga commented Feb 3, 2021

Also, I think content should "stretch" a bit earlier:

image

image

@ferferga
Copy link
Member

ferferga commented Feb 3, 2021

There are also some margin issues not present in master:

Master
image

Your branch (after a rebase against master, just to make sure)
image

@heyhippari
Copy link
Contributor Author

heyhippari commented Feb 4, 2021

@ferferga I don't touch that page at all, so I highly doubt it's due to this branch. I've had this same issue before on random commits and have never been able to track it down. It usually gets fixed on another random commit.

I suspect it's the same thing happening with the settings page.

@ThibaultNocchi ThibaultNocchi force-pushed the details-pages branch 2 times, most recently from 743d467 to 4c47234 Compare February 9, 2021 18:13
@ThibaultNocchi
Copy link
Member

@ferferga about this #616 (comment) it's due to how the breakpoints are done. The top picture should be of sm breakpoint I guess, and it goes up to ~900px so it'd be way too large for the mobile view

pages/item/_itemId/index.vue Outdated Show resolved Hide resolved
pages/item/_itemId/index.vue Outdated Show resolved Hide resolved
components/Layout/SwiperSection.vue Outdated Show resolved Hide resolved
components/Layout/ItemCols.vue Show resolved Hide resolved
@codecov-io
Copy link

codecov-io commented Feb 9, 2021

Codecov Report

Merging #616 (de41d6e) into master (cd668fe) will decrease coverage by 0.27%.
The diff coverage is 0.82%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #616      +/-   ##
==========================================
- Coverage   11.76%   11.48%   -0.28%     
==========================================
  Files         133      135       +2     
  Lines        3451     3543      +92     
  Branches      525      528       +3     
==========================================
+ Hits          406      407       +1     
- Misses       3024     3115      +91     
  Partials       21       21              
Impacted Files Coverage Δ
components/Item/Card/Card.vue 0.00% <0.00%> (ø)
components/Item/PersonList.vue 0.00% <0.00%> (ø)
components/Item/RelatedItems.vue 0.00% <0.00%> (ø)
components/Item/SeasonTabs.vue 0.00% <0.00%> (ø)
components/Layout/AudioControls.vue 0.00% <0.00%> (ø)
components/Layout/HomeHeader/HomeHeaderItems.vue 0.00% <ø> (ø)
components/Layout/SwiperSection.vue 0.00% <ø> (ø)
components/Players/TrackList.vue 0.00% <0.00%> (ø)
pages/artist/_itemId/index.vue 0.00% <0.00%> (ø)
pages/item/_itemId/index.vue 0.00% <0.00%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cd668fe...de41d6e. Read the comment docs.

@ThibaultNocchi
Copy link
Member

ThibaultNocchi commented Feb 10, 2021

Also, appearances in artist and person pages don't work.

Edit: they work, it's just links in albums or movies to those persons redirect to the item page and not the proper new ones, I'm on it

@sonarcloud
Copy link

sonarcloud bot commented Feb 10, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@ferferga ferferga merged commit 17ac05f into master Feb 10, 2021
@ferferga ferferga deleted the details-pages branch February 10, 2021 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants