Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Conversation

@sauravpanda
Copy link
Member

@sauravpanda sauravpanda commented Dec 15, 2024

Manifest File Addition

  • Purpose:
    Add a new manifest.json file that contains a list of all the compiled documentation files.
  • Key Changes:
    • Created a new manifest.json file in the docs/compiled directory.
    • The file contains a list of all the JSON files that are generated during the build process.
    • This provides a centralized manifest of the available documentation content.
  • Impact:
    The manifest file will make it easier to manage and navigate the compiled documentation, especially for large documentation sites with many pages.

Navigation Improvements

  • Purpose:
    Enhance the navigation sidebar with better visual feedback and smooth scrolling.
  • Key Changes:
    • Added a gradient background and subtle shadow effect to the active navigation item.
    • Implemented smooth scrolling to ensure the active item is centered in the viewport when navigating.
  • Impact:
    These changes will improve the user experience by providing clearer visual cues for the current location and making it easier to navigate large documentation structures.

Miscellaneous Fixes and Improvements

  • Purpose:
    Address various minor issues and enhance the overall documentation experience.
  • Key Changes:
    • Removed unnecessary console logs and commented-out code.
    • Updated package versions and dependencies.
  • Impact:
    These changes will improve the code quality, maintainability, and overall stability of the AkiraDocs platform.

✨ Generated with love by Kaizen ❤️

Original Description ## 🔍 Description

Type

  • 🐛 Bug Fix
  • ✨ Feature
  • 📚 Documentation
  • 🔧 Other: _____

Checklist

  • Tested locally
  • Updated docs (if needed)
  • Added/updated tests (if needed)

@sauravpanda sauravpanda linked an issue Dec 15, 2024 that may be closed by this pull request
@vercel
Copy link

vercel bot commented Dec 15, 2024

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

Name Status Preview Comments Updated (UTC)
akira-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 15, 2024 0:53am

@kaizen-bot
Copy link
Contributor

kaizen-bot bot commented Dec 15, 2024

🔍 Code Review Summary

Attention Required: This push has potential issues. 🚨

Overview

  • Total Feedbacks: 1 (Critical: 1, Refinements: 0)
  • Files Affected: 1
  • Code Quality: [█████████████████░░░] 85% (Good)

🚨 Critical Issues

performance (1 issues)

1. Use of setTimeout for scrolling can lead to performance issues.


📁 File: packages/akiradocs/src/components/layout/Navigation.tsx
🔍 Reasoning:
Using setTimeout introduces unnecessary delays and can lead to performance bottlenecks, especially if the component is rendered frequently.

💡 Solution:
Consider using requestAnimationFrame instead of setTimeout for smoother animations.

Current Code:

setTimeout(() =>{/* scrolling logic */}, 100);

Suggested Code:

requestAnimationFrame(() =>{/* scrolling logic */});

Test Cases

7 file need updates to their tests. Run !unittest to generate create and update tests.


✨ Generated with love by Kaizen ❤️

Useful Commands
  • Feedback: Share feedback on kaizens performance with !feedback [your message]
  • Ask PR: Reply with !ask-pr [your question]
  • Review: Reply with !review
  • Update Tests: Reply with !unittest to create a PR with test changes

Copy link
Contributor

@kaizen-bot kaizen-bot bot left a comment

Choose a reason for hiding this comment

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

Consider implementing the following changes to improve the code.

Comment on lines +61 to +70
setTimeout(() => {
const viewport = itemRef.current?.closest('[data-radix-scroll-area-viewport]') as HTMLElement;
if (viewport) {
const itemRect = itemRef.current?.getBoundingClientRect();
const viewportRect = viewport.getBoundingClientRect();
const scrollOffset = (itemRect?.top ?? 0) - (viewportRect.top ?? 0) - (viewportRect.height / 2) + ((itemRect?.height ?? 0) / 2);

viewport.scrollTop += scrollOffset;
}
}, 100);
Copy link
Contributor

Choose a reason for hiding this comment

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

Comment: Use of setTimeout for scrolling can lead to performance issues.

Solution: Consider using requestAnimationFrame instead of setTimeout for smoother animations.
!! Make sure the following suggestion is correct before committing it !!

Suggested change
setTimeout(() => {
const viewport = itemRef.current?.closest('[data-radix-scroll-area-viewport]') as HTMLElement;
if (viewport) {
const itemRect = itemRef.current?.getBoundingClientRect();
const viewportRect = viewport.getBoundingClientRect();
const scrollOffset = (itemRect?.top ?? 0) - (viewportRect.top ?? 0) - (viewportRect.height / 2) + ((itemRect?.height ?? 0) / 2);
viewport.scrollTop += scrollOffset;
}
}, 100);
requestAnimationFrame(() =>{/* scrolling logic */});

@kaizen-bot kaizen-bot bot requested a review from shreyashkgupta December 15, 2024 00:53
@sauravpanda sauravpanda merged commit 7cf55a4 into main Dec 15, 2024
8 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Navbar isnt sticky when something is selected

2 participants