Skip to content
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

chore: Update branding assets and dependencies #75

Merged
merged 1 commit into from
Feb 24, 2025
Merged

Conversation

carhartlewis
Copy link
Collaborator

@carhartlewis carhartlewis commented Feb 24, 2025

  • Replace favicon and app icons with new design
  • Update web manifest with maskable icons
  • Add AWS S3 and Lodash type dependencies
  • Modify layout and component styling
  • Seed evidence requirements in database

Summary by CodeRabbit

  • New Features

    • Enhanced Progressive Web App support with an updated manifest featuring a new app name ("Comp AI") and maskable icons.
    • Introduced a new icon alongside the "Add" label in task comments for improved interaction.
  • Style

    • Refined typography by transitioning to a locally hosted font, accompanied by an updated favicon.
    • Adjusted visual elements including comment container shapes, link styling, and the upload button for a cleaner, modern interface.

- Replace favicon and app icons with new design
- Update web manifest with maskable icons
- Add AWS S3 and Lodash type dependencies
- Modify layout and component styling
- Seed evidence requirements in database
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
app ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 1:26pm
comp-portal ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 1:26pm
web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 24, 2025 1:26pm

Copy link

coderabbitai bot commented Feb 24, 2025

Walkthrough

This pull request updates several front-end assets and components alongside a back-end seed script. The web manifest files for both apps have been completely replaced with new JSON structures (including updated names and icon paths). In addition, unused font imports have been removed and replaced in layout files, several UI components have small styling or icon modifications, and a new asynchronous database seeding function for evidence data has been introduced to enhance the initialization routine.

Changes

File(s) Change Summary
apps/app/public/site.webmanifest, apps/web/public/site.webmanifest Replaced JSON structure with specified name/short_name ("Comp AI"), updated icon paths and added purpose: "maskable" (in web manifest, metadata icon updated from /android-chrome-192x192.png to /favicon-96x96.png).
apps/app/src/app/[locale]/layout.tsx, apps/web/src/app/layout.tsx Removed external font imports (GeistSans/Geist) and modified font handling. In the web layout, added a local font via localFont and updated the body class and metadata icon.
apps/app/src/components/risks/risk-comments.tsx Removed the rounded-lg CSS class from the comment container, altering its styling.
apps/app/src/components/risks/tasks/task-attachment.tsx, apps/app/src/components/risks/tasks/task-comments.tsx Adjusted task components: removed the "text-primary" class from a <Link> element and added a MessageSquare icon to the comment button to enhance its visual cue.
apps/app/src/components/upload-dialog.tsx Introduced an import for the Cloud icon from lucide-react and updated the button content to show the icon instead of displaying a file count.
packages/db/prisma/seed.js Added a new asynchronous function seedEvidence that retrieves evidence requirements and performs an upsert operation for each, then called it from the main seeding function.

Sequence Diagram(s)

sequenceDiagram
    participant Main as main()
    participant Seed as seedEvidence()
    participant DB as Prisma

    Main->>Seed: Call seedEvidence()
    Seed->>DB: Query for evidence requirements
    DB-->>Seed: Return evidence list
    loop For each evidence requirement
        Seed->>DB: Upsert evidence record
        DB-->>Seed: Upsert result
    end
    Seed-->>Main: Seeding complete
Loading

Possibly related PRs

  • Mariano/stuff #45: Similar modifications to the site.webmanifest file involving complete JSON structure replacement and icon updates.
  • style: homepage updates #62: Also addresses updates in the site.webmanifest JSON, with changes to the name, short_name, and icons.

Poem

In fields of code I hop with glee,
New manifests shine for all to see.
Fonts now local, icons renewed,
Bugs are chased and styles reviewed.
A techie rabbit sings this song,
Celebrating changes all day long!
🐇💻

✨ Finishing Touches
  • 📝 Generate Docstrings (Beta)

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR. (Beta)
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (3)
packages/db/prisma/seed.js (2)

6-7: Combine duplicate imports from @prisma/client.

Consider combining both imports into a single import statement to improve code maintainability.

-const client_1 = require("@prisma/client");
-const client_2 = require("@prisma/client");
+const { PrismaClient, RequirementType } = require("@prisma/client");

284-308: Consider performance and data integrity improvements.

While the implementation is functional, consider the following improvements:

  1. Use prisma.$transaction for batch processing of upserts to improve performance
  2. Add data validation beyond Prisma's built-in checks
  3. Consider cleaning up orphaned evidence records
  4. Add try-catch blocks for error handling within the function

