Conversation
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.
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe 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
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
Poem
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
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
⛔ Files ignored due to path filters (1)
assets/images/news/vatsal-ammodo-2025.jpgis 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 InclusionThe 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 HandlingThe 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 UpdatesNew 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 ReferenceThe 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 ScriptThe 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 FellowshipA 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 EntryThe 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 SectionThe 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.
Description
Type of Change
Changes Made
Testing Done
bundle exec jekyll serveScreenshots
Related Issues
Closes #
Checklist
Additional Notes