Skip to content

Commit 47c43bd

Browse files
authored
Merge pull request #1314 from makeabilitylab/1110-member-page-load-more
Member page: dynamic load-more, vertical papers, bio expand, section nav (#1110)
2 parents 568200f + 227c14f commit 47c43bd

14 files changed

Lines changed: 2091 additions & 88 deletions

File tree

.github/workflows/test.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,66 @@ jobs:
5858

5959
- name: Run tests
6060
run: python manage.py test website --settings=makeabilitylab.settings_test --verbosity=2
61+
62+
# Browser end-to-end tests (member-page "Load more"/"Load all", bio toggle,
63+
# section nav). Kept in a SEPARATE job from `test` so the fast unit/integration
64+
# signal stays fast and isolated — a slow or flaky browser run doesn't muddy
65+
# "did the logic break?". Like `test`, this is report-only (it doesn't block
66+
# the push or the deploy). Playwright + its browser live in requirements-dev.txt
67+
# only, never in the production image.
68+
e2e:
69+
runs-on: ubuntu-latest
70+
71+
services:
72+
postgres:
73+
image: postgres:16
74+
env:
75+
POSTGRES_DB: makeability
76+
POSTGRES_USER: admin
77+
POSTGRES_PASSWORD: password
78+
ports:
79+
- 5432:5432
80+
options: >-
81+
--health-cmd "pg_isready -U admin -d makeability"
82+
--health-interval 10s
83+
--health-timeout 5s
84+
--health-retries 5
85+
86+
env:
87+
DATABASE_HOST: localhost
88+
DATABASE_PORT: 5432
89+
DJANGO_ENV: DEBUG
90+
91+
steps:
92+
- uses: actions/checkout@v4
93+
94+
# Same ImageMagick/Ghostscript deps as `test` — the Talk fixtures the e2e
95+
# tests create run Artifact.save()'s PDF->thumbnail path.
96+
- name: Install system dependencies
97+
run: |
98+
sudo apt-get update
99+
sudo apt-get install -y --no-install-recommends imagemagick ghostscript libpq-dev
100+
sudo cp imagemagick-policy.xml /etc/ImageMagick-6/policy.xml
101+
102+
- name: Set up Python
103+
uses: actions/setup-python@v5
104+
with:
105+
python-version: "3.13"
106+
cache: pip
107+
108+
- name: Install Python dependencies (incl. Playwright)
109+
run: pip install -r requirements-dev.txt
110+
111+
# Cache the downloaded browser keyed on the pinned Playwright version, so
112+
# only the first run (or a version bump) pays the ~120 MB download.
113+
- name: Cache Playwright browser
114+
uses: actions/cache@v4
115+
with:
116+
path: ~/.cache/ms-playwright
117+
key: playwright-${{ hashFiles('requirements-dev.txt') }}
118+
119+
- name: Install Chromium for Playwright
120+
run: python -m playwright install --with-deps chromium
121+
122+
- name: Run end-to-end tests
123+
run: python manage.py test website.tests.test_member_e2e --settings=makeabilitylab.settings_test --verbosity=2

makeabilitylab/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@
7272
ALLOWED_HOSTS = ['*']
7373

7474
# Makeability Lab Global Variables, including Makeability Lab version
75-
ML_WEBSITE_VERSION = "2.8.2" # Keep this updated with each release and also change the short description below
76-
ML_WEBSITE_VERSION_DESCRIPTION = "SEO: add a dynamic sitemap.xml and advertise it in robots.txt (#1252). /sitemap.xml is generated on each request from our querysets via django.contrib.sitemaps — static listing pages (home, people, publications, projects, awards, news), visible projects, people with a position, and news items — so it stays current with no maintenance. It emits the correct per-environment domain via RequestSite (no django.contrib.sites, no DB migration) and pins URLs to https so the sitemap lists canonical links rather than http URLs that 302-redirect. Validated on the test server: all 189 sitemap URLs return 200. The top-level static robots.txt (served directly by Apache, not Django) now points crawlers at the sitemap. Remaining one-time step: submit the sitemap in Google Search Console once it is live on production."
75+
ML_WEBSITE_VERSION = "2.9.0" # Keep this updated with each release and also change the short description below
76+
ML_WEBSITE_VERSION_DESCRIPTION = "Member pages: dynamic per-section 'Load more'/'Load all' backed by a new member_artifacts AJAX endpoint that renders the same snippet templates, with higher initial counts (8 projects / 6 papers / 6 videos / 8 talks; 4/3/3/4 on mobile via a CSS cap). Fixes the recent-projects ordering (now sorted by most-recent-artifact date, descending, instead of a set re-sorted by project start_date). Prolific members' papers switch from the 3-up card grid to a scannable vertical list; over-long bios get a Show more/less toggle. Adds a sticky section nav with scroll-spy, the person's name revealed once the heading scrolls away, and live (loaded/total) counts shown in both the nav and the section headings (which drop the old 'Recent' wording); plus a floating Back to top button. Covered by unit/integration tests and a Playwright browser e2e suite wired into a new report-only CI job (#1110)."
7777
DATE_MAKEABILITYLAB_FORMED = datetime.date(2012, 1, 1) # Date Makeability Lab was formed
7878
MAX_BANNERS = 7 # Maximum number of banners on a page
7979

requirements-dev.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Development / test-only dependencies.
2+
#
3+
# These are NOT installed into the production (or test/prod server) image — the
4+
# Dockerfile installs requirements.txt only — which keeps Playwright and its
5+
# ~120 MB browser out of the deployed stack. This file is used by the Playwright
6+
# end-to-end CI job (.github/workflows/test.yml) and for running the browser
7+
# tests locally:
8+
#
9+
# pip install -r requirements-dev.txt
10+
# python -m playwright install --with-deps chromium
11+
# python manage.py test website.tests.test_member_e2e \
12+
# --settings=makeabilitylab.settings_test
13+
#
14+
# Pin Playwright so the pip package and the installed browser build stay in
15+
# lockstep (a mismatch makes `playwright install` download the wrong revision).
16+
-r requirements.txt
17+
playwright==1.60.0

0 commit comments

Comments
 (0)