Skip to content

vs-branch-1#29

Merged
VatsalSy merged 6 commits intomainfrom
vs-branch-1
Apr 7, 2025
Merged

vs-branch-1#29
VatsalSy merged 6 commits intomainfrom
vs-branch-1

Conversation

@VatsalSy
Copy link
Member

@VatsalSy VatsalSy commented Apr 7, 2025

Description

Type of Change

  • Bug fix
  • New feature
  • Content update (Team/Publication)
  • Documentation update
  • Other (please describe)

Changes Made

Testing Done

  • Tested locally using bundle exec jekyll serve
  • Checked all links and references
  • Verified content formatting
  • Cross-browser testing (if UI changes)

Screenshots

Related Issues

Closes #

Checklist

  • Code follows the project's style guidelines
  • All links are valid and working
  • Images are optimized and properly sized
  • Content is properly formatted
  • Documentation has been updated (if needed)
  • Changes have been tested locally

Additional Notes

VatsalSy added 6 commits April 5, 2025 21:33
The changes in this commit include:

1. Increasing the size of the image for the "Vatsal Sanjay - Ammodo Science Fellowship" news item from 150px to 175px.
2. Adding a new course announcement for "High-Fidelity Simulations Using Basilisk C" in Madrid, Spain from March 10-13, 2025.

These changes are made to improve the visual presentation of the news items and to provide more information about upcoming events to the readers.
This commit introduces a new command palette feature to the CoMPhy Lab website. The main changes are:

1. Moved the command palette implementation to a separate JavaScript file (`assets/js/command-palette.js`) for better organization and maintainability.
2. Refactored the command palette functionality, including the rendering of results, handling of keyboard shortcuts, and integration with the search database.
3. Improved the styling and behavior of the command palette button, ensuring it retains focus styles.
4. Removed the old `ninja-keys` implementation and replaced it with the new command palette functionality.
5. Ensured the command palette works consistently across different layouts (research, teaching, default).

The new command palette provides a more user-friendly way for visitors to quickly access various commands and features on the website.
…ality

The changes in this commit focus on improving the styling and functionality of the command palette feature on the website. The key changes are:

- Moved the command palette implementation to a separate JavaScript file (`assets/js/command-palette.js`) to keep the main layout files clean.
- Ensured the command palette button retains focus styles when clicked.
- Registered a keyboard shortcut (`Ctrl/Cmd + K`) to open the command palette.
- Improved the rendering of command results, including handling of search results and keyboard navigation.
- Prefetched the search database to improve the command palette search experience.
- Removed the unused `ninja-keys` implementation and simplified the command palette logic.

These changes aim to provide a more polished and user-friendly command palette experience for the website's visitors.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 7, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features
    • Introduced a fresh news entry highlighting an award and research achievement.
  • Style
    • Enhanced layout and alignment in news and cover article sections for improved visual consistency.
    • Updated website icons for a more modern look.
  • Refactor
    • Streamlined command palette functionality by shifting its logic to an external module for a smoother user experience.
  • Chores
    • Removed outdated team member details for a cleaner display.

Walkthrough

The changes update the content and presentation across several parts of the site. In the news section, a new April entry featuring Vatsal Sanjay’s Ammodo Science Fellowship is added, with layout improvements in the February and March sections. Multiple layout files have been refactored to remove inline JavaScript for the command palette, replacing it with a single external script reference. Additionally, a team member’s section is removed and a new JavaScript file is introduced to handle command palette functionality.

Changes

File(s) Change Summary
News.md - Added new April section for Vatsal Sanjay’s Ammodo Science Fellowship with detailed description, image, and link using flexbox layout.
- Commented out March publication reference.
- Updated February cover article layout with flexbox and adjusted image width (256px → 175px).
_layouts/default.html, _layouts/research.html,
_layouts/teaching-course.html, _layouts/teaching.html, _layouts/team.html
- Removed inline command palette JavaScript and event listeners.
- Added a script tag referencing /assets/js/command-palette.js for centralized functionality.
- In _layouts/default.html, updated favicon links.
_team/index.md Removed section detailing intern Xiangyu Zhang, including background and research details.
assets/js/command-palette.js New file implementing command palette functionality: global functions (openCommandPalette, renderCommandResults, renderSections), event handling, asynchronous search, and keyboard navigation.

Sequence Diagram(s)

sequenceDiagram
    participant U as User
    participant DOM as Document
    participant CP as CommandPalette.js
    participant DB as Search Database

    U->>DOM: Load page
    DOM->>CP: Initialize command palette on DOMContentLoaded
    CP->>DB: Prefetch search database (if query ≥ 3 chars)
    U->>CP: Press command palette button / shortcut (Ctrl+K, ⌘K)
    CP->>DOM: Open palette and focus input
    U->>CP: Type search query
    CP->>CP: Filter commands via renderCommandResults
    CP->>DOM: Render command sections with results
    U->>CP: Navigate and select a command (Enter)
    CP->>DOM: Execute selected command action
