Skip to content

[BugFix] Adding missing public folder and images#82

Open
moda20 wants to merge 1 commit intomasterfrom
Improvement/name-change-update
Open

[BugFix] Adding missing public folder and images#82
moda20 wants to merge 1 commit intomasterfrom
Improvement/name-change-update

Conversation

@moda20
Copy link
Copy Markdown
Owner

@moda20 moda20 commented Mar 29, 2026

BugFixes :

  • Adding a public folder to properly hold assets and have them in the production build
  • Updating the logo url to reflect the change

Summary by CodeRabbit

  • Chores
    • Updated logo image asset paths to use the public directory structure instead of relative source references
    • Changes applied across the documentation and application components for improved consistency and asset management

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

📝 Walkthrough

Walkthrough

Two logo image paths have been updated from src/assets/images/ references to public/ directory references. The README.md logo path and the VersionSwitcher component's simplified logo path were both migrated to point to the public images directory instead of the source assets directory.

Changes

Cohort / File(s) Summary
Documentation Logo
README.md
Updated logo image source path from src/assets/images/TypeSchedulerLogo.png to public/images/TypeSchedulerLogo.png.
Component Logo
src/components/version-switcher.tsx
Updated logo <img> source from src/assets/images/TypeSchedulerLogoSimplified.png to /images/TypeSchedulerLogoSimplified.png.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Possibly related PRs

Poem

🐰 ✨ The logos have hopped from assets to public's delight,
From deep in the src, they now shine bright,
A path that's more public, a simpler way to see,
The scheduler's proud emblem, where it should be! 🎨

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions 'adding missing public folder and images', but the actual changes only update logo image paths in two files to reference the public folder—no evidence of creating or adding the public folder itself. Revise the title to accurately reflect the changes, such as 'Update logo paths to use public folder' or 'Move logo references to public folder', which better describes the actual modifications made.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Improvement/name-change-update

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a 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

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/components/version-switcher.tsx`:
- Line 27: The image src is hardcoded as
"/images/TypeSchedulerLogoSimplified.png" which breaks when the app base path
changes; update the src in the VersionSwitcher component's img element to build
the path from import.meta.env.BASE_URL (e.g., prefix the filename with
import.meta.env.BASE_URL + "images/TypeSchedulerLogoSimplified.png") so the logo
resolves correctly regardless of Vite base configuration.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2bdb27fe-3c6d-424a-b2f1-9e558ce52d2f

📥 Commits

Reviewing files that changed from the base of the PR and between 74a5ab9 and 493ae05.

⛔ Files ignored due to path filters (2)
  • public/images/TypeSchedulerLogo.png is excluded by !**/*.png
  • public/images/TypeSchedulerLogoSimplified.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • README.md
  • src/components/version-switcher.tsx

<div className="flex border-primary border-2 aspect-square size-12 items-center justify-center rounded-lg bg-white text-sidebar-primary-foreground">
<img
src="src/assets/images/TypeSchedulerLogoSimplified.png"
src="/images/TypeSchedulerLogoSimplified.png"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

In Vite, does using an absolute asset path like "/images/logo.png" bypass the configured base path in production builds, and is import.meta.env.BASE_URL the recommended approach for public assets?

💡 Result:

No, using an absolute asset path like "/images/logo.png" (intended for public dir assets) does not bypass the configured base path in production builds when the base is absolute (e.g., "/myapp/"). However, Vite does not automatically prepend the base to hardcoded absolute paths in source code like <img src="/images/logo.png"> or '/images/logo.png' in JS strings during build—these remain as "/images/logo.png", which resolves correctly only if base is "/" or relative, but fails for subpath deploys like "/myapp/" (actual path becomes "/myapp/images/logo.png"). This is evidenced by multiple GitHub issues and Stack Overflow reports where public assets fail to load under non-root base without manual adjustment. For imported assets (e.g., import logo from '/images/logo.png'), Vite resolves and processes them to respect the base. The recommended approach for public assets when needing base support (especially dynamic or non-root base) is to use import.meta.env.BASE_URL + '/images/logo.png' for string references, or prefer importing assets directly (which get hashed and base-adjusted automatically). Official docs recommend importing over public dir unless specific needs (no hashing, no import), and explicitly note using import.meta.env.BASE_URL for dynamic URL concatenation in production builds.

Citations:


🏁 Script executed:

# Check if this is a Vite project and find vite config
fd -e ts -e js -e json 'vite\.config|tsconfig|package\.json' | head -20

Repository: moda20/TypeSchedulerUI

Length of output: 144


🏁 Script executed:

# Search for hardcoded image paths in the codebase
rg '(src|href)=["'\'']/(images|assets|public)' --type jsx --type tsx --type js --type ts | head -20

Repository: moda20/TypeSchedulerUI

Length of output: 93


🏁 Script executed:

# Check the actual file context to understand the component better
cat -n src/components/version-switcher.tsx | head -50

Repository: moda20/TypeSchedulerUI

Length of output: 1503


🏁 Script executed:

# Check vite config for base path configuration
cat vite.config.ts

Repository: moda20/TypeSchedulerUI

Length of output: 505


🏁 Script executed:

# Search for all hardcoded /images paths to see if this is a pattern
rg '(src|href)=["'\'']/(images|assets|public)' -t ts -t tsx -A 2 -B 2

Repository: moda20/TypeSchedulerUI

Length of output: 93


🏁 Script executed:

# Check if there are other image imports/references using different patterns
rg 'TypeSchedulerLogoSimplified|/images/' -t ts -t tsx

Repository: moda20/TypeSchedulerUI

Length of output: 93


🏁 Script executed:

# Search for image references without strict type filtering
rg '(src|href)=.*/(images|assets|public)' -A 1 -B 1

Repository: moda20/TypeSchedulerUI

Length of output: 409


🏁 Script executed:

# Check if import.meta.env.BASE_URL is used anywhere in the codebase
rg 'import\.meta\.env\.BASE_URL'

Repository: moda20/TypeSchedulerUI

Length of output: 48


🏁 Script executed:

# Check public directory structure
ls -la public/ 2>/dev/null || echo "No public directory found"

Repository: moda20/TypeSchedulerUI

Length of output: 229


🏁 Script executed:

# Check if images directory exists
find . -type d -name images -o -type d -name assets 2>/dev/null | grep -v node_modules

Repository: moda20/TypeSchedulerUI

Length of output: 94


Use environment-aware asset paths for future deployment flexibility.

The hardcoded /images/ path works currently because vite.config.ts sets base: "/", but would break if the app is deployed under a subpath (e.g., base: "/myapp/"). Use import.meta.env.BASE_URL to ensure the logo loads correctly regardless of the base configuration.

Suggested fix
-              src="/images/TypeSchedulerLogoSimplified.png"
+              src={`${import.meta.env.BASE_URL}images/TypeSchedulerLogoSimplified.png`}
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
src="/images/TypeSchedulerLogoSimplified.png"
src={`${import.meta.env.BASE_URL}images/TypeSchedulerLogoSimplified.png`}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@src/components/version-switcher.tsx` at line 27, The image src is hardcoded
as "/images/TypeSchedulerLogoSimplified.png" which breaks when the app base path
changes; update the src in the VersionSwitcher component's img element to build
the path from import.meta.env.BASE_URL (e.g., prefix the filename with
import.meta.env.BASE_URL + "images/TypeSchedulerLogoSimplified.png") so the logo
resolves correctly regardless of Vite base configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant