diff --git a/i18n/core/en.json b/i18n/core/en.json index 4f163330..67fb7b79 100644 --- a/i18n/core/en.json +++ b/i18n/core/en.json @@ -50,6 +50,7 @@ "deputy.session.row.history": "Open page history", "deputy.session.row.checkAll": "Mark all revisions as finished", "deputy.session.row.checkAll.confirm": "Mark all revisions as finished?", + "deputy.session.row.additionalComments": "Discussion", "deputy.session.row.closeComments": "Closing comments", "deputy.session.row.close.sigFound": "The closing comment had a signature. It will not be automatically removed when saved.", "deputy.session.row.close.sigFound.maybe": "The closing comment might have had a signature. It will not be automatically removed when saved.", diff --git a/src/css/deputy.css b/src/css/deputy.css index c6628bfc..abb14b74 100644 --- a/src/css/deputy.css +++ b/src/css/deputy.css @@ -206,6 +206,23 @@ p.dp-messageWidget-message { vertical-align: middle; } +.dp-cs-row-comments { + padding: 16px; + background-color: rgba(0, 159, 255, 10%); + margin: 4px 0; +} + +.dp-cs-row-comments > b { + letter-spacing: 0.1em; + font-weight: bold; + text-transform: uppercase; + color: rgba(0, 0, 0, 0.5); +} + +.dp-cs-row-comments hr { + border-color: rgb(0, 31, 51); +} + body.mediawiki.ltr .dp-cs-row-head > :not(:first-child):not(:last-child), body.mediawiki.ltr .dp-cs-row-head > :not(:first-child):not(:last-child) { margin-right: 16px; @@ -255,7 +272,7 @@ body.mediawiki.rtl .dp-cs-row-head > :not(:first-child):not(:last-child) { .dp-cs-row-content { padding: 16px; - background-color: rgba(0, 0, 0, 4%); + background-color: rgba(0, 0, 0, 6%); margin: 4px 0; } diff --git a/src/ui/root/DeputyContributionSurveyRow.tsx b/src/ui/root/DeputyContributionSurveyRow.tsx index bd575818..7ad74a33 100644 --- a/src/ui/root/DeputyContributionSurveyRow.tsx +++ b/src/ui/root/DeputyContributionSurveyRow.tsx @@ -71,6 +71,10 @@ export default class DeputyContributionSurveyRow extends EventTarget implements * The "LI" element that this row was rendered into by MediaWiki. */ originalElement?: HTMLLIElement; + /** + * Additional comments that may have been left by other editors. + */ + additionalComments: Element[]; /** * Original wikitext of this element. */ @@ -357,10 +361,85 @@ export default class DeputyContributionSurveyRow extends EventTarget implements super(); this.row = row; this.originalElement = originalElement; + this.additionalComments = this.extractAdditionalComments(); this.originalWikitext = originalWikitext; this.section = section; } + /** + * Extracts HTML elements which may be additional comments left by others. + * The general qualification for this is that it has to be a list block + * element that comes after the main line (in this case, it's detected after + * the last . + * This appears in the following form in wikitext: + * + * ``` + * * [[Page]] (...) [[Special:Diff/...|...]] + * *: Hello! <-- definition list block + * ** What!? <-- sub ul + * *# Yes. <-- sub ol + * * [[Page]] (...) [[Special:Diff/...|...]]
+