feat: bookmark and share favorite sessions (#160, #95)#176
Draft
pan93412 wants to merge 4 commits into
Draft
Conversation
Dokploy Preview Deployment
|
878b511 to
489ea92
Compare
There was a problem hiding this comment.
Pull request overview
Adds session bookmarking persisted to local storage, a 議程 / 收藏 view toggle on the schedule, and the ability to share a favorites list via a ?filter= query that previews and can be imported by another user.
Changes:
- New
useFavoritescomposable (provide/inject +useStorage) plusencodeFavorites/decodeFavoriteshelpers for the share link. - New
CpSessionViewToggle,CpSessionShareButton, andCpFavoriteImportBanner;CpSessionItem/CpSessionTableextended withfavorite/readonly/previewprops. pages/session/index.vuewires up filtering, shared-list preview, auto day selection, and import/dismiss;app.vueprovides the store;uno.config.tsadds acp-orangepalette.
Reviewed changes
Copilot reviewed 9 out of 27 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
app/composables/useFavorites.ts |
New favorites store + share encode/decode helpers. |
app/app.vue |
Provides favorites store at root. |
app/pages/session/index.vue |
View toggle, shared preview, import/dismiss, empty states. |
app/components/feature/CpSessionTable.vue |
Reads favorites and forwards preview/readonly to cards. |
app/components/feature/CpSessionItem.vue |
Bookmark button, orange favorited state, readonly indicator. |
app/components/feature/CpSessionViewToggle.vue |
Segmented 議程 / 收藏 control. |
app/components/feature/CpSessionShareButton.vue |
Copies share link via clipboard. |
app/components/feature/CpFavoriteImportBanner.vue |
Import / dismiss banner for shared favorites. |
uno.config.ts |
Adds cp-orange-* palette. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
36 tasks
6d35746 to
e2e7d78
Compare
ed2aa82 to
b3127d0
Compare
Rebuild the favorites (#160) and share (#95) features on the session-filter architecture from #172: page-level state computed into the displayed list, shared base components, and feature components that compose them. - CpSessionItem gains favorite/readonly bookmark state (orange filled icon). - CpSessionTable/CpSessionList forward favorites + a preview (read-only) mode. - session.vue layers the all/favorite/shared view on top of filteredSessions from useSessionFilter, keeping the filter bar and empty banner. - CpSessionViewToggle and CpSessionShareButton compose the shared CpButton. - CpSessionEmptyBanner gains filter/favorite/shared variants. - useFavorites store (provide/inject + useStorage) and cp-orange palette. Closes #160 Closes #95
b3127d0 to
9724abc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
在議程頁(
/session、/en/session)加入收藏(#160)與分享收藏連結(#95)。本 PR 依 #172(議程搜尋/篩選)的設計實踐重寫,把收藏/分享疊在 #172 的架構之上。變更內容
收藏(#160)
議程/收藏切換,於兩種視圖間切換。useStorage,原生序列化Set),重整後保留。cp-orange主題色盤。分享收藏(#95)
收藏視圖且有收藏時出現分享收藏鈕,複製帶?filter=<codes>的連結(逗號分隔、排序的 Pretalx 投稿碼,與 2025 站一致)。?filter=連結會唯讀預覽分享的議程(橘色實心書籤、不可切換),並自動跳到第一個含分享議程的日期。匯入會取代目前收藏、清掉?filter=並切到收藏視圖;忽略僅清掉參數。忽略、沒有匯入,既有收藏不會被清空。對齊 #172 的設計實踐
session.vue、全computed:在 feat: add session search filters (#94) #172 的useSessionFilter→filteredSessions之上,再以displayedSessions疊一層(all/favorite/shared 視圖),往下傳給CpSessionTable/CpSessionList,元件只負責渲染。CpSessionItem維持純展示元件:扁平 props,書籤aria-label由父層解析後以favoriteLabel傳入(避免每張卡片各建一個 i18n scope)。CpButton:CpSessionViewToggle(basic + active)、CpSessionShareButton(secondary + icon slot)皆組合CpButton。CpSessionEmptyBanner加variant(filter/favorite/shared),統一空狀態。CpSessionFilterBar的#controlsslot 置於搜尋框旁:桌機在搜尋框左側、手機置中於搜尋框下方(分享鈕在手機僅顯示圖示、置於切換器右側)。pnpm build預渲染 session 詳情頁時,會透過<NuxtPage>重繪整張議程表。最初給CpSessionItem加了useI18n()+<i18n>區塊,導致每張卡片各建一個 vue-i18n scope,數百卡片 × 683 頁累積至 heap OOM(#172 能正常產生 1970 條路由,此版本在 ~200 頁即爆)。改由父層解析 label 後解決;另把useFavorites的useStorage加上 client-only 守衛,避免 SSR 每頁累積 storage 副作用。測試計畫(Test Plan)
以 Claude-in-Chrome 對 dev server 實測,桌機(1280px)與手機(414px)、中文與英文各跑過;下列已勾選項目皆通過。
1. 收藏切換(#160)
aria-label在「加入收藏」↔「取消收藏」(en:Add to favorites↔Remove from favorites)。2. 收藏視圖
議程/收藏切換存在,視覺與篩選鈕一致。收藏只顯示已收藏議程;無收藏顯示空狀態(favorite變體)。議程顯示全部,收藏狀態保留。3. 與篩選列整合(#172 共存)
收藏視圖中搜尋/教室/標籤仍可作用,且只在收藏範圍內過濾(搜尋「Welcome」→ 只剩對應收藏)。4. 持久化
localStorage保留,橘色/實心書籤還原。5. 分享連結(#95)
收藏視圖且有收藏時才顯示分享收藏。…/session?filter=<codes>(碼排序、逗號分隔,與收藏一致)。6. 開啟分享連結(預覽 + 匯入)
匯入→ 取代本機收藏、清掉?filter=、切到收藏視圖。忽略→ 僅清掉?filter=,原有收藏不變。7. 無效分享連結(防呆)
?filter=ZZZZZZ(格式合法、無對應議程)顯示錯誤橫幅「連結無效……」。忽略、沒有匯入。忽略後清掉參數、回到一般議程。8. i18n / 版面
分享收藏(含文字)在切換器左側、切換器在搜尋框左側,三者等高對齊。議程/收藏置中於搜尋框下方;分享鈕僅圖示、置於切換器右側。9. 自動化
pnpm lint、pnpm typecheck通過。pnpm build通過(1970 routes,OOM 已修)。Closes #160
Closes #95