Skip to content

fix: logo and some improvements#2397

Merged
bajrangCoder merged 3 commits into
lazy-load-thingsfrom
laz-load-things/fix
Jun 26, 2026
Merged

fix: logo and some improvements#2397
bajrangCoder merged 3 commits into
lazy-load-thingsfrom
laz-load-things/fix

Conversation

@deadlyjack

Copy link
Copy Markdown
Member

No description provided.

@greptile-apps

greptile-apps Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR replaces the animated <Logo /> component on the welcome page with a plain <img> tag that inlines the logo PNG as a base64 data URL (using a new ?inline rspack loader rule), and refactors getSearchKeyword to correctly handle dotfiles like .gitignore by extracting the name after the leading dot when no file extension is present.

  • Welcome page logo: The Logo component is replaced by <img src={logoSrc} alt="" /> with logoSrc imported via ?inline. Related SCSS pseudo-element styles are cleaned up and dimensions adjusted. A new rspack rule for asset/inline is added, and the existing asset/resource rule is updated to exclude ?inline assets.
  • Language mode keyword refactor: getSearchKeyword is renamed to getLanguageModeRecommendationSearchKeyword, exported, and now uses Path.basename before extracting the extension, with a new fallback for dotfiles. Three new unit tests cover the key cases.
  • Loader style tweaks: The dialog loader shrinks from 30 px to 24 px, switches to --popup-active-color, and its right margin is removed.

Confidence Score: 5/5

Safe to merge — all changes are isolated UI and utility improvements with no impact on data handling or critical paths.

The logo swap is a straightforward asset-inlining change, the keyword extraction refactor is well-tested and handles edge cases correctly, and the dialog style tweaks are cosmetic. The only thing worth a second look is that src/dialogs/style.scss loses its trailing newline while other files in the same PR gain theirs.

src/dialogs/style.scss — missing newline at end of file.

Important Files Changed

Filename Overview
rspack.config.js Adds a new asset/inline rule for image assets when loaded with the ?inline query, and updates the existing asset/resource rule to exclude ?inline files. Clean, standard webpack/rspack pattern.
src/components/logo/style.scss Adds missing newline at end of file. Trivial fix.
src/dialogs/style.scss Updates loader size (30→24px), color variable (--primary-color→--popup-active-color), and margin (symmetric→left-only). Incidentally removes the existing newline at end of file, regressing the file's formatting while other files in this PR gain their missing newlines.
src/lib/languageModeRecommendations.js Renames and exports getSearchKeywordgetLanguageModeRecommendationSearchKeyword; adds dotfile support (.gitignore"gitignore") by using Path.basename and falling back to basename.slice(1) when no extension is present. Logic is correct for all key edge cases.
src/pages/welcome/welcome.js Replaces the <Logo /> component with a plain <img> using the logo PNG inlined as a base64 data URL via ?inline. The alt="" attribute is appropriate for a decorative logo alongside text.
src/pages/welcome/welcome.scss Removes pseudo-element styles (::before/::after) that were tied to the old Logo component and adjusts .logo dimensions for the plain <img> tag. The responsive breakpoint omits height: auto but that is the browser default for images, so no functional issue.
src/test/sanity.tests.js Adds three well-chosen unit tests for the refactored keyword extraction function covering dotfiles, normal extensions, and extensionless non-dotfiles.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["getLanguageModeRecommendationSearchKeyword(filename)"] --> B["basename = Path.basename(filename).trim().toLowerCase()"]
    B --> C["ext = Path.extname(basename).replace(/^\./, '').trim().toLowerCase()"]
    C --> D{ext is non-empty?}
    D -- Yes --> E["keyword = ext\n(e.g. 'js', 'py')"]
    D -- No --> F{basename starts with '.'?}
    F -- Yes --> G["keyword = basename.slice(1)\n(e.g. '.gitignore' → 'gitignore')"]
    F -- No --> H["keyword = ''\n(e.g. 'README' → '')"]
    E --> I{regex test passes?}
    G --> I
    H --> I
    I -- Yes --> J["return keyword"]
    I -- No --> K["return ''"]
Loading
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
    A["getLanguageModeRecommendationSearchKeyword(filename)"] --> B["basename = Path.basename(filename).trim().toLowerCase()"]
    B --> C["ext = Path.extname(basename).replace(/^\./, '').trim().toLowerCase()"]
    C --> D{ext is non-empty?}
    D -- Yes --> E["keyword = ext\n(e.g. 'js', 'py')"]
    D -- No --> F{basename starts with '.'?}
    F -- Yes --> G["keyword = basename.slice(1)\n(e.g. '.gitignore' → 'gitignore')"]
    F -- No --> H["keyword = ''\n(e.g. 'README' → '')"]
    E --> I{regex test passes?}
    G --> I
    H --> I
    I -- Yes --> J["return keyword"]
    I -- No --> K["return ''"]
Loading

Reviews (1): Last reviewed commit: "fix: logo and some improvements" | Re-trigger Greptile

Comment thread src/dialogs/style.scss Outdated
@bajrangCoder bajrangCoder merged commit 5320e7d into lazy-load-things Jun 26, 2026
9 checks passed
@bajrangCoder bajrangCoder deleted the laz-load-things/fix branch June 26, 2026 11:54
@github-project-automation github-project-automation Bot moved this from Backlog to Done in The Code Board - Acode Jun 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants