Add movement artist filter modal and fix large-hall texture blanks

Clicking a movement opens ArtistFilterModal to choose artists before the gallery. Large halls no longer permanently blank frames when texture loads exceed the overlay deadline; fall back thumb to full to on-demand API.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Danila Khodjaef
2026-07-29 19:05:54 +03:00
co-authored by Cursor
parent ad1572b3aa
commit 0a5918c4dd
9 changed files with 589 additions and 23 deletions
+23
View File
@@ -335,6 +335,29 @@ app.get('/api/movements/:id/gallery', async (req, res) => {
}
});
// Artists for a movement with painting counts (for gallery entry filter modal)
app.get('/api/movements/:id/artists-summary', async (req, res) => {
try {
const { id } = req.params;
const result = await pool.query(
`SELECT a.id, a.name, a.birth_year, a.death_year, a.portrait_path, a.portrait_thumb_path,
COUNT(p.id)::int AS painting_count
FROM artists a
LEFT JOIN paintings p ON p.artist_id = a.id
WHERE a.movement_id = $1
GROUP BY a.id
ORDER BY a.birth_year NULLS LAST, a.name`,
[id]
);
const { locale, statuses } = localeContext(req);
const localized = await localizeArtists(result.rows, locale, statuses);
res.json(localized.map(enrichArtistRow));
} catch (err) {
console.error(err);
res.status(500).json({ error: 'Failed to fetch movement artists summary' });
}
});
// Artists for a movement in a time range
app.get('/api/movements/:id/artists', async (req, res) => {
try {