Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: svg spritesheet for dir-index-html listings #71

Open
SgtPooki opened this issue Feb 7, 2025 · 1 comment
Open

feat: svg spritesheet for dir-index-html listings #71

SgtPooki opened this issue Feb 7, 2025 · 1 comment
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked

Comments

@SgtPooki
Copy link
Member

SgtPooki commented Feb 7, 2025

ipfs.io and kubo use SVG images as data uris, and we want to add dir-index-html listings to service-worker-gateway as well.

We could create a spritesheet and add to this repo and pull in from both kubo and service-worker-gateway:

<!-- Sprite (external or inline once on the page) -->
<svg style="display: none;">
  <symbol id="icon-audio" viewBox="0 0 24 24"> ... </symbol>
  <symbol id="icon-video" viewBox="0 0 24 24"> ... </symbol>
  <!-- etc. -->
</svg>

<!-- Then reference each in HTML (or mask background in CSS): -->
<svg class="icon-audio"><use xlink:href="#icon-audio"></use></svg>

Or we could create these svgs as individual files and then retrieve from CDN (or ipfs.io gateway).

References

@SgtPooki SgtPooki added the need/triage Needs initial labeling and prioritization label Feb 7, 2025
@lidel
Copy link
Member

lidel commented Feb 7, 2025

Sprite for filetype sounds very good, cuts down the number of requests/blocks.

However obligatory sidenote: be very careful with reliance on "retrieve from CDN or third-party gateway".

Mind that people use IPFS in private contexts (including private DHTs, private clusters and PNET) or can't depend on regular DNS system, and we have to design things with that as lowest common denominator in mind.

If Kubo generates HTML for dir-index-html listings and that HTML triggers fetching assets from external URLs it would break once DNS is censored, and/or be leaking the existence of private IPFS instances, and if implementers are not careful, including browsing history (by means of Referer and subdomain gateway domains etc).

So what we want is a sprite (to minimize the number of requests/assets/blocks), but implementations likely need to embed ipfs-css or fetch it from local gateway, similar how ipfs-webui works today (kubo has hardcoded CID, desktop bundles it with app).

@SgtPooki SgtPooki added kind/enhancement A net-new feature or improvement to an existing feature help wanted Seeking public contribution on this issue good first issue Good issue for new contributors dif/easy Someone with a little familiarity can pick up P3 Low: Not priority right now effort/hours Estimated to take one or several hours status/ready Ready to be worked and removed need/triage Needs initial labeling and prioritization labels Mar 11, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
dif/easy Someone with a little familiarity can pick up effort/hours Estimated to take one or several hours good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now status/ready Ready to be worked
Projects
None yet
Development

No branches or pull requests

2 participants