Here's a suggested implementation with these improvements:

 async function seedEvidence() {
+    try {
         const evidenceRequirements = await prisma.controlRequirement.findMany({
             where: {
                 type: client_2.RequirementType.evidence,
             },
         });
         console.log(`🔄 Processing ${evidenceRequirements.length} evidences`);
+        
+        // Prepare batch operations
+        const operations = evidenceRequirements.map(evidence => {
+            // Basic validation
+            if (!evidence.name?.trim()) {
+                console.log(`  ⚠️  Skipping evidence with empty name: ${evidence.id}`);
+                return null;
+            }
+            
+            return prisma.evidence.upsert({
+                where: { id: evidence.id },
+                update: {
+                    name: evidence.name,
+                    description: evidence.description,
+                },
+                create: {
+                    id: evidence.id,
+                    name: evidence.name,
+                    description: evidence.description,
+                },
+            });
+        }).filter(Boolean);
+        
+        // Execute batch operations
+        await prisma.$transaction(operations);
+        
+        // Clean up orphaned records
+        await prisma.evidence.deleteMany({
+            where: {
+                id: {
+                    notIn: evidenceRequirements.map(e => e.id)
+                }
+            }
+        });
+    } catch (error) {
+        console.error(`❌ Error seeding evidence:`, error);
+        throw error;  // Re-throw to be caught by main's error handler
+    }
 }
apps/app/src/components/upload-dialog.tsx (1)

59-61: Consider keeping the file count display.

While the Cloud icon addition improves visual clarity, removing the file count might reduce user feedback. Consider keeping both the icon and file count.

 <Button variant="action">
   <Cloud className="h-4 w-4" />
   {t("common.attachments.upload")}
+  {files.length > 0 && ` (${files.length})`}
 </Button>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 12c91ec and 625bbf4.

