mirror of
https://github.com/coder/coder.git
synced 2026-09-22 13:10:21 +08:00
The bundled `/icon/rstudio.svg` rendered the R language logo (gray oval, blue R), not the RStudio IDE logo, so templates using the `rstudio` `coder_app` and the bundled URL got the wrong artwork ([#26211](https://github.com/coder/coder/issues/26211), PRODUCT-383). This PR: - Renames the existing `rstudio.svg` (R language logo) to `rproject.svg` so the artwork stays available for templates that want it. - Adds a new `rstudio.svg` containing the actual RStudio R-ball logo, extracted from the [Wikimedia source](https://upload.wikimedia.org/wikipedia/commons/d/d0/RStudio_logo_flat.svg) and normalized to `viewBox="0 0 256 256"` to match the rest of the icon set. - Adds `rproject.svg` to `site/src/theme/icons.json` so it appears in the icon picker and gallery alongside `rstudio.svg`. - Switches the `coder_app "rstudio"` example in `docs/admin/templates/extending-templates/web-ides.md` to reference `/icon/rstudio.svg` (and corrects `display_name` to `"RStudio"`), matching every other example on that page. | Path | Before | After | | --- | --- | --- | | `/icon/rstudio.svg` | R language logo | RStudio R-ball | | `/icon/rproject.svg` | (did not exist) | R language logo | <table> <tr> <th>Old <code>rstudio.svg</code> → new <code>rproject.svg</code></th> <th>New <code>rstudio.svg</code></th> </tr> <tr> <td align="center"><img src="https://raw.githubusercontent.com/coder/coder/vigilante/product-383-bundled-iconrstudiosvg-appears-to-show-r-language-logo/site/static/icon/rproject.svg" width="128" height="128"></td> <td align="center"><img src="https://raw.githubusercontent.com/coder/coder/vigilante/product-383-bundled-iconrstudiosvg-appears-to-show-r-language-logo/site/static/icon/rstudio.svg" width="128" height="128"></td> </tr> </table> **Breaking-change note.** Templates that referenced `/icon/rstudio.svg` expecting the R language oval will now render the RStudio R-ball. Templates that want the R language logo should switch to `/icon/rproject.svg`. The Linear issue acknowledges this tradeoff. **Client cache caveat.** `site/site.go` serves everything under `/icon/` with `Cache-Control: public, max-age=31536000, immutable`, so any browser that already loaded the old artwork at `/icon/rstudio.svg` can keep displaying it for up to a year before revalidating. A hard refresh (Ctrl/Cmd+Shift+R) clears it immediately. Cache-busting (hashed icon URLs) is out of scope for this fix and tracked as a possible follow-up against PRODUCT-383. <details> <summary>Implementation notes</summary> - Verified geometric fidelity by rendering the new SVG and a high-resolution crop of the Wikimedia source at 256x256 and computing the RMS pixel difference: 1.268/255 (~0.5%, essentially antialiasing noise). - Picked `viewBox="0 0 256 256"` because 139 of 142 SVGs in `site/static/icon/` already use that viewBox. - Searched the repo for `rstudio.svg` references: the only direct one is `site/src/theme/icons.json`. The docs file references the `rstudio` `coder_app` slug, not the icon path, so the rename does not break any callsite. - R-ball geometry: source circle at (318.7, 312.9) radius 309.8 in the original `viewBox 0 0 1784.1 625.9`. Translating by (-8.9, -3.1) and scaling by 256/619.6 maps its bounding box onto `0 0 256 256`. Path coordinates are pre-computed so the file ships with no transform layer. - Pre-commit hooks passed locally, including `lint/site-icons`. </details> Fixes #26211 Fixes PRODUCT-383 --- _Generated by Coder Agents on behalf of @nickvigilante._