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

(PC-32301) feat(XPCine): add next movie feature #7040

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Conversation

xlecunff-pass
Copy link
Contributor

@xlecunff-pass xlecunff-pass commented Oct 17, 2024

Link to JIRA ticket: https://passculture.atlassian.net/browse/PC-32301

Checklist

I have:

  • Made sure my feature is working on web.
  • Made sure my feature is working on mobile (depending on relevance : real or virtual devices)
  • Written unit tests native (and web when implementation is different) for my feature.
  • Added a screenshot for UI tickets or deleted the screenshot section if no UI change

Screenshots

Capture d’écran 2024-10-17 à 14 24 23

@xlecunff-pass xlecunff-pass changed the title feat: add next movie feature (PC-32301) feat(XPCine): add next movie feature Oct 17, 2024
Copy link

github-actions bot commented Oct 17, 2024

Performance Comparison Report

Significant Changes To Render Duration

Name Render Duration Render Count
Performance test for Offer page 74.0 ms → 70.0 ms (-4.0 ms, -5.4%) 🟢 2 → 2
Show details
Name Render Duration Render Count
Performance test for Offer page Baseline
Mean: 74.0 ms
Stdev: 3.4 ms (4.6%)
Runs: 82 76 75 74 74 73 73 72 72 69

Current
Mean: 70.0 ms
Stdev: 3.4 ms (4.9%)
Runs: 75 73 73 71 71 70 70 67 66 64
Baseline
Mean: 2
Stdev: 0 (0.0%)
Runs: 2 2 2 2 2 2 2 2 2 2

Current
Mean: 2
Stdev: 0 (0.0%)
Runs: 2 2 2 2 2 2 2 2 2 2

Meaningless Changes To Render Duration

Show entries
Name Render Duration Render Count
Performance test for Favorites page 64.1 ms → 64.6 ms (+0.5 ms, +0.8%) 6 → 6
Performance test for Profile page 6.7 ms → 6.1 ms (-0.6 ms, -9.0%) 5 → 5
Search Landing Page - Performance test for Search Landing page 14.6 ms → 13.9 ms (-0.7 ms, -4.8%) 5 → 5
Performance test for Venue page 3.2 ms → 2.4 ms (-0.8 ms, -25.0%) 🟢 2 → 2
Performance test for EndedBookings page 31.6 ms → 30.3 ms (-1.3 ms, -4.1%) 6 → 6
Search Results - Performance test for Search Results page 14.8 ms → 13.5 ms (-1.3 ms, -8.8%) 5 → 5
Performance test for Bookings page 99.1 ms → 97.4 ms (-1.7 ms, -1.7%) 11 → 11
Show details
Name Render Duration Render Count
Performance test for Favorites page Baseline
Mean: 64.1 ms
Stdev: 2.5 ms (3.9%)
Runs: 68 67 66 65 64 64 63 63 61 60

Current
Mean: 64.6 ms
Stdev: 2.1 ms (3.3%)
Runs: 68 67 66 66 64 64 64 63 63 61
Baseline
Mean: 6
Stdev: 0 (0.0%)
Runs: 6 6 6 6 6 6 6 6 6 6

Current
Mean: 6
Stdev: 0 (0.0%)
Runs: 6 6 6 6 6 6 6 6 6 6
Performance test for Profile page Baseline
Mean: 6.7 ms
Stdev: 0.7 ms (10.1%)
Runs: 8 7 7 7 7 7 6 6 6 6

Current
Mean: 6.1 ms
Stdev: 1.1 ms (18.0%)
Runs: 7 7 7 7 7 6 6 5 5 4
Baseline
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5

Current
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5
Search Landing Page - Performance test for Search Landing page Baseline
Mean: 14.6 ms
Stdev: 1.8 ms (12.6%)
Runs: 18 16 16 15 15 14 14 14 12 12

Current
Mean: 13.9 ms
Stdev: 1.4 ms (9.9%)
Runs: 16 15 15 15 14 14 13 13 12 12
Baseline
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5

Current
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5
Performance test for Venue page Baseline
Mean: 3.2 ms
Stdev: 0.8 ms (24.7%)
Runs: 4 4 4 4 3 3 3 3 2 2

Current
Mean: 2.4 ms
Stdev: 0.8 ms (35.1%)
Runs: 4 3 3 3 2 2 2 2 2 1
Baseline
Mean: 2
Stdev: 0 (0.0%)
Runs: 2 2 2 2 2 2 2 2 2 2

Current
Mean: 2
Stdev: 0 (0.0%)
Runs: 2 2 2 2 2 2 2 2 2 2
Performance test for EndedBookings page Baseline
Mean: 31.6 ms
Stdev: 2.4 ms (7.6%)
Runs: 35 35 33 33 32 31 30 30 29 28

Current
Mean: 30.3 ms
Stdev: 1.9 ms (6.4%)
Runs: 33 32 32 31 31 31 29 29 28 27
Baseline
Mean: 6
Stdev: 0 (0.0%)
Runs: 6 6 6 6 6 6 6 6 6 6

Current
Mean: 6
Stdev: 0 (0.0%)
Runs: 6 6 6 6 6 6 6 6 6 6
Search Results - Performance test for Search Results page Baseline
Mean: 14.8 ms
Stdev: 1.0 ms (7.0%)
Runs: 16 16 16 15 15 15 14 14 14 13

