Skip to content

Conversation

@gamoutatsumi
Copy link
Contributor

@gamoutatsumi gamoutatsumi commented Nov 7, 2025

set speaker_name and session title as id of header in session card
and set scroll-padding-top to adjust anchor scroll event

@gamoutatsumi gamoutatsumi changed the title wip: add link to jump to session header add link to jump to session header Nov 8, 2025
@gamoutatsumi gamoutatsumi marked this pull request as ready for review November 8, 2025 00:46
@ryoppippi ryoppippi requested review from Copilot, mopp, ryoppippi and staticWagomU and removed request for mopp and staticWagomU November 8, 2025 01:26
Comment on lines 35 to 36
<h3 id={encodeURIComponent(`${speaker_name}-${title}`)} class="mb-2 text-2xl font-bold text-gray-900 md:text-3xl">
<a href={`#${encodeURIComponent(`${speaker_name}-${title}`)}`} class="hover:underline">
Copy link
Member

@ryoppippi ryoppippi Nov 8, 2025

Choose a reason for hiding this comment

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

[nits]変数化してもいいかも?

@gamoutatsumi

Copy link
Member

@ryoppippi ryoppippi Nov 8, 2025

Choose a reason for hiding this comment

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

copilotが言うように、session_idを使う方が簡素な気がするが、どっちがいいのだろう
一意なものならなんでもいい気もするが

Copy link
Member

Choose a reason for hiding this comment

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

session_idは一意っぽいな。そっちのが良さそうかも
encodeは多分要らない?はず?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds anchor link functionality to session cards, allowing users to link directly to specific sessions. The implementation includes scroll padding to account for fixed headers when navigating to anchored sections.

Key Changes:

  • Added CSS scroll padding to ensure anchored content is properly visible below fixed headers
  • Implemented clickable anchor links on session speaker names with hover effects
  • Generated unique IDs for each session based on speaker name and title

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
2025/src/styles/global.css Added scroll-padding-top to the html element for proper anchor navigation
2025/src/components/Sessions/Session.astro Added ID and anchor link to speaker names for direct linking to sessions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

}

html {
scroll-padding-top: calc(var(--spacing) * 16)
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Missing semicolon at the end of the CSS rule. This could cause issues with CSS parsing.

Suggested change
scroll-padding-top: calc(var(--spacing) * 16)
scroll-padding-top: calc(var(--spacing) * 16);

Copilot uses AI. Check for mistakes.
Copy link
Member

Choose a reason for hiding this comment

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

@gamoutatsumi これも多分必要かも?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

修正済み

Comment on lines 35 to 36
<h3 id={encodeURIComponent(`${speaker_name}-${title}`)} class="mb-2 text-2xl font-bold text-gray-900 md:text-3xl">
<a href={`#${encodeURIComponent(`${speaker_name}-${title}`)}`} class="hover:underline">
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

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

Using encodeURIComponent for HTML id attributes is problematic. HTML IDs have specific character restrictions and encodeURIComponent produces characters like % that, while technically valid in HTML5, can cause issues with CSS selectors and some JavaScript methods. Additionally, combining speaker name and title could result in very long IDs. Consider using a simpler ID like the session_id prop that's already available, or create a slug function that replaces spaces with hyphens and removes special characters.

Suggested change
<h3 id={encodeURIComponent(`${speaker_name}-${title}`)} class="mb-2 text-2xl font-bold text-gray-900 md:text-3xl">
<a href={`#${encodeURIComponent(`${speaker_name}-${title}`)}`} class="hover:underline">
<h3 id={Astro.props.session_id} class="mb-2 text-2xl font-bold text-gray-900 md:text-3xl">
<a href={`#${Astro.props.session_id}`} class="hover:underline">

Copilot uses AI. Check for mistakes.
Copy link
Member

@ryoppippi ryoppippi left a comment

Choose a reason for hiding this comment

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

LGTM

@ryoppippi ryoppippi merged commit 137c612 into vim-jp:main Nov 8, 2025
3 checks passed
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.

2 participants