⛔ Files ignored due to path filters (27)
  • apps/app/public/android-chrome-192x192.png is excluded by !**/*.png
  • apps/app/public/android-chrome-512x512.png is excluded by !**/*.png
  • apps/app/public/apple-touch-icon.png is excluded by !**/*.png
  • apps/app/public/favicon-16x16.png is excluded by !**/*.png
  • apps/app/public/favicon-32x32.png is excluded by !**/*.png
  • apps/app/public/favicon-96x96.png is excluded by !**/*.png
  • apps/app/public/favicon.ico is excluded by !**/*.ico
  • apps/app/public/favicon.svg is excluded by !**/*.svg
  • apps/app/public/web-app-manifest-192x192.png is excluded by !**/*.png
  • apps/app/public/web-app-manifest-512x512.png is excluded by !**/*.png
  • apps/web/public/android-chrome-192x192.png is excluded by !**/*.png
  • apps/web/public/android-chrome-512x512.png is excluded by !**/*.png
  • apps/web/public/apple-touch-icon.png is excluded by !**/*.png
  • apps/web/public/comp-logo-black.png is excluded by !**/*.png
  • apps/web/public/comp-logo-white.png is excluded by !**/*.png
  • apps/web/public/favicon-16x16.png is excluded by !**/*.png
  • apps/web/public/favicon-32x32.png is excluded by !**/*.png
  • apps/web/public/favicon-96x96.png is excluded by !**/*.png
  • apps/web/public/favicon.ico is excluded by !**/*.ico
  • apps/web/public/favicon.svg is excluded by !**/*.svg
  • apps/web/public/fonts/GeneralSans-Variable.ttf is excluded by !**/*.ttf
  • apps/web/public/fonts/GeneralSans-VariableItalic.ttf is excluded by !**/*.ttf
  • apps/web/public/logo.png is excluded by !**/*.png
  • apps/web/public/web-app-manifest-192x192.png is excluded by !**/*.png
  • apps/web/public/web-app-manifest-512x512.png is excluded by !**/*.png
  • bun.lock is excluded by !**/*.lock
  • yarn.lock is excluded by !**/yarn.lock, !**/*.lock
📒 Files selected for processing (9)
  • apps/app/public/site.webmanifest (1 hunks)
  • apps/app/src/app/[locale]/layout.tsx (0 hunks)
  • apps/app/src/components/risks/risk-comments.tsx (1 hunks)
  • apps/app/src/components/risks/tasks/task-attachment.tsx (1 hunks)
  • apps/app/src/components/risks/tasks/task-comments.tsx (1 hunks)
  • apps/app/src/components/upload-dialog.tsx (2 hunks)
  • apps/web/public/site.webmanifest (1 hunks)
  • apps/web/src/app/layout.tsx (2 hunks)
  • packages/db/prisma/seed.js (3 hunks)
💤 Files with no reviewable changes (1)
  • apps/app/src/app/[locale]/layout.tsx
✅ Files skipped from review due to trivial changes (2)
  • apps/app/src/components/risks/risk-comments.tsx
  • apps/app/src/components/risks/tasks/task-attachment.tsx
🔇 Additional comments (9)
packages/db/prisma/seed.js (1)

38-40: LGTM!

The changes maintain consistency with the existing code structure and include appropriate logging.

apps/app/public/site.webmanifest (1)

1-21:

❓ Verification inconclusive

Verify that the web app manifest icons exist.

The manifest structure looks good and aligns with PWA standards. Let's verify the existence and dimensions of the new icon files.


🏁 Script executed:

#!/bin/bash
# Description: Check if the new web app manifest icons exist and have correct dimensions
# Note: Using ImageMagick's identify command to check image dimensions

for icon in "web-app-manifest-192x192.png" "web-app-manifest-512x512.png"; do
  if [ -f "apps/app/public/$icon" ]; then
    echo "✓ Found $icon"
    identify "apps/app/public/$icon"
  else
    echo "✗ Missing $icon"
  fi
done

Length of output: 743


Manual Verification Required: Icon Dimensions

The manifest file’s structure is correct, and both icon files are present at the expected locations. However, the automated check for image dimensions couldn’t be completed because the ImageMagick identify command isn’t available in this environment. Please manually verify that:

  • apps/app/public/web-app-manifest-192x192.png is exactly 192x192 pixels.
  • apps/app/public/web-app-manifest-512x512.png is exactly 512x512 pixels.

Once you confirm the image dimensions (using a locally-installed version of ImageMagick or another reliable tool), you can update this review comment accordingly.

apps/app/src/components/risks/tasks/task-comments.tsx (1)

31-32: LGTM! Icon addition enhances button visibility.

The addition of the MessageSquare icon improves the visual hierarchy and provides better context for the action button.

apps/app/src/components/upload-dialog.tsx (1)

18-18: LGTM! New icon import.

The Cloud icon import aligns with the UI enhancement goals.

apps/web/public/site.webmanifest (1)

1-21:

❓ Verification inconclusive

Verify that the web app manifest icons exist.

The manifest structure is consistent with the app manifest. Let's verify the existence and dimensions of the new icon files.


🏁 Script executed:

#!/bin/bash
# Description: Check if the new web app manifest icons exist and have correct dimensions
# Note: Using ImageMagick's identify command to check image dimensions

for icon in "web-app-manifest-192x192.png" "web-app-manifest-512x512.png"; do
  if [ -f "apps/web/public/$icon" ]; then
    echo "✓ Found $icon"
    identify "apps/web/public/$icon"
  else
    echo "✗ Missing $icon"
  fi
done

Length of output: 743


Manifest Icon Verification: Manual Dimensions Check Required

  • The manifest file references two icons located at apps/web/public/web-app-manifest-192x192.png and apps/web/public/web-app-manifest-512x512.png, and the existence of these files has been confirmed.
  • The automated script attempted to verify dimensions using ImageMagick's identify command but encountered a "command not found" error.
  • Action: Please manually confirm that the image dimensions are indeed 192x192 and 512x512. You may run a Python script with Pillow (if available) or verify using a local environment where the necessary image tools are installed.
apps/web/src/app/layout.tsx (4)

1-1: LGTM! Good choice using local fonts.

The shift to local fonts improves performance, reliability, and GDPR compliance by eliminating external font requests.

Also applies to: 9-9


35-39: LGTM! Clean font class implementation.

The className implementation correctly combines both font variables using template literals.


19-23:

✅ Verification successful

Verify font file existence.

The font configuration is well-structured with variable font support and proper loading strategy.

Let's verify the font file:


🏁 Script executed:

#!/bin/bash
# Description: Check if the font file exists

fd "GeneralSans-Variable.ttf" apps/web/public/fonts/

Length of output: 99


Font configuration verified and approved.

The font file apps/web/public/fonts/GeneralSans-Variable.ttf exists as expected, and the configuration in apps/web/src/app/layout.tsx (lines 19-23) is correctly set up with variable font support and the swap display for optimized loading.


14-16:

❓ Verification inconclusive

Verify favicon size and manifest consistency.

The favicon size of 96x96 pixels might be insufficient for modern web standards. Consider using multiple sizes for better device compatibility.

Let's verify the icon setup:


🏁 Script executed:

#!/bin/bash
# Description: Check favicon existence and web manifest consistency

# Check if favicon exists
fd "favicon-96x96.png" apps/web/public/

# Check web manifest for icon definitions
fd "site.webmanifest" apps/web/public/ --exec cat {}

Length of output: 564


Icon Update Verification – Please Review Consistency Across Icon Assets

  • The updated favicon (/favicon-96x96.png) is confirmed to exist in apps/web/public/.
  • The web manifest (apps/web/public/site.webmanifest) still defines only larger icons (192x192 and 512x512).
  • Verify that using a single 96x96 icon in the layout meets all device and browser requirements. If broader compatibility is desired, consider either:
    • Including additional favicon sizes (e.g., 16x16, 32x32) alongside the 96x96 icon, or
    • Updating the manifest to reference the new favicon if applicable.

@carhartlewis carhartlewis merged commit 8fbd5c2 into main Feb 24, 2025
8 checks passed
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