Repository navigation
[feature] standalone docs get an "open in workspace" toolbar - #11
Merged
Merged
Conversation
A document opened on its own (a link from Discord, a bookmark) only had a faint "◉ pensieve" pill that led to the graph home, so getting to the same document inside the workspace shell meant finding it again by hand. The pill is now a two-part toolbar in the bottom-left corner: the workspace name goes to the workspace home, "在 workspace 中開啟" opens this document in the shell with the sidebar (the shell already deep-links through #/path). Bottom-left because every doc starts with a masthead in its top padding. It is built before the graph fetch so it no longer disappears when that request fails, follows the reader's language, and is hidden when printing. Public share links (/s/*) are untouched: they never inject the workspace nav. The nav script moved to lib/doc-nav.ts; values are serialised with < escaped so a workspace name containing </script> cannot end the inline script.
✅ SonarQube Quality Gate passed — pathorsAI_pensieve0 open issues on this PR. |
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.
單獨打開文件(Discord 連結、書籤)時,原本只有左上角一顆淡淡的「◉ pensieve」,而且只連到 graph 首頁。
/o/<slug>#<path>,在有側欄的 workspace 殼裡打開同一份文件(殼本來就支援 hash deep link)。/s/*)不受影響,那條路由本來就不注入 workspace nav。lib/doc-nav.ts;注入的值把<轉義,workspace 名稱含</script>也不會提早結束 script。驗證:tsc、next build 通過;用暫時的 preview route(未 commit)看過淺色、深色、375px,兩個連結的 href 正確,名稱含
</script>時以純文字顯示。