Skip to content

Refactor FeaturesSection and enhance UI with new components - #31

Open
FabLrc wants to merge 18 commits into
masterfrom
develop
Open

Refactor FeaturesSection and enhance UI with new components#31
FabLrc wants to merge 18 commits into
masterfrom
develop

Conversation

@FabLrc

@FabLrc FabLrc commented Jul 28, 2026

Copy link
Copy Markdown
Owner

This pull request includes several improvements focused on security, dependency updates, and workflow configuration. The key changes are the introduction of stricter image source validation in the frontend to prevent unsafe image rendering, updates to dependencies for better compatibility and security, and adjustments to CI/CD workflow permissions.

Frontend Security Improvements:

  • Added the isSafeImageUrl utility in frontend/lib/validation.ts to restrict image rendering to safe URL schemes (https://, http://, blob:), preventing potential JavaScript or data URI injection attacks. This check is now applied to avatar previews in frontend/app/profile/page.tsx and media uploads in frontend/components/plugins/MediaUpload.tsx. [1] [2] [3] [4] [5] [6]

Dependency Updates:

  • Upgraded meilisearch-sdk from version 0.27 to 0.31 in api/Cargo.toml for improved features and bug fixes.
  • Added postcss and sharp overrides in frontend/package.json to ensure consistent versions and resolve potential dependency issues.

Workflow and Configuration Updates:

  • Set explicit permissions in GitHub Actions workflows (.github/workflows/ci.yml and .github/workflows/docker.yml) to follow best practices for least privilege. [1] [2]

Other Updates:

  • Updated copyright year in frontend/components/layout/Footer.tsx.

Summary by CodeRabbit

  • Bug Fixes

    • Improved profile avatar and media upload previews by validating image URLs before displaying them.
    • Unsafe or unsupported image links now show the standard placeholder instead of loading.
  • Style

    • Updated the footer copyright year to 2026.
  • Security

    • Strengthened application and deployment access controls to reduce unnecessary permissions.

FabLrc added 17 commits May 12, 2026 14:47
- Introduced EngineSection, InterstitialBanner, and WorkflowSection components to modularize the FeaturesSection.
- Added AnimatedCounter for dynamic number display.
- Implemented DeployPreview and FileTreePreview for showcasing deployment details.
- Created TerminalPreview for simulating terminal commands and results.
- Developed RaceChart for visualizing performance metrics.
- Added useInView hook for handling element visibility in the viewport.
- Updated FeaturesSection tests to reflect component changes and improve coverage.
- Updated coverage thresholds in test scripts.
- Added tests for AnimatedCounter, DeployPreview, GithubWorkflowPreview, RaceChart, TerminalPreview, WorkflowSection, useInView, and useCountUp components.
- Improved existing tests for Navbar, ExplorerResults, ReviewCard, and DownloadChart components.
- Mocked additional dependencies and improved error handling in SWRProvider tests.
- Refactored Navbar tests for better clarity and coverage.
…on, EngineSection, InterstitialBanner, and WorkflowSection
…nerable deps

- aws-lc-sys: CRL distribution point scope check / name constraints bypass
- rand: unsound custom logger with rand::rng()
- lru: IterMut Stacked Borrows violation (via aws-sdk-s3 bump)
- meilisearch-sdk 0.27 -> 0.31: pulls jsonwebtoken 10.3.0, fixing type confusion
@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@FabLrc, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 55 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f41781f0-5db1-4bb3-81b3-6bc714dfced7

📥 Commits

Reviewing files that changed from the base of the PR and between f998179 and 440cc7f.

📒 Files selected for processing (1)
  • frontend/app/profile/page.tsx
📝 Walkthrough

Walkthrough

The changes add shared image URL validation to profile and media previews, restrict GitHub Actions permissions, update dependency constraints and overrides, and change the footer copyright year to 2026.

Changes

Image URL safety

Layer / File(s) Summary
Image URL validator
frontend/lib/validation.ts
Adds validation for https://, http://, and blob: image URLs.
Image preview guards
frontend/app/profile/page.tsx, frontend/components/plugins/MediaUpload.tsx
Profile and upload previews render images only when their URLs pass validation.

CI and dependency configuration

Layer / File(s) Summary
Workflow permissions
.github/workflows/ci.yml, .github/workflows/docker.yml
Restricts CI contents access and clears permissions for the Docker deploy job.
Dependency constraints
api/Cargo.toml, frontend/package.json
Updates the Meilisearch SDK version and pins transitive postcss and sharp versions.

Footer metadata

Layer / File(s) Summary
Copyright year
frontend/components/layout/Footer.tsx
Changes the displayed copyright year to 2026.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title mentions a FeaturesSection refactor, but the diff is mainly security, dependency, and workflow updates, so it is misleading. Rename it to reflect the main changes, such as safe image URL validation, dependency bumps, and workflow permission updates.
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch develop

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.

Comment thread frontend/app/profile/page.tsx Fixed
…ed as HTML'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/lib/validation.ts (1)

102-110: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add direct tests for the URL allowlist.

Cover null/undefined, each allowed scheme, and rejected javascript:, data:, protocol-relative, and malformed values. This helper is the shared security boundary for both preview components.

As per coding guidelines, frontend code must maintain 80% line/function and 75% branch coverage.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@frontend/lib/validation.ts` around lines 102 - 110, Add direct tests for
isSafeImageUrl covering null and undefined inputs, https://, http://, and blob:
allowlisted schemes, plus rejected javascript:, data:, protocol-relative, and
malformed values. Ensure the tests exercise the shared helper’s branches and
preserve the required frontend coverage thresholds.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@frontend/lib/validation.ts`:
- Around line 102-110: Add direct tests for isSafeImageUrl covering null and
undefined inputs, https://, http://, and blob: allowlisted schemes, plus
rejected javascript:, data:, protocol-relative, and malformed values. Ensure the
tests exercise the shared helper’s branches and preserve the required frontend
coverage thresholds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: da224521-c351-4630-bf28-ff3d2bb3c393

📥 Commits

Reviewing files that changed from the base of the PR and between 2366bd3 and f998179.

⛔ Files ignored due to path filters (2)
  • api/Cargo.lock is excluded by !**/*.lock
  • frontend/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • .github/workflows/ci.yml
  • .github/workflows/docker.yml
  • api/Cargo.toml
  • frontend/app/profile/page.tsx
  • frontend/components/layout/Footer.tsx
  • frontend/components/plugins/MediaUpload.tsx
  • frontend/lib/validation.ts
  • frontend/package.json

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.

2 participants