Conversation
Deploying nyx with
|
| Latest commit: |
b49e815
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://269c2780.nyx-2cw.pages.dev |
| Branch Preview URL: | https://feat-marginnotes.nyx-2cw.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR implements margin notes (also called sidenotes) for blog posts, allowing inline annotations that expand on mobile and appear in the margin on wider screens. The implementation uses Svelte's context API to manage note numbering and includes responsive styling.
- Creates a reusable
Margincomponent with toggle functionality for mobile and persistent display for desktop - Implements a context-based counter system to automatically number margin notes sequentially
- Updates post page layout to accommodate margin notes with adjusted spacing and positioning
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
src/lib/stores/sidenote.ts |
New store implementing Svelte context for sequential numbering of margin notes |
src/components/posts/Margin.svelte |
New component for rendering margin notes with responsive behavior (inline toggle on mobile, margin display on desktop) |
src/routes/posts/[slug]/+page.svelte |
Initializes margin note counter, updates layout constraints to support margin positioning, adds post footer |
src/routes/about/+page.svelte |
Removes commented-out code and local scroll-padding-top style in favor of global implementation |
src/app.css |
Adds global scroll-padding-top for anchor navigation, normalizes quote style in @plugin directive |
content/posts/agno-stop-button.svx |
Demonstrates margin note usage with explanatory note about ASGI in table cell |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| } | ||
|
|
||
| .sidenote.expanded { | ||
| max-height: 500px; |
There was a problem hiding this comment.
The hardcoded max-height value of 500px may cause content truncation for longer margin notes. Consider using a larger value or calculating the height dynamically to ensure all content is visible when expanded.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
# Conflicts: # src/components/posts/Margin.svelte
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| </header> | ||
|
|
||
| <article class="prose mx-auto mb-6 max-w-4xl"> | ||
| <article class="prose relative mb-6 max-w-none overflow-visible px-4"> |
There was a problem hiding this comment.
The article now uses "max-w-none" instead of "max-w-4xl", which removes the maximum width constraint. This could cause the content to become uncomfortably wide on large screens. Consider keeping a reasonable max-width for better readability while still allowing space for margin notes, or use a more specific container strategy.
| | Method | Use Case | Pros | Cons | | ||
| |----------------------|---------------------------------------|-----------------------------|--------------------------------| | ||
| | HTTP Disconnect | FastAPI streaming endpoints | Simple, no infra needed | Relies on ASGI behavior | | ||
| | HTTP Disconnect | FastAPI streaming endpoints | Simple, no infra needed | Relies on ASGI behavior<Margin>ASGI (Asynchronous Server Gateway Interface) is Python's async web server spec. Breaking down ASGI vs WSGI vs WGSI vs RSGI is a whole other topic.</Margin> | |
There was a problem hiding this comment.
Typo in the margin note: "WGSI" should be "WSGI" (Web Server Gateway Interface). The correct acronym sequence should be "ASGI vs WSGI vs RSGI".
| | HTTP Disconnect | FastAPI streaming endpoints | Simple, no infra needed | Relies on ASGI behavior<Margin>ASGI (Asynchronous Server Gateway Interface) is Python's async web server spec. Breaking down ASGI vs WSGI vs WGSI vs RSGI is a whole other topic.</Margin> | | |
| | HTTP Disconnect | FastAPI streaming endpoints | Simple, no infra needed | Relies on ASGI behavior<Margin>ASGI (Asynchronous Server Gateway Interface) is Python's async web server spec. Breaking down ASGI vs WSGI vs RSGI is a whole other topic.</Margin> | |
| <span class="marginnote" class:expanded | ||
| ><span class="marginnote-number">[{number}]</span>{@render children()}</span | ||
| > |
There was a problem hiding this comment.
The margin note content in the expanded state should have an id attribute that corresponds to the aria-expanded button, following proper ARIA relationships. Consider adding an id to the margin note span and using aria-controls on the button to link them together for better accessibility.
| .marginnote { | ||
| display: block; | ||
| position: absolute; | ||
| right: 0; | ||
| top: auto; | ||
| transform: translateX(calc(100% + 1rem)); | ||
| width: 200px; |
There was a problem hiding this comment.
The absolute positioning of margin notes on desktop (line 94) relies on the parent having position: relative. However, the margin notes may not align correctly if they appear within nested elements inside the article. Consider documenting this requirement or using a more robust positioning strategy like CSS Grid or Flexbox at the article level.
| .marginnote.expanded { | ||
| max-height: 500px; |
There was a problem hiding this comment.
Using max-height for transitions with a large fixed value (500px) can cause janky animations when the actual content is much smaller. Consider using a more precise max-height value based on the actual content height, or use a different animation approach like CSS grid animations or the View Transitions API for smoother performance.
| console.warn('Margin note used outside of initMarginNoteCounter context'); | ||
| return 0; |
There was a problem hiding this comment.
Returning 0 when the context is not found could lead to multiple margin notes having the same number (0) if initMarginNoteCounter() is not called properly. Consider throwing an error instead to make this failure mode more visible during development, or return a unique identifier to prevent duplicate numbers.
| console.warn('Margin note used outside of initMarginNoteCounter context'); | |
| return 0; | |
| throw new Error('Margin note used outside of initMarginNoteCounter context'); |
No description provided.