Skip to content

Fix logo alignment in main header#475

Merged
yamcodes merged 4 commits intomainfrom
copilot/fix-logo-alignment-header
Nov 30, 2025
Merged

Fix logo alignment in main header#475
yamcodes merged 4 commits intomainfrom
copilot/fix-logo-alignment-header

Conversation

Copy link
Contributor

Copilot AI commented Nov 30, 2025

The logo icon, "ArkEnv" text, and nav items were vertically misaligned in the header.

Changes

  • logo.tsx: Added text-sm to match the nav item font size (14px), ensuring the "ArkEnv" text and "Documentation" link have identical font metrics for proper baseline alignment
  • layout.config.tsx: Removed the mb-1 workaround that wasn't properly fixing the issue

The fix is in the shared Logo component, so it applies to both the main header and docs sidebar.

After

Original prompt

This section details on the original issue you should resolve

<issue_title>Logo is not aligned in main header</issue_title>
<issue_description>In the www main header, the following 3 things are not vertically aligned:

  1. The ArkEnv logo icon
  2. The ArkEnv logo text
  3. The buttons' text in the header (Documentation)
Image

We address this, and this might also affect the header in the docs. In fact, if we solve it in one place, it should be automatically solved in the other using a centralized solution/component.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Summary by CodeRabbit

  • Style
    • Updated logo component styling for refined visual presentation
  • Tests
    • Expanded test coverage to verify logo styling adjustments

✏️ Tip: You can customize this high-level summary in your review settings.

@changeset-bot
Copy link

changeset-bot bot commented Nov 30, 2025

⚠️ No Changeset found

Latest commit: d3bc9df

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR addresses vertical alignment issues in the main header by adjusting logo styling. The changes remove a bottom margin utility from the layout configuration and add a text-size utility class to the ArkEnv label text, ensuring consistent vertical alignment across logo components and header buttons.

Changes

Cohort / File(s) Summary
Logo styling adjustments
apps/www/app/layout.config.tsx, apps/www/components/page/logo.tsx
Removed mb-1 margin class from logo in navigation config and added text-sm typography class to ArkEnv label span for improved vertical alignment
Logo test update
apps/www/components/page/logo.test.tsx
Updated test assertion to verify text-sm class is present on the ArkEnv label element

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Purely styling adjustments with no logic changes
  • Minimal file scope and consistent pattern
  • Direct correlation to linked alignment issue

Possibly related PRs

  • Better logo #469: Related — modifies the same Logo component files and layout configuration, likely part of a broader header alignment initiative

Poem

🐰 Hop and align!
Logo sits centered, no longer adrift,
Text and icon now dance in perfect drift,
One text-sm blessing, one margin dismissed,
Headers aligned—a vertical fix that can't be missed! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR attempts to address issue #474 by adding text-sm class and removing mb-1 margin, but the PR description indicates the fix is an 'overcorrection' and misalignment still exists. Revise the alignment fix to ensure all three header elements (logo icon, logo text, and nav buttons) are properly vertically aligned without overcorrection, as indicated in the feedback.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the mb-1 margin workaround and adding text-sm to fix logo alignment in the header.
Out of Scope Changes check ✅ Passed All changes are focused on fixing the logo alignment issue in the header; logo.tsx modification, layout.config.tsx adjustment, and test update are directly related to the linked issue.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

@vercel
Copy link

vercel bot commented Nov 30, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
arkenv Ready Ready Preview Comment Nov 30, 2025 6:45pm

…eading-none

Co-authored-by: yamcodes <2014360+yamcodes@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix logo alignment in main header Fix logo alignment in main header Nov 30, 2025
Copilot AI requested a review from yamcodes November 30, 2025 06:24
@github-actions github-actions bot added www Improvements or additions to arkenv.js.org tests This issue or PR is about adding, removing or changing tests labels Nov 30, 2025
@yamcodes
Copy link
Owner

Still not aligned very well. This looks like overcorrection to the other side. A better solution that guarantees alignment is expected.

image

@copilot

Co-authored-by: yamcodes <2014360+yamcodes@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 30, 2025

Still not aligned very well. This looks like overcorrection to the other side. A better solution that guarantees alignment is expected.

<img width="1158" height="184" alt="image" src="https://githu...