Loading

Poem

I'm a bunny in code, jumping with glee,
Flexbox and scripts make the interface spree.
Inline clutter now hops away,
With a palette of commands leading the play.
Coding carrots crunch in a delightful ballet!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 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.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @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
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: 1

🧹 Nitpick comments (4)
_team/index.md (1)

367-374: Consider removing commented-out code for clarity.

You have commented out Xiangyu Zhang’s section entirely. If there's no plan to restore it, removing it fully can keep the file concise. Otherwise, leaving it commented out is fine as long as you track this block for future reference.

_layouts/research.html (1)

597-598: Leaving the inline explanatory comment is optional.

Keeping a comment about the removed inline logic can help future contributors. Otherwise, it can be removed to tidy up.

assets/js/command-palette.js (2)

78-125: Section-based rendering is cohesive.

Grouping commands by section and rendering them separately enhances clarity. Consider adding minimal error handling if a command has missing fields.


223-261: DOM load handling and platform detection.

The approach for toggling Mac vs. non-Mac shortcuts is straightforward. For broader OS checks, you could refine detection logic, but it’s sufficient here.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 4ab93ce and 2f5a8c7.

⛔ Files ignored due to path filters (1)
  • assets/images/news/vatsal-ammodo-2025.jpg is excluded by !**/*.jpg
📒 Files selected for processing (8)
  • News.md (3 hunks)
  • _layouts/default.html (4 hunks)
  • _layouts/research.html (3 hunks)
  • _layouts/teaching-course.html (2 hunks)
  • _layouts/teaching.html (1 hunks)
  • _layouts/team.html (1 hunks)
  • _team/index.md (1 hunks)
  • assets/js/command-palette.js (1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
assets/js/command-palette.js

[error] 37-37: Change to an optional chain.

Unsafe fix: Change to an optional chain.

(lint/complexity/useOptionalChain)

🔇 Additional comments (14)
_layouts/teaching.html (1)

127-129: Good modularization by referencing an external script.

Shifting the command palette logic to an external file helps maintainability. Consider adding a fallback or error handling if the external script fails to load.

_layouts/research.html (2)

148-149: Nice replacement with the new external script.

This external reference improves modularity and consistency across the layouts. No issues found with the import.


233-233: Removed inline command palette comment.

Moving references to the new script is a clean approach. The comment clarifies where the implementation now resides.

assets/js/command-palette.js (3)

1-5: Introductory documentation is clear and helpful.

Stating purpose and scope at the top of the file aids code readability.


6-20: Global function for opening the palette is well-structured.

The logic for focusing the input upon opening is straightforward and user-friendly. No issues detected.


127-221: Initialization flow is well-organized.

Prefetching the search database and setting up event listeners is done correctly. Be mindful of potential 404 responses on the fetch, although you already have a catch block in place.

_layouts/teaching-course.html (2)

127-129: External Command Palette Script Inclusion

The inline command palette code has been replaced with an external script reference (/assets/js/command-palette.js), which enhances maintainability and separation of concerns. Please verify that all related functionality is now fully handled by the external script.


175-175: Clarified Command Palette Button Handling

The comment now clearly states that the command palette button and keyboard shortcuts are managed by the external script. This improves code clarity by communicating the relocation of the command palette logic.

_layouts/default.html (2)

27-33: Favicon Asset Updates

New favicon links have been added, including an apple-touch-icon-precomposed, a 96×96 PNG, an SVG version, and an additional favicon.ico link. Please ensure that these assets exist at the specified paths and render correctly across devices.


87-89: External Command Palette Script Reference

The inline command palette logic has been offloaded into the external script (/assets/js/command-palette.js), which reduces inline complexity and centralizes functionality. This improves overall code modularity.

_layouts/team.html (1)

591-593: Integration of External Command Palette Script

The addition of the external command palette script at the end of the file supports the modular approach seen across other layout files. Please confirm that any legacy inline command palette functionality has been fully removed to prevent redundant definitions.

News.md (3)

3-20: New April News Entry for Ammodo Science Fellowship

A new April section introduces Vatsal Sanjay’s award with a detailed description and a flexbox layout that enhances visual alignment. The styling—including the image with a reduced max-width and supporting "Read More" link—is clear and consistent.


31-40: Commented-Out March Publication Entry

The publication entry has been commented out, preserving the historical content without displaying it on the live site. Verify that this approach aligns with the intended communication strategy while keeping past information available for reference.


48-60: Updated Cover Article Layout in February Section

The February section now uses a flexbox layout and reduces the image’s maximum width from 256px to 175px to match the new design aesthetic. Ensure that both the “Download Cover” and “View Paper” links are prominently visible and function as expected.

@VatsalSy VatsalSy merged commit 0bacb09 into main Apr 7, 2025
2 of 3 checks passed
@VatsalSy VatsalSy deleted the vs-branch-1 branch April 7, 2025 22:59
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