News review in dark mode
News review in dark mode
It's bugged me for ages that the news preview in dark mode has been broken forever. Here's a patch to fix that, along with before/after screenshots.
Note that it does change more than just styles; it now uses an iframe and a hidden text area to properly isolate the styles from the email template and stop them leaking into the main page content.
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org
Re: News review in dark mode
От:
Álvaro Herrera <alvherre@kurilemu.de>
Дата:
On 2025-Nov-26, Dave Page wrote: > It's bugged me for ages that the news preview in dark mode has been broken > forever. Here's a patch to fix that, along with before/after screenshots. Oh, yes _please_, thank you very much. -- Álvaro Herrera Breisgau, Deutschland — https://www.EnterpriseDB.com/ "La grandeza es una experiencia transitoria. Nunca es consistente. Depende en gran parte de la imaginación humana creadora de mitos" (Irulan)
Re: News review in dark mode
On 11/26/25 9:50 AM, Álvaro Herrera wrote: > On 2025-Nov-26, Dave Page wrote: > >> It's bugged me for ages that the news preview in dark mode has been broken >> forever. Here's a patch to fix that, along with before/after screenshots. > > Oh, yes _please_, thank you very much. +1 for the feature. Code overall looks fine to me. I'd prefer if we could make the "try/catch" block be more discerning about opting to ignore the Cross-Origin error, but given the contents of the try block are benign, I wouldn't block the patch on that. Thanks, Jonathan
Re: News review in dark mode
От:
Dave Page <dpage@pgadmin.org>
Дата:
On Thu, 27 Nov 2025 at 16:04, Jonathan S. Katz <jkatz@postgresql.org> wrote:
On 11/26/25 9:50 AM, Álvaro Herrera wrote:
> On 2025-Nov-26, Dave Page wrote:
>
>> It's bugged me for ages that the news preview in dark mode has been broken
>> forever. Here's a patch to fix that, along with before/after screenshots.
>
> Oh, yes _please_, thank you very much.
+1 for the feature.
Code overall looks fine to me. I'd prefer if we could make the
"try/catch" block be more discerning about opting to ignore the
Cross-Origin error, but given the contents of the try block are benign,
I wouldn't block the patch on that.
Thanks - this has been pushed with a minor tweak to the catch block:
} catch (e) {
/* Only ignore SecurityError/cross-origin errors, rethrow others */
if (e.name !== 'SecurityError') {
throw e;
}
}
/* Only ignore SecurityError/cross-origin errors, rethrow others */
if (e.name !== 'SecurityError') {
throw e;
}
}
Dave Page
pgAdmin: https://www.pgadmin.org
PostgreSQL: https://www.postgresql.org