Fixed in 8e204a7. The issue was caused by different font sizes - "ArkEnv" was 16px while nav items use text-sm (14px). Changed the logo text to use text-sm so both have identical font metrics (14px font, 20px line-height), guaranteeing proper baseline alignment.

Header alignment

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/arkenv/arkenv/node_modules/.pnpm/next@16.0.4_@babel&#43;core@7.28.5_@opentelemetry&#43;api@1.9.0_@playwright&#43;test@1.56.1_react-d_eab17fb6086ca01249f9827927a56619/node_modules/next/dist/server/lib/start-server.js (dns block)
  • https://api.github.com/repos/yamcodes/arkenv
    • Triggering command: /usr/local/bin/node /usr/local/bin/node /home/REDACTED/work/arkenv/arkenv/node_modules/.pnpm/next@16.0.4_@babel&#43;core@7.28.5_@opentelemetry&#43;api@1.9.0_@playwright&#43;test@1.56.1_react-d_eab17fb6086ca01249f9827927a56619/node_modules/next/dist/server/lib/start-server.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

@yamcodes
Copy link
Owner

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 30, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@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 (1)
apps/www/components/page/logo.test.tsx (1)

28-44: Tests are now more tightly coupled to Tailwind classes

The new text-sm expectation keeps the test aligned with the Logo change but further couples this suite to specific Tailwind utility classes, which can make refactors of typography or spacing noisy in tests. Consider, longer‑term, either narrowing these assertions to only what’s critical for alignment regressions or testing behavior/structure (e.g. presence of text + icon) rather than every class name.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fec2e78 and d3bc9df.

📒 Files selected for processing (3)
  • apps/www/app/layout.config.tsx (1 hunks)
  • apps/www/components/page/logo.test.tsx (1 hunks)
  • apps/www/components/page/logo.tsx (1 hunks)
🧰 Additional context used
📓 Path-based instructions (5)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

**/*.{ts,tsx}: Prefer type over interface for type definitions in TypeScript
Use TypeScript 5.1+ features when appropriate
Leverage const type parameters for better inference in TypeScript
Use JSDoc comments for public APIs
Use tabs for indentation (configured in Biome)
Use double quotes for strings (configured in Biome)
Organize imports automatically (Biome handles this)
Avoid explicit types when TypeScript can infer them (noInferrableTypes error)
Use as const where appropriate for immutable values (useAsConstAssertion error)
Don't reassign function parameters (noParameterAssign error)
Place default parameters last in function signatures (useDefaultParameterLast error)
Always initialize enum values (useEnumInitializers error)
Declare one variable per statement (useSingleVarDeclarator error)
Avoid unnecessary template literals (noUnusedTemplateLiteral error)
Prefer Number.parseInt over global parseInt (useNumberNamespace error)
Use kebab-case for TypeScript filenames (e.g., create-env.ts)
Use camelCase for function names (e.g., createEnv)
Use PascalCase for type names (e.g., ArkEnvError)
Use UPPER_SNAKE_CASE for environment variables and constants
Include examples in JSDoc comments when helpful for public APIs
Document complex type logic with JSDoc comments
Use ArkEnvError for environment variable validation errors
Provide clear, actionable error messages that include the variable name and expected type

**/*.{ts,tsx}: Use createEnv(schema) as the main function for validated environment objects, available as the default export
Use built-in validators (host, port, url, email) from src/types.ts when available instead of custom validation
Use ArkEnvError for environment variable errors, not generic errors
Environment schema definitions should use built-in validators, ArkType string literals, and support default values in the schema pattern
Use logical grouping for related environment variables in schemas
Use descriptive env...

Files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
  • apps/www/app/layout.config.tsx
**/*.tsx

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Use self-closing JSX elements (useSelfClosingElements error)

Files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
  • apps/www/app/layout.config.tsx
apps/www/**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (apps/www/.cursor/rules/posthog-integration.mdc)

apps/www/**/*.{ts,tsx,js,jsx}: If using TypeScript, use an enum to store feature flag names. If using JavaScript, store feature flag names as strings to an object declared as a constant to simulate an enum. Use UPPERCASE_WITH_UNDERSCORE naming convention for enum/const object members.
If a custom property for a person or event is referenced in two or more files or two or more callsites in the same file, use an enum or const object with UPPERCASE_WITH_UNDERSCORE naming convention, similar to feature flags.

