Skip to content

Test/pr preview 3#164

Closed
Atharva0506 wants to merge 7 commits into
StabilityNexus:mainfrom
Atharva0506:test/pr-preview-3
Closed

Test/pr preview 3#164
Atharva0506 wants to merge 7 commits into
StabilityNexus:mainfrom
Atharva0506:test/pr-preview-3

Conversation

@Atharva0506

@Atharva0506 Atharva0506 commented Jun 10, 2026

Copy link
Copy Markdown
Member

Addressed Issues:

Fixes #(TODO:issue number)

Screenshots/Recordings:

TODO: If applicable, add screenshots or recordings that demonstrate the interface before and after the changes.

Additional Notes:

AI Usage Disclosure:

We encourage contributors to use AI tools responsibly when creating Pull Requests. While AI can be a valuable aid, it is essential to ensure that your contributions meet the task requirements, build successfully, include relevant tests, and pass all linters. Submissions that do not meet these standards may be closed without warning to maintain the quality and integrity of the project. Please take the time to understand the changes you are proposing and their impact. AI slop is strongly discouraged and may lead to banning and blocking. Do not spam our repos with AI slop.

Check one of the checkboxes below:

  • This PR does not contain AI-generated code at all.
  • This PR contains AI-generated code. I have read the AI Usage Policy and this PR complies with this policy. I have tested the code locally and I am responsible for it.

I have used the following AI models and tools: TODO

Checklist

  • My PR addresses a single issue, fixes a single bug or makes a single improvement.
  • My code follows the project's code style and conventions
  • If applicable, I have made corresponding changes or additions to the documentation
  • If applicable, I have made corresponding changes or additions to tests
  • My changes generate no new warnings or errors
  • I have joined the Discord server and I will share a link to this PR with the project maintainers there
  • I have read the Contribution Guidelines
  • Once I submit my PR, CodeRabbit AI will automatically review it and I will address CodeRabbit's comments.
  • I have filled this PR template completely and carefully, and I understand that my PR may be closed without review otherwise.

Summary by CodeRabbit

Release Notes

  • New Features

    • Automated preview deployments for pull requests to dedicated preview URLs
  • Bug Fixes

    • Updated asset references to resolve correctly across all deployment configurations
  • Performance

    • Optimized build output with vendor chunk splitting for faster load times

- Migrate production deploy from actions/deploy-pages API to gh-pages branch
  via peaceiris/actions-gh-pages (preserves pr-preview/ directories)
- Add new preview-pages.yml workflow for automated PR previews
  - Builds frontend with correct base path for subdirectory routing
  - Posts/updates PR comment with live preview URL
  - Cleans up preview directory when PR is closed or merged
- Fix 12+ hardcoded absolute image paths (src='/...') to use
  import.meta.env.BASE_URL for correct resolution in subdirectories
