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

LB-1102, LB-1610, LB-945: Revamp Top Entity stats pages #2937

Merged
merged 38 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
d77c209
LB-1102: Improve entity stats on mobile
MonkeyDo Jul 9, 2024
e4b1919
Improve Top Entity graph layout and color
MonkeyDo Jul 10, 2024
62d00a1
TopEntity graph: Custom tooltips
MonkeyDo Jul 10, 2024
67f4528
Housekeeping!
MonkeyDo Jul 10, 2024
8fbe413
TopEntity graph: Fix tooltip and bottom axis
MonkeyDo Jul 11, 2024
1591f51
TopEntity graph: finesse layout and colors
MonkeyDo Jul 12, 2024
ba2a0dc
TopEntity graph: Tweak colors and layout a bit more
MonkeyDo Jul 16, 2024
5b1ac25
Lint less
MonkeyDo Jul 18, 2024
c23e460
Merge branch 'master' into entity-stats-page
MonkeyDo Jul 18, 2024
bb9c743
TopEntity graph: add artist in tooltip
MonkeyDo Jul 18, 2024
08ec9ce
TopEntity graph: custom bar component
MonkeyDo Jul 18, 2024
e294362
TopEntity graph: better mobile screen sizes support
MonkeyDo Jul 22, 2024
f28db67
TopEntity page: use ReleaseCard component where applicable
MonkeyDo Jul 22, 2024
4ff501e
TopEntity graph: Add axis at the top too
MonkeyDo Jul 22, 2024
6124cd0
TopEntity page: maintain selected range during navigation between ent…
MonkeyDo Jul 22, 2024
08ae6ca
TopEntity: Some final tweaks
MonkeyDo Jul 22, 2024
8eb726b
Lint
MonkeyDo Jul 22, 2024
651e113
TopEntity: Fewer axes ticks
MonkeyDo Jul 22, 2024
ad508b0
TopEntity graph: adapt to fewer results
MonkeyDo Jul 23, 2024
296978e
TopEntity graph: modify colors
MonkeyDo Jul 23, 2024
6afd0f7
TopEntity: Slightly wider listencards
MonkeyDo Jul 23, 2024
acf1ecc
TopTracks: Add recordingMSID
MonkeyDo Jul 23, 2024
94a51f7
ReleaseCard: don't link to entities we don't have MBIDs for
MonkeyDo Jul 24, 2024
a1985de
TopEntity graph: more fine details
MonkeyDo Jul 25, 2024
86a50bc
UserEntity page: Rework pagination component
MonkeyDo Jul 25, 2024
d156e6d
UserEntity graph: Fix number of grid lines
MonkeyDo Jul 25, 2024
2fdbd44
TopEntity page: fix small pagination issues
MonkeyDo Jul 25, 2024
5406f08
TopEntity graph: Add chart position to tooltip text
MonkeyDo Jul 25, 2024
3cd2254
TopEntity: don't pluralize 1 listen in tooltip
MonkeyDo Jul 25, 2024
50369a8
Remove unused ref
MonkeyDo Jul 29, 2024
7a6bd87
TopEntity page: Fix ListenCard grid
MonkeyDo Jul 29, 2024
36b3c65
Only show entity count header if entityCount exists
MonkeyDo Jul 29, 2024
d07d682
Remove useless row + col-xs-12 wrappers which achieve nothing.
MonkeyDo Jul 29, 2024
b2adcc8
TopEntity: Fix pagination buttons
MonkeyDo Jul 29, 2024
867d6e8
TopEntity pagination: Fix max number of pages
MonkeyDo Jul 29, 2024
26d364d
TopEntity pagination: Hide pagination when only one page
MonkeyDo Jul 29, 2024
05215be
TopEntity: Add spacing between listencards
MonkeyDo Jul 30, 2024
ea43e1c
Merge branch 'master' into entity-stats-page
anshg1214 Jul 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion frontend/css/listens-page.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@card-shadow-color: #c0c0c0;
@listen-small-break: @screen-sm;
@cover-art-thumbnail-size: 66px;
@listen-card-margin-bottom: 7px;