Files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
  • apps/www/app/layout.config.tsx
**/*.{ts,tsx,json,md}

📄 CodeRabbit inference engine (.github/copilot-instructions.md)

Use Biome for linting and formatting instead of ESLint and Prettier

Files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
  • apps/www/app/layout.config.tsx
**/*.test.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/coding-guidelines.mdc)

Co-locate tests with components: Component.tsx next to Component.test.tsx

**/*.test.{ts,tsx}: Test individual functions, components, and hooks in isolation with mocked dependencies in unit tests
Keep unit tests fast with execution under 100ms per test
Co-locate unit tests with source files using naming convention: source.tssource.test.ts
Focus component tests on public API, user behavior, state transitions, and accessibility rather than styling or implementation details
Query component tests by role, name, label, and text using accessibility-first selectors
Use Vitest as the test framework for unit and integration tests
Use Testing Library with user-event for real user simulation in component tests

**/*.test.{ts,tsx}: Test individual functions, components, and hooks in isolation with mocked dependencies using the *.test.ts or *.test.tsx suffix
Mock process.env in tests for different scenarios and save/restore original env in beforeEach/afterEach hooks
Use Vitest's describe/it structure in test files
Test edge cases including invalid and missing environment variable values
Use Vitest for testing framework

Files:

  • apps/www/components/page/logo.test.tsx
🧠 Learnings (8)
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable errors, not generic errors

Applied to files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use PascalCase for type names (e.g., `ArkEnvError`)

Applied to files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-24T16:03:45.295Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/arktype.mdc:0-0
Timestamp: 2025-11-24T16:03:45.295Z
Learning: Applies to packages/arkenv/**/*.ts : Keep environment variable schemas readable and TypeScript-like using ArkType syntax

Applied to files:

  • apps/www/components/page/logo.tsx
📚 Learning: 2025-11-24T16:04:00.957Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/coding-guidelines.mdc:0-0
Timestamp: 2025-11-24T16:04:00.957Z
Learning: Applies to **/*.{ts,tsx} : Use `ArkEnvError` for environment variable validation errors

Applied to files:

  • apps/www/components/page/logo.tsx
  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-24T16:04:36.939Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .cursor/rules/test-patterns.mdc:0-0
Timestamp: 2025-11-24T16:04:36.939Z
Learning: Applies to **/*.test.{ts,tsx} : Focus component tests on public API, user behavior, state transitions, and accessibility rather than styling or implementation details

Applied to files:

  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.test.{ts,tsx} : Test edge cases including invalid and missing environment variable values

Applied to files:

  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-29T22:11:39.920Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-11-29T22:11:39.920Z
Learning: Applies to **/*.{ts,tsx} : Environment schema definitions should use built-in validators, ArkType string literals, and support default values in the schema pattern

Applied to files:

  • apps/www/components/page/logo.test.tsx
📚 Learning: 2025-11-29T08:57:24.044Z
Learnt from: CR
Repo: yamcodes/arkenv PR: 0
File: examples/with-bun-react/.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-11-29T08:57:24.044Z
Learning: Applies to examples/with-bun-react/**/*.test.{ts,tsx,js,jsx} : Use test syntax from `bun:test` with `test` and `expect` functions

Applied to files:

  • apps/www/components/page/logo.test.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test-e2e (a11y)
  • GitHub Check: test-e2e (e2e)
🔇 Additional comments (2)
apps/www/components/page/logo.tsx (1)

21-21: Shared logo typography update looks good

Adding text-sm on the label centralizes the font-size choice in the shared Logo component and should help align the logo text with header nav items without layout-level hacks.

apps/www/app/layout.config.tsx (1)

13-13: Good removal of layout-level margin hack

Using <Logo /> directly and dropping mb-1 keeps alignment concerns inside the Logo component and ensures consistent behavior across main and docs headers. Just double‑check alignment in both headers at different breakpoints to confirm the new typography fully replaces the old workaround.

@yamcodes yamcodes merged commit 437782e into main Nov 30, 2025
15 checks passed
@yamcodes yamcodes deleted the copilot/fix-logo-alignment-header branch November 30, 2025 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests This issue or PR is about adding, removing or changing tests www Improvements or additions to arkenv.js.org

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Logo is not aligned in main header

2 participants