-
-
Notifications
You must be signed in to change notification settings - Fork 414
perf(website): optimize font loading and asset organization #1089
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Replace font blocking load with preload strategy for better performance - Add noscript fallback for Google Fonts - Create symlink to centralize asset management (git-assets -> ../../../asset) - Update documentation image paths to use local assets - Remove unused logo-titled.svg and contributors.svg files - Add font fallback stack for better compatibility
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughUpdates website asset references from external URLs to local paths across docs, adds a git-assets mapping, adjusts CSS font stack, and changes Astro head config to preload IBM Plex Mono with a noscript fallback. No public API changes. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor Browser as Browser
participant Head as Document Head
participant Preload as Preload Link
participant Stylesheet as Stylesheet Resource
Note over Head,Preload: Insert preload for IBM Plex Mono (as="style")
Browser->>Head: Request page
Head->>Preload: Add <link rel="preload" as="style" onload="this.rel='stylesheet'">
Preload-->>Head: onload
Head->>Preload: rel -> "stylesheet"
Preload->>Stylesheet: Apply styles
alt JS disabled (noscript)
Note over Head,Stylesheet: noscript fallback loads stylesheet directly
Browser->>Stylesheet: Load via <noscript><link rel="stylesheet"></noscript>
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
website/src/content/docs/overview.md (1)
9-9: Add descriptive alt text for accessibility (MD045).Current image lacks alt text. Use a concise description.
Apply this diff:
- +website/src/assets/git-assets (1)
1-1: Double-check naming consistency:assetvsassets.This symlink points to
../../../asset(singular), while many projects (and your docs paths) useassets. If the canonical directory is actuallyassets/, update the target; otherwise ensure doc references and tooling consistently expectasset/.website/astro.config.mjs (1)
72-81: Excellent font loading optimization strategy!The preload strategy with JavaScript-based rel switching and noscript fallback is a modern best practice for Google Fonts. This approach eliminates Flash of Invisible Text (FOIT) while maintaining optimal loading performance.
Minor enhancement suggestion: Consider adding
&display=swapto the Google Fonts URL for additional browser compatibility, as this provides native font-display support:{ tag: 'link', attrs: { rel: 'preload', - href: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap', + href: 'https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap', as: 'style', onload: "this.onload=null;this.rel='stylesheet'", }, }, { tag: 'noscript', - content: '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap">', + content: '<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@500;600&display=swap">', },
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
asset/contributors.svgis excluded by!**/*.svgwebsite/src/assets/logo-titled.svgis excluded by!**/*.svg
📒 Files selected for processing (6)
website/astro.config.mjs(1 hunks)website/src/assets/git-assets(1 hunks)website/src/content/docs/getting-started/tutorial.md(2 hunks)website/src/content/docs/list/theme-list.md(1 hunks)website/src/content/docs/overview.md(1 hunks)website/src/styles/custom.css(1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: lazysegtree
PR: yorukot/superfile#0
File: :0-0
Timestamp: 2025-04-12T12:00:32.688Z
Learning: In PR #767 for yorukot/superfile, the focus is on moving code (especially sidebar-related functionality) to a more organized structure without changing functionality. Pre-existing issues should be ignored since the purpose is code reorganization, not fixing existing problems.
🪛 markdownlint-cli2 (0.18.1)
website/src/content/docs/overview.md
9-9: Images should have alternate text (alt text)
(MD045, no-alt-text)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Build and Test (ubuntu-latest)
- GitHub Check: Build and Test (windows-latest)
- GitHub Check: Analyze (go)
🔇 Additional comments (4)
website/src/assets/git-assets (1)
1-1: Ensure git symlink and referenced assets exist
- website/src/assets/git-assets is committed as a Git symlink (mode=120000).
- Symlink target in git: '../../../asset' → resolves to /home/jailuser/git/asset.
- Markdown references found under website/src/content to assets/git-assets/* (unique):
- assets/git-assets/demo.png
- assets/git-assets/prompt_shell_mode.png
- assets/git-assets/prompt_spf_mode.png
- assets/git-assets/theme/0x96f.png
- assets/git-assets/theme/ayu-dark.png
- assets/git-assets/theme/blood.png
- assets/git-assets/theme/catppuccin-frappe.png
- assets/git-assets/theme/catppuccin-latte.png
- assets/git-assets/theme/catppuccin-macchiato.png
- assets/git-assets/theme/catppuccin.png
- assets/git-assets/theme/dracula.png
- assets/git-assets/theme/everforest-dark-medium.png
- assets/git-assets/theme/gruvbox-dark-hard.png
- assets/git-assets/theme/gruvbox.png
- assets/git-assets/theme/hacks.png
- assets/git-assets/theme/kaolin.png
- assets/git-assets/theme/monokai.png
- assets/git-assets/theme/nord.png
- assets/git-assets/theme/onedark.png
- assets/git-assets/theme/poimandres.png
- assets/git-assets/theme/rose-pine.png
- assets/git-assets/theme/sugarplum.png
- assets/git-assets/theme/tokyonight.png
- Automated validation aborted due to a script error before confirming each referenced file exists under the target. Confirm that each listed file is present under /home/jailuser/git/asset (repo_root/asset) or run a corrected verification script to validate them.
website/src/content/docs/list/theme-list.md (1)
17-169: Asset localization looks good!The migration from external GitHub raw URLs to local asset paths (
../../../assets/git-assets/theme/*.png) is a solid improvement for performance and reliability. This eliminates external dependencies and potential broken links.website/src/styles/custom.css (1)
2-2: Robust font fallback stack implementation!The extended font-family stack provides excellent cross-platform compatibility and aligns perfectly with the preload strategy in the Astro config. The fallback fonts are well-chosen system fonts that closely match IBM Plex Mono's characteristics, minimizing layout shift during font swapping.
website/src/content/docs/getting-started/tutorial.md (1)
184-195: Consistent asset localization applied correctly.The image path changes from external GitHub URLs to local assets (
../../../assets/git-assets/*.png) maintain consistency with the broader asset migration strategy across the documentation.
Improve accessibility by adding descriptive alt text to all theme preview images and the main demo image for better screen reader support and SEO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
website/src/content/docs/list/theme-list.md (4)
17-17: Alt text added—nice. Consider trimming repetition.Each alt starts with “ theme preview showing…”. For brevity and screen reader UX, consider concise descriptions (e.g., “ — dark palette with blue accents”). Optional.
Also applies to: 25-25, 33-33, 41-41, 49-49, 57-57, 65-65, 73-73, 81-81, 89-89, 97-97, 105-105, 113-113, 121-121, 129-129, 137-137, 145-145, 153-153, 161-161, 169-169
14-15: Fix markdownlint MD034 (bare URLs).Wrap bare URLs in angle brackets or convert to markdown links. Minimal change uses angle brackets:
Apply pattern to all instances (example shown for Lines 14–15):
- - Ported by: https://github.com/filipjanevski - - Original Author: https://github.com/filipjanevski/ + - Ported by: <https://github.com/filipjanevski> + - Original Author: <https://github.com/filipjanevski/>Or use links with labels:
- - Ported by: https://github.com/filipjanevski + - Ported by: [@filipjanevski](https://github.com/filipjanevski)Also applies to: 22-23, 30-31, 38-39, 46-47, 54-55, 62-63, 70-71, 78-79, 86-87, 94-95, 102-103, 110-111, 118-119, 126-127, 134-135, 142-143, 150-151, 158-159, 166-167
110-110: Likely username typo in Kaolin “Ported by”.“AnshumqanNeon” looks like a misspelling of “AnshumanNeon”.
- - Ported by: https://github.com/AnshumqanNeon + - Ported by: <https://github.com/AnshumanNeon>
17-17: Optional perf: ship lighter previews (WebP/AVIF) with PNG fallback.If these are large PNGs, consider converting to WebP/AVIF and linking the smaller asset to cut docs payload size. Keep PNGs as fallback if needed. Out of scope OK.
Also applies to: 25-25, 33-33, 41-41, 49-49, 57-57, 65-65, 73-73, 81-81, 89-89, 97-97, 105-105, 113-113, 121-121, 129-129, 137-137, 145-145, 153-153, 161-161, 169-169
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
website/src/content/docs/list/theme-list.md(1 hunks)website/src/content/docs/overview.md(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- website/src/content/docs/overview.md
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: lazysegtree
PR: yorukot/superfile#0
File: :0-0
Timestamp: 2025-04-12T12:00:32.688Z
Learning: In PR #767 for yorukot/superfile, the focus is on moving code (especially sidebar-related functionality) to a more organized structure without changing functionality. Pre-existing issues should be ignored since the purpose is code reorganization, not fixing existing problems.
🪛 markdownlint-cli2 (0.18.1)
website/src/content/docs/list/theme-list.md
22-22: Bare URL used
(MD034, no-bare-urls)
23-23: Bare URL used
(MD034, no-bare-urls)
30-30: Bare URL used
(MD034, no-bare-urls)
31-31: Bare URL used
(MD034, no-bare-urls)
38-38: Bare URL used
(MD034, no-bare-urls)
39-39: Bare URL used
(MD034, no-bare-urls)
46-46: Bare URL used
(MD034, no-bare-urls)
47-47: Bare URL used
(MD034, no-bare-urls)
54-54: Bare URL used
(MD034, no-bare-urls)
55-55: Bare URL used
(MD034, no-bare-urls)
62-62: Bare URL used
(MD034, no-bare-urls)
63-63: Bare URL used
(MD034, no-bare-urls)
70-70: Bare URL used
(MD034, no-bare-urls)
71-71: Bare URL used
(MD034, no-bare-urls)
78-78: Bare URL used
(MD034, no-bare-urls)
79-79: Bare URL used
(MD034, no-bare-urls)
86-86: Bare URL used
(MD034, no-bare-urls)
87-87: Bare URL used
(MD034, no-bare-urls)
94-94: Bare URL used
(MD034, no-bare-urls)
95-95: Bare URL used
(MD034, no-bare-urls)
102-102: Bare URL used
(MD034, no-bare-urls)
103-103: Bare URL used
(MD034, no-bare-urls)
110-110: Bare URL used
(MD034, no-bare-urls)
111-111: Bare URL used
(MD034, no-bare-urls)
118-118: Bare URL used
(MD034, no-bare-urls)
119-119: Bare URL used
(MD034, no-bare-urls)
126-126: Bare URL used
(MD034, no-bare-urls)
127-127: Bare URL used
(MD034, no-bare-urls)
134-134: Bare URL used
(MD034, no-bare-urls)
135-135: Bare URL used
(MD034, no-bare-urls)
142-142: Bare URL used
(MD034, no-bare-urls)
143-143: Bare URL used
(MD034, no-bare-urls)
150-150: Bare URL used
(MD034, no-bare-urls)
151-151: Bare URL used
(MD034, no-bare-urls)
158-158: Bare URL used
(MD034, no-bare-urls)
159-159: Bare URL used
(MD034, no-bare-urls)
166-166: Bare URL used
(MD034, no-bare-urls)
167-167: Bare URL used
(MD034, no-bare-urls)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Build and Test (ubuntu-latest)
- GitHub Check: Analyze (go)
🔇 Additional comments (1)
website/src/content/docs/list/theme-list.md (1)
17-17: Verify image paths & assets symlinkConfirm website/src/assets/git-assets exists (symlink preserved by CI) and that every ../../../assets/git-assets/... image referenced from website/src/content/docs/list/theme-list.md resolves (no missing files or broken previews). This also applies to the other image lines in the file.
lazysegtree
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [yorukot/superfile](https://github.com/yorukot/superfile) | minor | `v1.3.3` -> `v1.4.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>yorukot/superfile (yorukot/superfile)</summary> ### [`v1.4.0`](https://github.com/yorukot/superfile/releases/tag/v1.4.0) [Compare Source](yorukot/superfile@v1.3.3...v1.4.0) Hey folks. Releasing v1.4.0 with many new features, improvements, and bug fixes. We have an async file preview now, a zoxide panel, and various new features improving UX. #### Install: [**Click me to know how to install**](https://github.com/yorukot/superfile?tab=readme-ov-file#installation) #### Highlights - We have the Zoxide Panel now. Ensure zoxide is installed on your system, set `zoxide_support` to `true` in the config, and press `z` to use zoxide. <img width="645" height="295" alt="Image" src="https://github.com/user-attachments/assets/238f6549-5318-49d1-a3a0-14cf8a686955" /> - File previewing is now async, meaning reduced lag while scrolling through images, or on slow systems. - Many bug fixes. See 'Detailed Change Summary' ##### Internal Updates - Most file operations are now truly async with the usage of the recommended `tea.Cmd` pattern. - Enabled many new linters to improve code quality. - Moved golangci-lint to v2. Now developers don't need to keep the old v1 in their systems. - Refactored file preview in its own package for better maintainability and readability. - Fixed flaky unit tests. #### Detailed Change Summary <details><summary>Details</summary> <p> ##### Update - feat: File operation via tea cmd [#​963](yorukot/superfile#963) by @​lazysegtree - feat: processbar improvements, package separation, better channel management [#​973](yorukot/superfile#973) by @​lazysegtree - feat: enable lll and recvcheck linter, fix tests, more refactors [#​977](yorukot/superfile#977) by @​lazysegtree - feat: Remove channel for notification models [#​979](yorukot/superfile#979) by @​lazysegtree - feat: enable cyclop, funlen, gocognit, gocyclo linters, and refactor large functions [#​984](yorukot/superfile#984) by @​lazysegtree - feat: Add a new hotkey to handle cd-on-quit whenever needed [#​924](yorukot/superfile#924) by @​ahmed-habbachi - feat: added option to permanently delete files [#​987](yorukot/superfile#987) by @​hupender - feat: Preview panel separation [#​1021](yorukot/superfile#1021) by @​lazysegtree - feat: Add search functionality to help menu [#​1011](yorukot/superfile#1011) by @​iZarrios - feat: Use zoxide lib [#​1036](yorukot/superfile#1036) by @​lazysegtree - feat: Add zoxide directory tracking on navigation [#​1041](yorukot/superfile#1041) by @​lazysegtree - feat: Zoxide integration [#​1039](yorukot/superfile#1039) by @​lazysegtree - feat: Select mode with better feedback [#​1074](yorukot/superfile#1074) by @​lazysegtree - feat: owner/group in the metadata [#​1093](yorukot/superfile#1093) by @​xelavopelk - feat: Async zoxide [#​1104](yorukot/superfile#1104) by @​lazysegtree ##### Bug Fix - fix: sorting in searchbar [#​985](yorukot/superfile#985) by @​hupender - fix: Async rendering, Include clipboard check in paste items, and update linter configs [#​997](yorukot/superfile#997) by @​lazysegtree - fix: Move utility functions to utils package [#​1012](yorukot/superfile#1012) by @​lazysegtree - fix: Refactoring and separation of preview panel and searchbar in help menu [#​1013](yorukot/superfile#1013) by @​lazysegtree - fix(filePanel): allow focusType to be set correctly [#​1033](yorukot/superfile#1033) by @​faisal-990 - fix(ci): Update gomod2nix.toml, allow pre release in version output, release 1.4.0-rc1, bug fixes, and improvements [#​1054](yorukot/superfile#1054) by @​lazysegtree - fix(nix): resolve build failures in the nix flake [#​1068](yorukot/superfile#1068) by @​Frost-Phoenix - fix: Retry the file deletion to prevent flakies (#​938) [#​1076](yorukot/superfile#1076) by @​lazysegtree - fix(issue-1066): Fixed issue where enter was not searchable [#​1078](yorukot/superfile#1078) by @​Simpaqt - fix(#​1073): Tech debt fix [#​1077](yorukot/superfile#1077) by @​Simpaqt - fix: fix deleted directory not able to remove from pins (#​1067) [#​1081](yorukot/superfile#1081) by @​yorukot - fix: fix child process spawning attached [#​1084](yorukot/superfile#1084) by @​guemidiborhane - fix: always clear images when showing a FullScreenStyle [#​1094](yorukot/superfile#1094) by @​snikoletopoulos - fix: Allow j and k keys in zoxide [#​1102](yorukot/superfile#1102) by @​lazysegtree - fix: Zoxide improvements and 1.4.0-rc2 [#​1105](yorukot/superfile#1105) by @​lazysegtree - fix: rename cursor beginning on wrong character because of multiple dots in name (#​813) [#​1112](yorukot/superfile#1112) by @​SyedAsadK - fix: check and fix file panel scroll position on height changes [#​1095](yorukot/superfile#1095) by @​snikoletopoulos ##### Optimization - perf(website): optimize font loading and asset organization [#​1089](yorukot/superfile#1089) by @​yorukot ##### Documentation - docs: fix incorrect zoxide plugin config name [#​1049](yorukot/superfile#1049) by @​shree-xvi - docs(hotkeys): Fix typo in vimHotkeys.toml comments [#​1080](yorukot/superfile#1080) by @​wleoncio - docs: add section for core maintainers in README.md [#​1088](yorukot/superfile#1088) by @​yorukot - chore: add winget install instruction to readme and website [#​943](yorukot/superfile#943) by @​claykom ##### Dependencies - chore(deps): update dependency go to v1.25.0, golangci-lint to v2, golangci-lint actions to v8 [#​750](yorukot/superfile#750) by @​renovate[bot] - chore(deps): update amannn/action-semantic-pull-request action to v6 [#​1006](yorukot/superfile#1006) by @​renovate[bot] - chore(deps): update actions/first-interaction action to v3 [#​1005](yorukot/superfile#1005) by @​renovate[bot] - chore(deps): update actions/checkout action to v5 [#​1004](yorukot/superfile#1004) by @​renovate[bot] - chore(deps): bump astro from 5.10.1 to 5.12.8 [#​982](yorukot/superfile#982) by @​dependabot[bot] - fix(deps): update module golang.org/x/mod to v0.27.0 [#​989](yorukot/superfile#989) by @​renovate[bot] - fix(deps): update dependency @​expressive-code/plugin-collapsible-sections to v0.41.3 [#​990](yorukot/superfile#990) by @​renovate[bot] - fix(deps): update dependency sharp to v0.34.3 [#​992](yorukot/superfile#992) by @​renovate[bot] - fix(deps): update dependency @​expressive-code/plugin-line-numbers to v0.41.3 [#​991](yorukot/superfile#991) by @​renovate[bot] - chore(deps): update dependency go to v1.25.0 [#​994](yorukot/superfile#994) by @​renovate[bot] - fix(deps): update astro monorepo [#​995](yorukot/superfile#995) by @​renovate[bot] - fix(deps): update dependency @​astrojs/starlight to ^0.35.0 [#​1000](yorukot/superfile#1000) by @​renovate[bot] - fix(deps): update module github.com/urfave/cli/v3 to v3.4.1 [#​1001](yorukot/superfile#1001) by @​renovate[bot] - fix(deps): update module golang.org/x/text to v0.28.0 [#​1003](yorukot/superfile#1003) by @​renovate[bot] ##### Misc - chore: migrate from superfile.netlify.app to superfile.dev [#​1087](yorukot/superfile#1087) by @​yorukot - refactor(filepanel): replace filePanelFocusType with isFocused boolean [#​1040](yorukot/superfile#1040) by @​faisal-990 - refactor(ansi): Migrate from github.com/charmbracelet/x/exp/term/ansi to github.com/charmbracelet/x/ansi [#​1044](yorukot/superfile#1044) by @​faisal-990 - refactor: common operation on pinned directory file using PinnedManager [#​1085](yorukot/superfile#1085) by @​Manaswa-S - test: unit tests for pinned manager [#​1090](yorukot/superfile#1090) by @​Manaswa-S </p> </details> #### New Contributors * @​hupender made their first contribution in yorukot/superfile#985 * @​ahmed-habbachi made their first contribution in yorukot/superfile#924 * @​iZarrios made their first contribution in yorukot/superfile#1011 * @​faisal-990 made their first contribution in yorukot/superfile#1033 * @​shree-xvi made their first contribution in yorukot/superfile#1049 * @​Simpaqt made their first contribution in yorukot/superfile#1078 * @​wleoncio made their first contribution in yorukot/superfile#1080 * @​guemidiborhane made their first contribution in yorukot/superfile#1084 * @​Manaswa-S made their first contribution in yorukot/superfile#1085 * @​xelavopelk made their first contribution in yorukot/superfile#1093 * @​snikoletopoulos made their first contribution in yorukot/superfile#1094 * @​SyedAsadK made their first contribution in yorukot/superfile#1112 **Full Changelog**: <yorukot/superfile@v1.3.3...v1.4.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNDYuMCIsInVwZGF0ZWRJblZlciI6IjQxLjE0Ni4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Summary by CodeRabbit