mbox series

[bug#68680,mumi,v2,0/3] Add a button to copy a message Message-ID to the clipboard.

Message ID 20240125170042.12022-1-maxim.cournoyer@gmail.com
Headers show
Series Add a button to copy a message Message-ID to the clipboard. | expand

Message

Maxim Cournoyer Jan. 25, 2024, 5 p.m. UTC
This series adds a new HTML element to each message header to easily
copy the Message-ID of a message into the clipboard.  It makes use of
the (already included) Pico CSS library for tooltips and some new
JavaScript event handler.  The motivation was to make it easier to
retrieve the Message-ID for passing it to the 'b4 shazam' command when
applying long patches series.

Changes in v2:
 - Add timestamp to CSS and JavaScript file names to force reload

Maxim Cournoyer (3):
  README.org: Add new sections to help newcomers get started.
  .gitignore: Register mumi.xapian and signing-key files.
  html: Add a button to copy a Message-ID to the clipboard.

 .gitignore              |  2 ++
 README.org              | 24 ++++++++++++++++++++++
 assets/js/mumi.js       | 31 ++++++++++++++++++++++++++++-
 assets/mumi.scss        | 23 ++++++++++++++++++---
 mumi/web/view/html.scm  | 24 ++++++++++++++++------
 mumi/web/view/utils.scm | 44 +++++++++++++++++++++++++++--------------
 6 files changed, 123 insertions(+), 25 deletions(-)


base-commit: 025fc600f1cb4c73042bf920aee3e07d5fb9c53a

Comments

Arun Isaac Jan. 26, 2024, 9:21 p.m. UTC | #1
> Changes in v2:
>  - Add timestamp to CSS and JavaScript file names to force reload

Do we need to have timestamps on the CSS and JS filenames? If we
configured nginx to serve these static files, wouldn't caching and
reloading be handled automatically via the ETag or Last-Modified
headers?
Arun Isaac Jan. 26, 2024, 9:24 p.m. UTC | #2
Looks good to me otherwise. The patch running on berlin actually
works. So, all is well, I guess!
Maxim Cournoyer Jan. 27, 2024, 3:04 a.m. UTC | #3
Hi,

Arun Isaac <arunisaac@systemreboot.net> writes:

>> Changes in v2:
>>  - Add timestamp to CSS and JavaScript file names to force reload
>
> Do we need to have timestamps on the CSS and JS filenames? If we
> configured nginx to serve these static files, wouldn't caching and
> reloading be handled automatically via the ETag or Last-Modified
> headers?

I haven't looked at our nginx configuration, but currently the js and
css files were not reloaded without this hack, no.
Maxim Cournoyer Jan. 27, 2024, 3:57 a.m. UTC | #4
Hi Arun,

Arun Isaac <arunisaac@systemreboot.net> writes:

> Looks good to me otherwise. The patch running on berlin actually
> works. So, all is well, I guess!

Great!  I'll bump mumi's version to 0.0.6 and update the package in
Guix.
Arun Isaac Jan. 27, 2024, 10:06 a.m. UTC | #5
> I haven't looked at our nginx configuration, but currently the js and
> css files were not reloaded without this hack, no.

Ok, maybe for another time, then. But, we should handle this kind of
thing in the nginx configuration of the mumi service.

Thank you for the patchset. Much appreciated! :-)
Ricardo Wurmus Jan. 27, 2024, 12:20 p.m. UTC | #6
Arun Isaac <arunisaac@systemreboot.net> writes:

>> I haven't looked at our nginx configuration, but currently the js and
>> css files were not reloaded without this hack, no.
>
> Ok, maybe for another time, then. But, we should handle this kind of
> thing in the nginx configuration of the mumi service.

I think we used to have (and maybe still have) a problem with caching
files that are served from the store with a zero timestamp.
Arun Isaac Jan. 29, 2024, 11:41 p.m. UTC | #7
> I think we used to have (and maybe still have) a problem with caching
> files that are served from the store with a zero timestamp.

Oh my, I forgot about the store. That's a bummer. We should workaround
this[1] with some other non-timestamp based caching strategy. Perhaps we
can set a max-age using the Cache-Control
header. https://developer.mozilla.org/en-US/docs/Web/HTTP/Caching#fresh_and_stale_based_on_age

[1]: later, and not part of this issue