[feature] 列表支援 ?open=<id> 深連結,訂閱與合約可互相跳轉 - #68
Merged
Conversation
✅ SonarQube Quality Gate passed — pathorsAI_internal0 open issues on this PR. |
YJack0000
enabled auto-merge (squash)
September 7, 2026 16:55
yui0303
approved these changes
Sep 7, 2026
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.
問題
PR #64 在訂閱列表加了「合約」欄,但它是純文字 —— 看到某筆訂閱掛在哪張合約上,卻沒辦法點過去。
而且就算做成連到
/dashboard/contracts的連結也不夠用:列表頁的編輯視窗只有「點那一列」才會打開(src/components/row-dialog.tsx),沒有任何方式用網址指定要開哪一列,使用者跳過去之後還是得自己在表格裡翻。做法:
?open=<id>深連結RowDialog新增兩個選用 prop:rowId—— 給了就支援深連結openParam—— query 參數名,預設open網址帶
?open=<rowId>時,那一列的編輯視窗會自動打開,並把該列捲到畫面中央(關掉視窗後看得到自己剛剛開的是哪一列)。視窗關掉時把open從網址上拿掉(router.replace,其餘 query 原樣保留),重新整理才不會又跳出來;只有網址真的帶著這個參數時才會動網址。實作上兩點:
useEffect開啟而不是 initial state,server / client 首次 render 才會一致,不會 hydration mismatch。RowDeepLink小元件並包在<Suspense fallback={null}>裡(useSearchParams的要求),它不畫任何東西。原有行為完全不動:互動元素的 hit test、鍵盤操作、
dialog/sheet兩種變體都照舊。哪些頁面吃到
rowId已接上:合約、訂閱 / 月費、專案、往來對象、發票、交易。互相跳轉
/dashboard/contracts?open=<contractId>的連結,保留原本的截斷與 tooltip。RowDialog本來就會忽略點在<a>上的點擊,所以點連結不會同時打開訂閱的編輯視窗。/dashboard/subscriptions?open=<id>;底部原有的「到訂閱 / 月費管理」連結保留。其他
subscriptions.list.contractLinkLabel,zh-TW + en)。src/db/*、src/lib/mcp/*、migrations 都沒動。bun run lint乾淨、tsc --noEmit零錯誤、bun run build通過(沒有 Suspense boundary 的警告)。