#dashboard {
.side-column > *:not(:last-child) {
Expand Down Expand Up @@ -44,7 +45,7 @@
&.card {
height: initial;
}
margin-bottom: 7px;
margin-bottom: @listen-card-margin-bottom;
a:focus,
a:hover {
text-decoration: underline;
Expand Down
84 changes: 84 additions & 0 deletions frontend/css/stats.less
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,87 @@
position: relative;
}
}

@bar-height: 4.5em;
.bar-chart {
position: relative;
width: 100%;
margin-bottom: 1em;
min-height: calc(25 * @bar-height); // 25 items on the graph
> * {
position: absolute;
width: 100%;
}
.graph-tooltip {
z-index: 100;
background: white;
padding: 9px 12px;
border: 1px solid #ccc;
width: 300px;
}
foreignObject {
//default width and height, they are overwritten in the CustomBarComponent
width: 95%;
height: @bar-height;
padding: 0.5em;
overflow: visible;
.graph-bar {
height: 100%;
gap: 0.6em;
.position {
margin: 0;
flex: 0;
border-right: 1px solid grey;
padding-right: 0.6em;
font-size: smaller;
white-space: nowrap;
text-align: center;
}
align-items: center;
> .graph-bar-text {
overflow: auto;
min-width: 150px;
}
.graph-bar-entity {
font-weight: bold;
color: darken(@light-grey, 30%);
}
.graph-bar-artist {
color: @light-grey;
font-size: 0.8em;
}
}
@media (max-width: @screen-phone) {
// On mobile, show the position to the right of the bar to leave more space for the text
.graph-bar {
position: relative;
.position {
position: absolute;
border: none;
left: calc(100% + 1.2em);
}
}
}
}
@media (max-width: @screen-tablet) {
width: calc(100vw - 2em);
}
}

.top-entity-listencards {
display: flex;
flex-wrap: wrap;
gap: 0 @listen-card-margin-bottom;
.listen-card {
flex: 1;
flex-basis: 360px;
max-width: 100%;
.main-content .right-section {
flex: 0;
}
}
}
.release-cards-grid.top-entity-grid {
grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
place-content: space-evenly;
}
23 changes: 18 additions & 5 deletions frontend/js/src/explore/fresh-releases/components/ReleaseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ export default function ReleaseCard(props: ReleaseCardProps) {
}
}, [releaseMBID, releaseGroupMBID, caaID, caaReleaseMBID, setCoverartSrc]);

const linkToEntity = releaseGroupMBID
? `/album/${releaseGroupMBID}/`
: `/release/${releaseMBID}/`;
let linkToEntity: string;
if (releaseGroupMBID) {
linkToEntity = `/album/${releaseGroupMBID}/`;
} else if (releaseMBID) {
linkToEntity = `/release/${releaseMBID}/`;
} else {
linkToEntity = `/search/?search_type=album&search_term=${releaseName}+${artistCreditName}`;
}

const coverArtElement = coverartSrc ? (
<>
Expand Down Expand Up @@ -233,7 +238,7 @@ export default function ReleaseCard(props: ReleaseCardProps) {
</div>
</div>
)}
{showArtist && isArray(artistCredits) && (
{showArtist && isArray(artistCredits) && artistCredits.length && (
<div className="release-artist" title={artistCreditName}>
{artistCredits.map((ac) => (
<span key={ac.artist_mbid}>
Expand All @@ -247,7 +252,15 @@ export default function ReleaseCard(props: ReleaseCardProps) {
)}
{showArtist && !isArray(artistCredits) && (
<div className="release-artist" title={artistCreditName}>
<Link to={`/artist/${artistMBIDs[0]}/`}>{artistCreditName}</Link>
<Link
to={
artistMBIDs.length
? `/artist/${artistMBIDs[0]}/`
: `/search/?search_type=artist&search_term=${artistCreditName}`
}
>
{artistCreditName}
</Link>
</div>
)}
</div>
Expand Down
Loading
Loading