From 0bde481020c75ac62fad2b28d053b4131313a7a3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Feb 2025 13:34:45 -0400 Subject: [PATCH 1/4] content: gAIPCommentaryChunkedList: drop needless null annotation --- .../generateArtistInfoPageCommentaryChunkedList.js | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js index 0f238d13..711db34b 100644 --- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js +++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js @@ -179,9 +179,7 @@ export default { query.chunks .map(({chunk}) => chunk .map(({annotation}) => - (annotation - ? relation('transformContent', annotation) - : null))), + relation('transformContent', annotation))), }), data: (query) => ({ @@ -232,12 +230,10 @@ export default { }).map(({item, link, annotation, type}) => item.slots({ annotation: - (annotation - ? annotation.slots({ - mode: 'inline', - absorbPunctuationFollowingExternalLinks: false, - }) - : null), + annotation.slots({ + mode: 'inline', + absorbPunctuationFollowingExternalLinks: false, + }), content: (type === 'album' From b82bbd5e5ee13cdfc0c2dbdb7ed8f6ba8ff6e962 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Feb 2025 13:36:38 -0400 Subject: [PATCH 2/4] content: generateArtistInfoPage: wiki editor commentary list --- .../dependencies/generateArtistInfoPage.js | 19 +++++++++++++++++-- ...rateArtistInfoPageCommentaryChunkedList.js | 17 +++++++++++++---- src/strings-default.yaml | 3 +++ 3 files changed, 33 insertions(+), 6 deletions(-) diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js index 81fede4c..860e790d 100644 --- a/src/content/dependencies/generateArtistInfoPage.js +++ b/src/content/dependencies/generateArtistInfoPage.js @@ -115,7 +115,10 @@ export default { relation('generateArtistInfoPageFlashesChunkedList', artist), commentaryChunkedList: - relation('generateArtistInfoPageCommentaryChunkedList', artist), + relation('generateArtistInfoPageCommentaryChunkedList', artist, false), + + wikiEditorCommentaryChunkedList: + relation('generateArtistInfoPageCommentaryChunkedList', artist, true), }), data: (query, artist) => ({ @@ -262,7 +265,8 @@ export default { {href: '#flashes'}, language.$(pageCapsule, 'flashList.title')), - !html.isBlank(relations.commentaryChunkedList) && + (!html.isBlank(relations.commentaryChunkedList) || + !html.isBlank(relations.wikiEditorCommentaryChunkedList)) && html.tag('a', {href: '#commentary'}, language.$(pageCapsule, 'commentaryList.title')), @@ -380,6 +384,17 @@ export default { }), relations.commentaryChunkedList, + + html.tags([ + html.tag('p', + {[html.onlyIfSiblings]: true}, + + language.$(pageCapsule, 'wikiEditorCommentary', { + artist: data.name, + })), + + relations.wikiEditorCommentaryChunkedList, + ]), ]), ], diff --git a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js index 711db34b..6c619f3c 100644 --- a/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js +++ b/src/content/dependencies/generateArtistInfoPageCommentaryChunkedList.js @@ -19,7 +19,7 @@ export default { extraDependencies: ['html', 'language'], - query(artist) { + query(artist, filterWikiEditorCommentary) { const processEntry = ({ thing, entry, @@ -87,6 +87,12 @@ export default { .flatMap(thing => thing.commentary .filter(entry => entry.artists.includes(artist)) + + .filter(({annotation}) => + (filterWikiEditorCommentary + ? annotation?.startsWith(`wiki editor`) + : !annotation?.startsWith(`wiki editor`))) + .map(entry => processEntry({thing, entry}))); const processAlbumEntries = ({albums}) => @@ -146,7 +152,7 @@ export default { return {chunks}; }, - relations: (relation, query) => ({ + relations: (relation, query, _artist, filterWikiEditorCommentary) => ({ chunks: query.chunks .map(() => relation('generateArtistInfoPageChunk')), @@ -179,10 +185,13 @@ export default { query.chunks .map(({chunk}) => chunk .map(({annotation}) => - relation('transformContent', annotation))), + relation('transformContent', + (filterWikiEditorCommentary + ? annotation?.replace(/^wiki editor(, )?/, '') + : annotation)))), }), - data: (query) => ({ + data: (query, _artist, _filterWikiEditorCommentary) => ({ chunkTypes: query.chunks .map(({chunkType}) => chunkType), diff --git a/src/strings-default.yaml b/src/strings-default.yaml index c63faeb5..9a2b26b7 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -1247,6 +1247,9 @@ artistPage: wikiEditArtworks: >- {ARTIST} has edited these artworks for this wiki: + wikiEditorCommentary: >- + {ARTIST} has written these commentary entries as an editor of this wiki: + # # artistGalleryPage: # The artist gallery page shows a neat grid of all of the album and From ac52cbf1692746c9bf96d79c5f15b27911df300c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Feb 2025 13:50:19 -0400 Subject: [PATCH 3/4] content: generateArtistInfoPage: for this wiki subheadings --- .../dependencies/generateArtistInfoPage.js | 30 ++++++++++++------- src/strings-default.yaml | 10 ++++--- 2 files changed, 26 insertions(+), 14 deletions(-) diff --git a/src/content/dependencies/generateArtistInfoPage.js b/src/content/dependencies/generateArtistInfoPage.js index 860e790d..9701341b 100644 --- a/src/content/dependencies/generateArtistInfoPage.js +++ b/src/content/dependencies/generateArtistInfoPage.js @@ -353,12 +353,17 @@ export default { }), html.tags([ - html.tag('p', - {[html.onlyIfSiblings]: true}, + language.encapsulate(pageCapsule, 'wikiEditArtworks', capsule => + relations.contentHeading.clone() + .slots({ + tag: 'p', - language.$(pageCapsule, 'wikiEditArtworks', { - artist: data.name, - })), + title: + language.$(capsule, {artist: data.name}), + + stickyTitle: + language.$(capsule, 'sticky'), + })), relations.editsForWikiArtworksChunkedList, ]), @@ -386,12 +391,17 @@ export default { relations.commentaryChunkedList, html.tags([ - html.tag('p', - {[html.onlyIfSiblings]: true}, + language.encapsulate(pageCapsule, 'wikiEditorCommentary', capsule => + relations.contentHeading.clone() + .slots({ + tag: 'p', - language.$(pageCapsule, 'wikiEditorCommentary', { - artist: data.name, - })), + title: + language.$(capsule, {artist: data.name}), + + stickyTitle: + language.$(capsule, 'sticky'), + })), relations.wikiEditorCommentaryChunkedList, ]), diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 9a2b26b7..4a7c6675 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -1244,11 +1244,13 @@ artistPage: orBrowseList: "View {LINK}! Or browse the list:" link: "art gallery" - wikiEditArtworks: >- - {ARTIST} has edited these artworks for this wiki: + wikiEditArtworks: + _: "{ARTIST} has edited these artworks for this wiki:" + sticky: "Artworks — edited for this wiki" - wikiEditorCommentary: >- - {ARTIST} has written these commentary entries as an editor of this wiki: + wikiEditorCommentary: + _: "{ARTIST} has written these commentary entries as an editor of this wiki:" + sticky: "Commentary — written for this wiki" # # artistGalleryPage: From 2cd8c5b4b7a9e674900cdecfeee7c3bd850124bd Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Feb 2025 13:50:33 -0400 Subject: [PATCH 4/4] content: generateTrackInfoPage: group subheadings nicer strings --- src/strings-default.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/strings-default.yaml b/src/strings-default.yaml index 4a7c6675..a3f997ee 100644 --- a/src/strings-default.yaml +++ b/src/strings-default.yaml @@ -291,16 +291,16 @@ releaseInfo: sticky: _: "Tracks that reference this one:" - fromGroup: "Tracks from {GROUP} that reference this one:" - fromOther: "Tracks from somewhere else that reference this one:" + fromGroup: "Tracks that reference this one — from {GROUP}:" + fromOther: "Tracks that reference this one — from somewhere else:" tracksThatSample: _: "Tracks that sample {TRACK}:" sticky: _: "Tracks that sample this one:" - fromGroup: "Tracks from {GROUP} that sample this one:" - fromOther: "Tracks from somewhere else that sample this one:" + fromGroup: "Tracks that sample this one — from {GROUP}:" + fromOther: "Tracks that sample this one — from somewhere else:" flashesThatFeature: _: "Flashes & games that feature {TRACK}:"