Current
Mean: 13.5 ms
Stdev: 1.6 ms (11.7%)
Runs: 15 15 15 15 14 13 13 13 11 11
Baseline
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5

Current
Mean: 5
Stdev: 0 (0.0%)
Runs: 5 5 5 5 5 5 5 5 5 5
Performance test for Bookings page Baseline
Mean: 99.1 ms
Stdev: 4.5 ms (4.6%)
Runs: 110 103 100 99 99 97 96 96 96 95

Current
Mean: 97.4 ms
Stdev: 2.3 ms (2.4%)
Runs: 101 100 99 98 98 97 96 96 96 93
Baseline
Mean: 11
Stdev: 0 (0.0%)
Runs: 11 11 11 11 11 11 11 11 11 11

Current
Mean: 11
Stdev: 0 (0.0%)
Runs: 11 11 11 11 11 11 11 11 11 11

Changes To Render Count

There are no entries

Added Scenarios

There are no entries

Removed Scenarios

There are no entries

Generated by 🚫 dangerJS against bb714bb

@xlecunff-pass xlecunff-pass force-pushed the PC-32301 branch 11 times, most recently from 2651d2c to de06d07 Compare October 18, 2024 11:10
setSelectedDate(nextScreeningDate)
scrollToMiddleElement(nextDateIndex)
}}
onPress={() => goToDate(nextScreeningDate)}
Copy link
Contributor

Choose a reason for hiding this comment

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

J'aime beaucoup ce goToDate(date) je trouve ça très clair à la lecture

Comment on lines 22 to 41
const useMoviesScreeningsList = (offerIds: number[]) => {
const { selectedDate } = useMovieCalendar()
const { data: offersWithStocks } = useOffersStocks({ offerIds })

const moviesOffers: MovieOffer[] = useMemo(() => {
const filteredOffersWithStocks = filterOffersStocksByDate(
offersWithStocks?.offers || [],
selectedDate
)
const nextScreeningOffers = getNextMoviesByDate(offersWithStocks?.offers || [], selectedDate)

return [...filteredOffersWithStocks, ...nextScreeningOffers]
}, [offersWithStocks?.offers, selectedDate]).filter(
(offer) => offer.offer.subcategoryId === SubcategoryIdEnum.SEANCE_CINE
)

return {
moviesOffers,
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

En arrivant dans le fichier VenueCalendar, je m'attends à voir le composant et pas un hook en premier, du coup je l'aurais bien extrait dans son propre fichier ce hook 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Le tout dans un petit dossier hook comme on peut le retrouver pour d'autres features gtlPlaylist par exemple

@@ -82,7 +82,9 @@ describe('useGetVenueByDay', () => {

await act(async () => {})

expect(result.current.items).toHaveLength(1)
const filteredItems = result.current.items.filter((item) => !item.nextDate)
Copy link
Contributor

Choose a reason for hiding this comment

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

Je ne suis pas sûre de comprendre le test, tu récupères result du hook, mais ensuite dans le test tu filtres sur la donnée pour retirer les items dont tu ne veux pas et tu expect d'avoir bien 1 seule entrée dans ton tableau ce qui semble certain vu que tu as filtré juste avant 🤔 est ce qu'on ne veut pas vérifier que le hook fait ça et renvoie la donnée déjà filtrée ? Je ne comprends pas pourquoi ce filter doit être fait dans le test ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oui on est pas censé avoir de logique dans les tests 🤔

@@ -185,7 +187,9 @@ describe('useGetVenueByDay', () => {
rerender({ date: TOMORROW.toDate() })
})

expect(result.current.items).toHaveLength(5)
const filteredItems = result.current.items.filter((item) => !item.nextDate)
Copy link
Contributor

Choose a reason for hiding this comment

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

Pareil, pas sûre de comprendre pourquoi c'est dans le test qu'on fait un filter

Comment on lines +70 to +75
return moviesOfferBuilder(offersWithStocks?.offers)
.withoutMoviesAfter15Days()
.sortedByDistance(location)
.withoutMoviesOnDay(date)
.withNextScreeningFromDate(date)
.build()
Copy link
Contributor

Choose a reason for hiding this comment

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

Je comprends pas bien ce morceau de code même si j'aime bien l'idée du builder.
J'ai du mal à faire la différence entre Movies et Screening.
Et je comprends pas ce que veut dire : je veux des offres withoutMoviesAfter15Days, je le traduis en "je veux des offres sans films après 15 jours", ou même "je veux des offres sans séances après 15 jours", mais je comprends toujours pas.
Sachant que je veux des offres "sans séances après 15 jours" et "sans séances le date" et "avec la prochaine séance à partir de date", ça m'embrouille.
En réflechissant, ce qu'on veut c'est des séances entre date + 1 jour et aujourd'hui + 15 jours c'est ça ? Tu penses de mettre une fonction dans ton builder où on peut choper les offres qui ont des séances dans un intervalle ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Merci pour le commentaire, je suis tout à fait d'accord il faudra choisir un naming plus approprié et indiquer le range de jours dans la méthode c'est pas tip top
Je vais merge en l'état et on pourra reprendre ce sujet dans un autre ticket

Copy link

sonarcloud bot commented Oct 18, 2024

Copy link

sonarcloud bot commented Oct 18, 2024

@xlecunff-pass xlecunff-pass merged commit b845704 into master Oct 18, 2024
52 checks passed
@xlecunff-pass xlecunff-pass deleted the PC-32301 branch October 18, 2024 17:08
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.

4 participants