- Both workflows trigger only on frontend/** changes
- CNAME file automatically maintained by peaceiris action
- Shared concurrency group prevents gh-pages push race conditions
- deploy.yml triggers on 'development' instead of 'main'
- Uses dynamic repo name for base path (works on any fork)
- Removed CNAME (fork has no custom domain)
- Added workflow files to paths trigger for initial testing
- PR previews use correct base: /Chainvoice/pr-preview/pr-N/
…ectories

- Remove explicit basename from HashRouter in App.jsx (HashRouter does not need it and it broke root matching)
- Change absolute paths to relative in manifest.json
- Use %VITE_BASE_URL% in index.html for correct asset resolution
- Split monolithic 8MB+ bundle into vendor-specific chunks (mui, lit, web3, pdf, animation)
- Enables parallel downloading over HTTP/2, significantly speeding up PR previews and production loads
@coderabbitai

coderabbitai Bot commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 98a63190-8bc5-464b-b248-78c07ef6cc30

📥 Commits

Reviewing files that changed from the base of the PR and between a57c60e and b1b4a11.

📒 Files selected for processing (14)
  • .github/workflows/deploy.yml
  • .github/workflows/preview-pages.yml
  • frontend/public/manifest.json
  • frontend/src/App.jsx
  • frontend/src/components/InvoicePreview.jsx
  • frontend/src/components/Navbar.jsx
  • frontend/src/index.css
  • frontend/src/page/About.jsx
  • frontend/src/page/BatchPayment.jsx
  • frontend/src/page/Landing.jsx
  • frontend/src/page/ReceivedInvoice.jsx
  • frontend/src/page/SentInvoice.jsx
  • frontend/src/utils/generateInvoicePDF.js
  • frontend/vite.config.js

Walkthrough

This PR reconfigures frontend deployment and asset handling to support serving from a variable base path. The main deployment workflow switches from GitHub Pages artifacts to direct gh-pages branch deployment via peaceiris/actions-gh-pages with the trigger branch changed to development. A new PR preview workflow builds temporary preview deployments for each PR and cleans them up on closure. The frontend router, manifest, and all asset references are updated to use import.meta.env.BASE_URL instead of hardcoded absolute paths, enabling correct operation across multiple deployment roots. Build optimization adds vendor chunk splitting.

Changes

Subpath deployment and asset path migration

Layer / File(s) Summary
Main deployment workflow refactor
.github/workflows/deploy.yml
deploy.yml converted from GitHub Pages artifact deployment to direct gh-pages branch publication via peaceiris/actions-gh-pages. Trigger moved to development branch, path filters added for frontend/**, and build now includes --base path computation, pr-preview/ restoration from existing gh-pages, .nojekyll creation, and commit message with current SHA.
PR preview workflow with deployment and cleanup
.github/workflows/preview-pages.yml
New workflow builds PR-specific Vite site with --base pr-preview/pr-<PR_NUMBER>/ and deploys to gh-pages branch while preserving existing files. Creates/updates PR comments with preview URL and commit SHA; cleanup job removes preview directory from gh-pages and updates comment on PR closure.
Router configuration and manifest updates for base path compatibility
frontend/src/App.jsx, frontend/public/manifest.json
Removed basename={import.meta.env.BASE_URL} from Router component. Updated manifest start_url from / to . and changed icon src paths to relative (removing leading /).
Asset path migration to BASE_URL-relative imports
frontend/src/components/InvoicePreview.jsx, frontend/src/components/Navbar.jsx, frontend/src/page/Landing.jsx, frontend/src/page/About.jsx, frontend/src/page/BatchPayment.jsx, frontend/src/page/ReceivedInvoice.jsx, frontend/src/page/SentInvoice.jsx, frontend/src/utils/generateInvoicePDF.js, frontend/src/index.css
Updated all hardcoded absolute image paths (/logo.png, /logo-animated.gif, /dashboard.png, /token-select.png, /lit-protocol-logo.png) to use ${import.meta.env.BASE_URL} prefix across component templates and PDF generation utilities. Added PR preview test marker comment in index.css.
Build optimization with vendor chunk configuration
frontend/vite.config.js
Added build.rollupOptions.output.manualChunks() to route node_modules dependencies into named vendor chunks (mui-vendor, lit-vendor, web3-vendor, pdf-vendor, animation-vendor) with a default vendor fallback, and set chunkSizeWarningLimit to 1500.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • StabilityNexus/Chainvoice#6: Both PRs modify frontend/src/App.jsx routing configuration and frontend route structure, with main PR removing basename from Router mounting.
  • StabilityNexus/Chainvoice#52: Both PRs address GitHub Pages base path handling—main PR updates all asset references to use import.meta.env.BASE_URL and removes Router basename, while the prior PR introduces base path and Pages 404 fallback with workflow --base configuration.

Suggested labels

Typescript Lang


🐰 GitHub Pages gets a refresh today,
With previews for every PR on display.
Base paths dance through assets with grace,
Now serving from any deployment space! 🚀

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Biome (2.4.16)
frontend/src/index.css

File contains syntax errors that prevent linting: Line 114: Tailwind-specific syntax is disabled.; Line 117: Tailwind-specific syntax is disabled.


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.

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