Skip to content

vs-branch-9#37

Merged
VatsalSy merged 3 commits intomainfrom
vs-branch-9
Apr 24, 2025
Merged

vs-branch-9#37
VatsalSy merged 3 commits intomainfrom
vs-branch-9

Conversation

@VatsalSy
Copy link
Member

  • Added theme initialization script to layouts
  • Changed featured

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 24, 2025

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • The website now automatically applies a light or dark theme based on your saved preference or system settings, ensuring consistent appearance on every visit.
  • Content Updates

    • Updated "Featured" tags in the research section to highlight the most relevant papers.

Summary by CodeRabbit

  • New Features
    • Added automatic theme initialization based on saved preferences or system settings, ensuring the preferred theme is applied on page load.
  • Content Updates
    • Updated the "Featured" tag for research papers: removed from one paper and added to another.

Walkthrough

A new inline script for initializing the website's theme based on user preference or system settings was introduced via the _includes/theme-init.html file. This script is now included at the start of the <head> section in multiple layout templates to ensure the theme is set before any other head content loads. Additionally, the "Featured" tag was re-assigned between two research papers in the research index markdown file, with no other content changes.

Changes

File(s) Change Summary
_includes/theme-init.html Added a script to initialize the website theme on page load based on localStorage or system color scheme.
_layouts/default.html, _layouts/research.html, _layouts/teaching-course.html,
_layouts/teaching.html, _layouts/team.html
Included the theme-init.html partial at the start of the <head> section in each layout template.
_research/index.md Swapped the "Featured" tag between two research papers; no other content or metadata changes.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant Browser
    participant theme-init.html

    User->>Browser: Loads page
    Browser->>theme-init.html: Executes inline script
    theme-init.html->>Browser: Checks localStorage for 'theme'
    alt Theme found in localStorage
        theme-init.html->>Browser: Set data-theme to stored value
    else No theme in localStorage
        theme-init.html->>Browser: Check prefers-color-scheme
        alt Prefers dark
            theme-init.html->>Browser: Set data-theme to 'dark'
        else Prefers light
            theme-init.html->>Browser: Set data-theme to 'light'
        end
    end
    Browser->>User: Renders page with selected theme
Loading

Poem

In the head, a script now hops,
To set the theme before the page pops!
Dark or light, it knows your way,
From localStorage or what your system may say.
And in research news, a feature swaps,
While bunnies bounce and never stop!
🐇✨


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f99e973 and d4f7eb1.

📒 Files selected for processing (1)
  • _includes/theme-init.html (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • _includes/theme-init.html

🪧 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 generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @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
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)
_layouts/default.html (1)

4-4: Ensure theme-init.html is included early and consider DRY refactor
Including the theme-init partial at the very top of <head> guarantees correct initial theme. Verify that _includes/theme-init.html exists and is spelled correctly. To reduce duplication across layouts, you could extract common <head> elements (meta tags, preload links, theme-init include) into a shared include.

_layouts/team.html (1)

4-4: Verify inclusion of theme-init partial in team layout
Including the partial here is correct to apply the theme before other head content. As a future improvement, centralize repeated head markup (including this include) in a single snippet to ease maintenance across all layouts.

_layouts/research.html (1)

4-4: Confirm theme-init inclusion in research layout
Placement of {% include theme-init.html %} as the first line in <head> is appropriate. To avoid having to update multiple layouts for future head changes, consider moving shared head elements into one include file.

_layouts/teaching.html (1)

4-4: Validate theme-init inclusion in teaching layout
This aligns with other layouts by setting the theme early. For maintainability, you might consolidate all common head setup into one include and then include it here (and in other layouts) instead of repeating.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between f7702bf and f99e973.

📒 Files selected for processing (7)
  • _includes/theme-init.html (1 hunks)
  • _layouts/default.html (1 hunks)
  • _layouts/research.html (1 hunks)
  • _layouts/teaching-course.html (2 hunks)
  • _layouts/teaching.html (1 hunks)
  • _layouts/team.html (1 hunks)
  • _research/index.md (2 hunks)
🔇 Additional comments (3)
_research/index.md (2)

61-61: Removed “Featured” tag from the 2025 paper — looks correct.
The removal of the <span>Featured</span> tag on entry [15] aligns with the updated prioritization. No further adjustments appear necessary.


127-127: Added “Featured” tag to the 2023 paper — correct assignment.
Marking entry [11] as featured now matches the PR objectives. Ensure that any client-side or build filters rendering “Featured” entries pick up this change.

_layouts/teaching-course.html (1)

4-4:

Details

✅ Verification successful

Insert theme-init include at top of <head> — correct.
Including theme-init.html as the first child of <head> ensures theme logic runs before any other head content. Please verify the same inclusion exists consistently in all other layout templates.

Run this script to confirm:


🏁 Script executed:

#!/bin/bash
# Search all layout files for the theme-init include
rg -n "{% include theme-init.html %}" _layouts

Length of output: 153


🏁 Script executed:

#!/bin/bash
# Search all layout files for the theme-init include using fixed-string matching
rg -F '{% include theme-init.html %}' -n _layouts

Length of output: 338


Confirmed consistent inclusion of theme-init.html at top of <head> in all layout templates.

Verification (include present at line 4 in):

  • _layouts/default.html
  • _layouts/team.html
  • _layouts/teaching.html
  • _layouts/teaching-course.html
  • _layouts/research.html

No further action required.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
@VatsalSy VatsalSy merged commit c8834f8 into main Apr 24, 2025
3 checks passed
@VatsalSy VatsalSy deleted the vs-branch-9 branch April 24, 2025 17:35
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