議程資訊頁面#105
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a session detail overlay/page under the existing sessions table, along with router scroll behavior adjustments to preserve scroll position when navigating between session routes.
Changes:
- Add
app/pages/session/[id].vueto display session details in a modal-style overlay. - Nest the session detail route under
app/pages/session.vuevia<NuxtPage />. - Add global router
scrollBehaviorcustomization for session-to-session navigation. - Render session abstracts and speaker bios via
<MDC>inCpSessionInfoCard.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| app/router.options.ts | Adds custom scroll behavior, including special handling for session routes. |
| app/pages/session/[id].vue | Implements the session detail overlay page and close/escape handling. |
| app/pages/session.vue | Adds <NuxtPage /> to render nested session detail routes. |
| app/components/feature/CpSessionInfoCard.vue | Switches description/bio rendering from plain text to MDC/markdown rendering. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| onMounted(() => { | ||
| document.body.style.overflow = 'hidden' | ||
|
|
||
| function onKeydown(e: KeyboardEvent) { | ||
| if (e.key === 'Escape') { | ||
| close() | ||
| } | ||
| } | ||
|
|
||
| window.addEventListener('keydown', onKeydown) | ||
|
|
||
| onUnmounted(() => { | ||
| document.body.style.overflow = '' | ||
| window.removeEventListener('keydown', onKeydown) | ||
| }) |
There was a problem hiding this comment.
This modal forces document.body.style.overflow = 'hidden' and restores it to an empty string on unmount. If the body had a non-empty overflow style before opening (or if multiple overlays can stack), this will restore the wrong value. Capture the previous document.body.style.overflow before overwriting it and restore that exact value during teardown.
| onMounted(() => { | |
| document.body.style.overflow = 'hidden' | |
| function onKeydown(e: KeyboardEvent) { | |
| if (e.key === 'Escape') { | |
| close() | |
| } | |
| } | |
| window.addEventListener('keydown', onKeydown) | |
| onUnmounted(() => { | |
| document.body.style.overflow = '' | |
| window.removeEventListener('keydown', onKeydown) | |
| }) | |
| let previousBodyOverflow = '' | |
| function onKeydown(e: KeyboardEvent) { | |
| if (e.key === 'Escape') { | |
| close() | |
| } | |
| } | |
| onMounted(() => { | |
| previousBodyOverflow = document.body.style.overflow | |
| document.body.style.overflow = 'hidden' | |
| window.addEventListener('keydown', onKeydown) | |
| }) | |
| onUnmounted(() => { | |
| document.body.style.overflow = previousBodyOverflow | |
| window.removeEventListener('keydown', onKeydown) |
There was a problem hiding this comment.
暫時不需要,目前不會有其他的值
30a3f25 to
50ccf5e
Compare
7c6b7d1 to
47d6563
Compare
ec3ac0a to
70dad5e
Compare
0a34b4f to
e0141e5
Compare
…eaker bio in CpSessionInfoCard
5d8774c to
ba018d4
Compare
No description provided.