dsh-mega-chat-nav 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (192) hide show
  1. package/LICENSE +201 -0
  2. package/README.en.md +149 -0
  3. package/README.md +149 -0
  4. package/cordis.patch.yml +4 -0
  5. package/lib/client/NavOverlay.js +35 -0
  6. package/lib/client/NavRail.js +12 -0
  7. package/lib/client/QuestionNavSettingsTab.js +26 -0
  8. package/lib/client/QuestionNavStrip.js +555 -0
  9. package/lib/client/components/ConfigPanel.js +14 -0
  10. package/lib/client/components/DotRail.js +62 -0
  11. package/lib/client/components/NavOverlay.js +121 -0
  12. package/lib/client/components/NavRail.js +97 -0
  13. package/lib/client/components/RailDispatch.js +22 -0
  14. package/lib/client/components/RailHost.js +79 -0
  15. package/lib/client/components/SearchBox.js +66 -0
  16. package/lib/client/components/SettingsPage.js +46 -0
  17. package/lib/client/components/StandaloneSettings.js +16 -0
  18. package/lib/client/components/codex/CodexRail.js +139 -0
  19. package/lib/client/components/deepseek/DeepseekRail.js +264 -0
  20. package/lib/client/components/minimal/MinimalRail.js +135 -0
  21. package/lib/client/components/minimal/cards.js +32 -0
  22. package/lib/client/components/minimal/dot.js +11 -0
  23. package/lib/client/components/minimal/hint.js +30 -0
  24. package/lib/client/components/minimal/paging.js +5 -0
  25. package/lib/client/components/minimal/quick-settings.js +28 -0
  26. package/lib/client/components/minimal/search.js +67 -0
  27. package/lib/client/components/minimal/useRail.js +716 -0
  28. package/lib/client/components/rail/cards.js +32 -0
  29. package/lib/client/components/rail/hint.js +30 -0
  30. package/lib/client/components/rail/paging.js +5 -0
  31. package/lib/client/components/rail/quick-settings.js +28 -0
  32. package/lib/client/components/rail/search.js +76 -0
  33. package/lib/client/components/rail/useRail.js +845 -0
  34. package/lib/client/components/settings/SettingsPage.js +46 -0
  35. package/lib/client/components/settings/SettingsTab.js +17 -0
  36. package/lib/client/components/settings/StandaloneSettings.js +16 -0
  37. package/lib/client/components/shared/Cascade.js +26 -0
  38. package/lib/client/components/shared/ConfigPanel.js +27 -0
  39. package/lib/client/components/shared/Dot.js +8 -0
  40. package/lib/client/components/shared/Hint.js +5 -0
  41. package/lib/client/components/shared/PagingButton.js +5 -0
  42. package/lib/client/components/shared/RailShell.js +78 -0
  43. package/lib/client/components/shared/SearchBox.js +63 -0
  44. package/lib/client/components/shared/hooks.js +427 -0
  45. package/lib/client/components/shared/types.js +1 -0
  46. package/lib/client/config.js +1 -0
  47. package/lib/client/engines/jump.js +34 -0
  48. package/lib/client/engines/useAtBottom.js +25 -0
  49. package/lib/client/engines/useJump.js +40 -0
  50. package/lib/client/engines/useScrollSpy.js +88 -0
  51. package/lib/client/hooks.js +11 -0
  52. package/lib/client/index.js +312 -0
  53. package/lib/client/jump.js +255 -0
  54. package/lib/client/locales.js +142 -0
  55. package/lib/client/pure.js +61 -0
  56. package/lib/client/settings.js +369 -0
  57. package/lib/client/virtual/VirtualList.js +21 -0
  58. package/lib/client.js +3213 -0
  59. package/lib/compat.js +145 -0
  60. package/lib/config.js +37 -0
  61. package/lib/core/active-dot.js +17 -0
  62. package/lib/core/align.js +9 -0
  63. package/lib/core/config.js +37 -0
  64. package/lib/core/focus.js +38 -0
  65. package/lib/core/jump.js +98 -0
  66. package/lib/core/logic/active-dot.js +16 -0
  67. package/lib/core/logic/focus.js +34 -0
  68. package/lib/core/logic/jump.js +188 -0
  69. package/lib/core/logic/nodes.js +59 -0
  70. package/lib/core/model/nav-item.js +1 -0
  71. package/lib/core/model/turns.js +73 -0
  72. package/lib/core/nav-item.js +1 -0
  73. package/lib/core/nodes.js +57 -0
  74. package/lib/core/page-size.js +7 -0
  75. package/lib/core/question-entry.js +1 -0
  76. package/lib/core/time.js +23 -0
  77. package/lib/core/turn-dots.js +85 -0
  78. package/lib/core/utils/measure.js +24 -0
  79. package/lib/core/utils/time.js +26 -0
  80. package/lib/index.js +64 -0
  81. package/lib/nav-item.js +1 -0
  82. package/lib/nodes.js +59 -0
  83. package/lib/projection.js +126 -0
  84. package/lib/schema.js +26 -0
  85. package/lib/search.js +285 -0
  86. package/lib/settings.js +89 -0
  87. package/lib/types/client/NavOverlay.d.ts +18 -0
  88. package/lib/types/client/NavRail.d.ts +7 -0
  89. package/lib/types/client/QuestionNavSettingsTab.d.ts +16 -0
  90. package/lib/types/client/QuestionNavStrip.d.ts +48 -0
  91. package/lib/types/client/components/ConfigPanel.d.ts +14 -0
  92. package/lib/types/client/components/DotRail.d.ts +15 -0
  93. package/lib/types/client/components/NavOverlay.d.ts +30 -0
  94. package/lib/types/client/components/NavRail.d.ts +16 -0
  95. package/lib/types/client/components/RailDispatch.d.ts +8 -0
  96. package/lib/types/client/components/RailHost.d.ts +27 -0
  97. package/lib/types/client/components/SearchBox.d.ts +9 -0
  98. package/lib/types/client/components/SettingsPage.d.ts +9 -0
  99. package/lib/types/client/components/StandaloneSettings.d.ts +13 -0
  100. package/lib/types/client/components/codex/CodexRail.d.ts +3 -0
  101. package/lib/types/client/components/deepseek/DeepseekRail.d.ts +3 -0
  102. package/lib/types/client/components/minimal/MinimalRail.d.ts +8 -0
  103. package/lib/types/client/components/minimal/cards.d.ts +19 -0
  104. package/lib/types/client/components/minimal/dot.d.ts +14 -0
  105. package/lib/types/client/components/minimal/hint.d.ts +11 -0
  106. package/lib/types/client/components/minimal/paging.d.ts +10 -0
  107. package/lib/types/client/components/minimal/quick-settings.d.ts +8 -0
  108. package/lib/types/client/components/minimal/search.d.ts +27 -0
  109. package/lib/types/client/components/minimal/useRail.d.ts +90 -0
  110. package/lib/types/client/components/rail/cards.d.ts +19 -0
  111. package/lib/types/client/components/rail/hint.d.ts +11 -0
  112. package/lib/types/client/components/rail/paging.d.ts +10 -0
  113. package/lib/types/client/components/rail/quick-settings.d.ts +8 -0
  114. package/lib/types/client/components/rail/search.d.ts +34 -0
  115. package/lib/types/client/components/rail/useRail.d.ts +132 -0
  116. package/lib/types/client/components/settings/SettingsPage.d.ts +9 -0
  117. package/lib/types/client/components/settings/SettingsTab.d.ts +6 -0
  118. package/lib/types/client/components/settings/StandaloneSettings.d.ts +13 -0
  119. package/lib/types/client/components/shared/Cascade.d.ts +14 -0
  120. package/lib/types/client/components/shared/ConfigPanel.d.ts +8 -0
  121. package/lib/types/client/components/shared/Dot.d.ts +17 -0
  122. package/lib/types/client/components/shared/Hint.d.ts +6 -0
  123. package/lib/types/client/components/shared/PagingButton.d.ts +10 -0
  124. package/lib/types/client/components/shared/RailShell.d.ts +43 -0
  125. package/lib/types/client/components/shared/SearchBox.d.ts +18 -0
  126. package/lib/types/client/components/shared/hooks.d.ts +64 -0
  127. package/lib/types/client/components/shared/types.d.ts +101 -0
  128. package/lib/types/client/config.d.ts +9 -0
  129. package/lib/types/client/engines/jump.d.ts +17 -0
  130. package/lib/types/client/engines/useAtBottom.d.ts +1 -0
  131. package/lib/types/client/engines/useJump.d.ts +16 -0
  132. package/lib/types/client/engines/useScrollSpy.d.ts +12 -0
  133. package/lib/types/client/hooks.d.ts +7 -0
  134. package/lib/types/client/index.d.ts +31 -0
  135. package/lib/types/client/jump.d.ts +47 -0
  136. package/lib/types/client/locales.d.ts +142 -0
  137. package/lib/types/client/pure.d.ts +21 -0
  138. package/lib/types/client/settings.d.ts +173 -0
  139. package/lib/types/client/virtual/VirtualList.d.ts +15 -0
  140. package/lib/types/compat.d.ts +44 -0
  141. package/lib/types/config.d.ts +44 -0
  142. package/lib/types/core/active-dot.d.ts +15 -0
  143. package/lib/types/core/align.d.ts +10 -0
  144. package/lib/types/core/config.d.ts +44 -0
  145. package/lib/types/core/focus.d.ts +24 -0
  146. package/lib/types/core/jump.d.ts +39 -0
  147. package/lib/types/core/logic/active-dot.d.ts +15 -0
  148. package/lib/types/core/logic/focus.d.ts +22 -0
  149. package/lib/types/core/logic/jump.d.ts +39 -0
  150. package/lib/types/core/logic/nodes.d.ts +48 -0
  151. package/lib/types/core/model/nav-item.d.ts +12 -0
  152. package/lib/types/core/model/turns.d.ts +30 -0
  153. package/lib/types/core/nav-item.d.ts +12 -0
  154. package/lib/types/core/nodes.d.ts +43 -0
  155. package/lib/types/core/page-size.d.ts +8 -0
  156. package/lib/types/core/question-entry.d.ts +12 -0
  157. package/lib/types/core/time.d.ts +4 -0
  158. package/lib/types/core/turn-dots.d.ts +29 -0
  159. package/lib/types/core/utils/measure.d.ts +12 -0
  160. package/lib/types/core/utils/time.d.ts +4 -0
  161. package/lib/types/index.d.ts +4 -0
  162. package/lib/types/nav-item.d.ts +12 -0
  163. package/lib/types/nodes.d.ts +48 -0
  164. package/lib/types/projection.d.ts +71 -0
  165. package/lib/types/schema.d.ts +37 -0
  166. package/lib/types/search.d.ts +42 -0
  167. package/lib/types/settings.d.ts +99 -0
  168. package/package.json +71 -0
  169. package/src/client/components/RailDispatch.tsx +27 -0
  170. package/src/client/components/codex/CodexRail.tsx +348 -0
  171. package/src/client/components/deepseek/DeepseekRail.tsx +522 -0
  172. package/src/client/components/minimal/MinimalRail.tsx +324 -0
  173. package/src/client/components/minimal/dot.tsx +32 -0
  174. package/src/client/components/rail/cards.tsx +102 -0
  175. package/src/client/components/rail/hint.tsx +50 -0
  176. package/src/client/components/rail/paging.tsx +26 -0
  177. package/src/client/components/rail/quick-settings.tsx +130 -0
  178. package/src/client/components/rail/search.tsx +147 -0
  179. package/src/client/components/rail/useRail.ts +906 -0
  180. package/src/client/components/settings/SettingsPage.tsx +198 -0
  181. package/src/client/components/settings/StandaloneSettings.tsx +28 -0
  182. package/src/client/components/shared/types.ts +99 -0
  183. package/src/client/index.ts +388 -0
  184. package/src/client/jump.ts +293 -0
  185. package/src/client/locales.ts +143 -0
  186. package/src/client/settings.ts +482 -0
  187. package/src/client/styles.css +1580 -0
  188. package/src/compat.ts +161 -0
  189. package/src/index.ts +66 -0
  190. package/src/projection.ts +174 -0
  191. package/src/search.ts +291 -0
  192. package/src/settings.ts +169 -0
package/LICENSE ADDED
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
package/README.en.md ADDED
@@ -0,0 +1,149 @@
1
+ # mega 导航
2
+
3
+ [简体中文](./README.md) · **English**
4
+
5
+ A **session question navigator** for DSH (DeepSeek Harness): show a navigation strip beside the conversation listing every question in the session. No matter how long the conversation grows, it never triggers history loading — jump back to any turn at any time, and full-text search covers even the not-yet-loaded history. It is part of the mega family and supports three visual styles, each with its own independent configuration.
6
+
7
+ ## Highlights
8
+
9
+ - **Zero-expansion full-history index**: a host-side projection folds the whole session log into a compact index — enter a session with zero paging, no message body stays resident, and history window expansion is never triggered;
10
+ - **Three styles**: Minimal (dot rail) / Codex (tick rail) / Deepseek Chat (user-message panel), switchable any time from the nav settings, each style saving its own configuration;
11
+ - **Jump & follow**: click any node to jump straight to that question; the current reading position is highlighted in real time and auto-centered, and keeps following the conversation scroll after a jump;
12
+ - **Paging**: configurable band height (compact / standard / tall), browse with ▲/▼ or the wheel;
13
+ - **Full-text search (incl. unloaded history)**: a host-side route reads the persisted log, with debounce + request cancellation, highlighted hits, and one-click navigation without expanding history;
14
+ - **Favorite filter**: ⭐ to view only favorited questions (saved per session locally);
15
+ - **Docking & mirroring**: dock the strip to the left or right side of the session with automatic mirroring, plus a 0–32px offset;
16
+ - **Display modes**: turn count / search / settings / paging markers each support Always / Peek (1s hold) / Hidden;
17
+ - **Persistent config**: nested schema (general + per-style), written back persistently, survives refresh;
18
+ - **i18n**: UI strings in 中文 / English, following the dsh general language preference instantly.
19
+
20
+ ## Walkthrough
21
+ <div align="center">
22
+ <video autoplay loop muted playsinline src="https://github.com/user-attachments/assets/10a9c2bd-f772-4ea6-9285-b98b63403977"/>
23
+ <br />
24
+ <sub>Video 1 · Walkthrough</sub>
25
+ </div>
26
+ <br />
27
+
28
+ ## Preview
29
+
30
+ <img width="1200" height="1200" alt="Settings page preview" src="https://github.com/user-attachments/assets/b08d5bff-2d7f-4dfa-8ce2-4ba1b5c1891f" />
31
+
32
+ ### Minimal — dot rail
33
+
34
+ One dot per question; hovering pops up a cascade card (configurable 1/3/5) previewing the question, click to jump; the reading-position dot is solid-highlighted and stays centered.
35
+
36
+ <div align="center">
37
+ <img width="705" height="588" alt="Minimal style preview" src="https://github.com/user-attachments/assets/76a5986d-89b9-4853-817b-e82d7370b47d" />
38
+ <br />
39
+ <sub>Fig. 1 · Minimal</sub>
40
+ </div>
41
+
42
+ ### Codex — tick rail
43
+
44
+ A timeline style: one guide line through the band, one horizontal tick per turn; hovering expands the tick into a ripple, and the reading-position tick stays lit.
45
+
46
+ <div align="center">
47
+ <img width="708" height="465" alt="Codex style preview" src="https://github.com/user-attachments/assets/ee01d862-7d84-49ce-a02c-2db1d91597ec" />
48
+ <br />
49
+ <sub>Fig. 2 · Codex</sub>
50
+ </div>
51
+
52
+ ### Deepseek Chat — user-message panel
53
+
54
+ Normally a narrow rail (a short dash handle at each turn's row start); hovering expands into a user-message list panel: shows each user message, highlights the current row, and the dash handle jumps; supports favorite filter and in-place full-text search.
55
+
56
+ <div align="center">
57
+ <img width="423" height="420" alt="Deepseek Chat style preview" src="https://github.com/user-attachments/assets/105f5b1d-6a23-46cb-889f-66151d197d0b" />
58
+ <br />
59
+ <sub>Fig. 3 · Deepseek Chat</sub>
60
+ </div>
61
+
62
+ ### Search
63
+ <div align="center">
64
+ <img width="516" height="551" alt="Search in Minimal/Codex preview" src="https://github.com/user-attachments/assets/4e398477-b049-44e6-8bbb-931117a524db" />
65
+ <br />
66
+ <sub>Fig. 4 · Search in Minimal / Codex</sub>
67
+ </div>
68
+ <br />
69
+
70
+ <div align="center">
71
+ <img width="417" height="267" alt="Search in Deepseek Chat preview" src="https://github.com/user-attachments/assets/912ed1ff-df73-4afc-8ed0-9dc88f6b8665" />
72
+ <br />
73
+ <sub>Fig. 5 · Search in Deepseek Chat</sub>
74
+ </div>
75
+
76
+ ### Settings
77
+
78
+ <div align="center">
79
+ <img width="374" height="435" alt="Quick settings preview" src="https://github.com/user-attachments/assets/4bea5940-1eeb-4a9a-8aa7-e2e0a352aa3c" />
80
+ <br />
81
+ <sub>Fig. 6 · Quick settings</sub>
82
+ </div>
83
+ <br />
84
+
85
+ <div align="center">
86
+ <img width="1200" height="1200" alt="Settings page preview" src="https://github.com/user-attachments/assets/b08d5bff-2d7f-4dfa-8ce2-4ba1b5c1891f" />
87
+ <br />
88
+ <sub>Fig. 7 · Full settings page</sub>
89
+ </div>
90
+
91
+ On screens narrower than 1024px, the nav strip is lightened to a search-only affordance: click the search button at the top-left/right corner of the conversation to open the search drawer.
92
+ <div align="center">
93
+ <img width="1062" height="945" alt="Search drawer preview" src="https://github.com/user-attachments/assets/c2f525bb-b56f-4c99-885b-1cec88decd82" />
94
+ <br />
95
+ <sub>Fig. 8 · Search drawer</sub>
96
+ </div>
97
+
98
+ ## Installation
99
+
100
+ Requires dsh v0.1.1-* . Available via GitHub tag / npm / local package.
101
+
102
+ **GitHub tag**
103
+
104
+ ```
105
+ dsh plugin --profile web add github:<owner>/dsh-mega-chat-nav#v0.1.1
106
+ ```
107
+
108
+ **Local package**
109
+
110
+ ```
111
+ dsh plugin --profile web add dsh-mega-chat-nav-0.1.1.tgz
112
+ ```
113
+
114
+ **npm (publishing on hold, currently unavailable)**
115
+
116
+ ```
117
+ dsh plugin --profile web add dsh-mega-chat-nav@0.1.1
118
+ ```
119
+
120
+ Uninstall:
121
+
122
+ ```
123
+ dsh plugin --profile web remove dsh-mega-chat-nav
124
+ ```
125
+
126
+ > Note: the plugin has a host half and a client half. Host-half changes require restarting dsh web; client-only changes take effect after a page refresh.
127
+
128
+ ## Quick start
129
+
130
+ 1. Switch the **style** in the nav settings: Minimal / Codex / Deepseek Chat (each keeps its own config);
131
+ 2. **Jump**: click any node/dash handle to jump to that question; the reading position auto-highlights and follows;
132
+ 3. **Search**: click 🔍 for full-text search (incl. unloaded history), filterable by user / assistant / tool scopes; hits are highlighted, click to go;
133
+ 4. **Favorites**: click ⭐ to show only favorited questions (toggle favorites on hover cards or message-panel row heads);
134
+ 5. **Dock side**: set Left/Right in settings, auto-mirrored;
135
+ 6. **Hosting**: when mega-settings is installed, the full settings page is collected into its member list (name **mega 导航**); otherwise a standalone full settings page is provided.
136
+
137
+ ## Supported dsh versions & compatibility
138
+
139
+ - **Supported dsh versions: 0.1.1-rc.1, 0.1.1-rc.2**;
140
+ - The host checks the version policy on startup (default `= 0.1.1-*`, the whole 0.1.1 pre-release line); other versions print
141
+ `dsh-mega-chat-nav may not be compatible with dsh <version>, use with caution` in the console, but the plugin still loads;
142
+ - Maintainers can adjust `DSCH_COMPAT_POLICY` in `src/index.ts` (supports > / < / =, wildcards and arrays).
143
+
144
+ ## FAQ
145
+
146
+ **Search does nothing?** Search relies on host-side routes (webServer/sessions). If those services are missing in the deployment, search is unavailable while navigation and other features keep working.
147
+
148
+ **Can assistant thinking (think) content be searched?** Not currently — think content is excluded from search.
149
+
package/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # mega 导航
2
+
3
+ [English](./README.en.md) · **中文**
4
+
5
+ DSH(DeepSeek Harness)的**会话提问导航条**:在会话一侧显示整场对话的提问导航,无论会话多长都不会触发历史加载,随时跳回任意一轮提问,并支持全文搜索包括未加载历史在内的所有内容。
6
+ 属于 mega 系列家族成员之一,支持三种视觉风格,风格配置各自独立、可随时切换。
7
+
8
+ ## 功能一览
9
+
10
+ - **零扩窗全量索引**:host 侧投影折叠整段会话日志为紧凑索引,进入会话零翻页、正文零驻留,绝不触发历史扩窗;
11
+ - **三种风格**:简约(圆点轨)/ Codex(刻度轨)/ Deepseek Chat(用户消息面板),风格可在导航条设置中随时切换,每种风格独立保存自己的配置;
12
+ - **跳转与跟随**:点击任意节点直达对应提问;当前阅读位置在导航条中实时高亮并自动居中跟随,点击跳转后仍继续跟随正文滚动;
13
+ - **翻页浏览**:节点栏条带高度可配(紧凑/标准/高),▲/▼ 或滚轮翻页浏览;
14
+ - **全文搜索(含未加载历史)**:host 侧路由读持久化日志,防抖 + 请求中断,命中词高亮,一次直达,不触发历史扩窗;
15
+ - **收藏筛选**:⭐ 只看已收藏提问,收藏数据按会话本地保存;
16
+ - **停靠与镜像**:导航条可停靠会话左侧/右侧并自动镜像,支持 0–32px 偏移微调;
17
+ - **显示模式**:轮次总数/搜索/设置/翻页标记均支持 常显 / 浮现(停留 1 秒)/ 隐藏 三态;
18
+ - **配置持久化**:嵌套 schema(通用 + 风格专属),写回持久化,刷新不丢;
19
+ - **国际化**:界面词条支持中文 / English,跟随 dsh 通用设置的语言偏好即时切换。
20
+
21
+ ## 流程展示
22
+ <div align="center">
23
+ <video autoplay loop muted playsinline src="https://github.com/user-attachments/assets/10a9c2bd-f772-4ea6-9285-b98b63403977"/>
24
+ <br />
25
+ <sub>视频 1 · 流程展示</sub>
26
+ </div>
27
+ <br />
28
+
29
+ ## 界面预览
30
+
31
+ <img width="1200" height="1200" alt="总配置页-预览" src="https://github.com/user-attachments/assets/b08d5bff-2d7f-4dfa-8ce2-4ba1b5c1891f" />
32
+
33
+ ### 简约(Minimal)—— 圆点轨
34
+
35
+ 每轮提问一个圆点,悬停弹出级联卡片(1/3/5 张可配)预览提问内容,点击直达;阅读位置圆点实心高亮、实时居中。
36
+
37
+ <div align="center">
38
+ <img width="705" height="588" alt="简约风格-预览" src="https://github.com/user-attachments/assets/76a5986d-89b9-4853-817b-e82d7370b47d" />
39
+ <br />
40
+ <sub>图 1 · 简约风格</sub>
41
+ </div>
42
+
43
+ ### Codex —— 刻度轨
44
+
45
+ 时间线风格:一条引导线贯穿条带,每轮一个水平刻度;悬停刻度横向展开成波纹,阅读位置刻度常亮。
46
+
47
+ <div align="center">
48
+ <img width="708" height="465" alt="Codex风格-预览" src="https://github.com/user-attachments/assets/ee01d862-7d84-49ce-a02c-2db1d91597ec" />
49
+ <br />
50
+ <sub>图 2 · Codex风格</sub>
51
+ </div>
52
+
53
+ ### Deepseek Chat —— 用户消息面板
54
+
55
+ 常态一条窄轨(每轮行首短横把手),悬停展开成用户消息列表面板:面板内显示用户消息、当前行高亮、行首短横即跳转把手;支持收藏筛选与就地全文搜索。
56
+
57
+ <div align="center">
58
+ <img width="423" height="420" alt="Deepseek Chat-预览" src="https://github.com/user-attachments/assets/105f5b1d-6a23-46cb-889f-66151d197d0b" />
59
+ <br />
60
+ <sub>图 3 · Deepseek Chat风格</sub>
61
+ </div>
62
+
63
+ ### 搜索
64
+ <div align="center">
65
+ <img width="516" height="551" alt="简约/Codex风格搜索-预览" src="https://github.com/user-attachments/assets/4e398477-b049-44e6-8bbb-931117a524db" />
66
+ <br />
67
+ <sub>图 5 · 简约/Codex风格搜索</sub>
68
+ </div>
69
+ <br />
70
+
71
+ <div align="center">
72
+ <img width="417" height="267" alt="Deepseek Chat风格搜索-预览" src="https://github.com/user-attachments/assets/912ed1ff-df73-4afc-8ed0-9dc88f6b8665" />
73
+ <br />
74
+ <sub>图 5 · Deepseek Chat风格搜索</sub>
75
+ </div>
76
+
77
+ ### 设置
78
+
79
+ <div align="center">
80
+ <img width="374" height="435" alt="简易设置-预览" src="https://github.com/user-attachments/assets/4bea5940-1eeb-4a9a-8aa7-e2e0a352aa3c" />
81
+ <br />
82
+ <sub>图 6 · 简易设置</sub>
83
+ </div>
84
+ <br />
85
+
86
+ <div align="center">
87
+ <img width="1200" height="1200" alt="总配置页-预览" src="https://github.com/user-attachments/assets/b08d5bff-2d7f-4dfa-8ce2-4ba1b5c1891f" />
88
+ <br />
89
+ <sub>图 7 · 总配置页</sub>
90
+ </div>
91
+
92
+ 当页面宽度小于1024px时,导航栏轻量化为搜索功能,在正文左/右上角点击搜索按钮可呼出搜索抽屉
93
+ <div align="center">
94
+ <img width="1062" height="945" alt="搜索抽屉-预览" src="https://github.com/user-attachments/assets/c2f525bb-b56f-4c99-885b-1cec88decd82" />
95
+ <br />
96
+ <sub>图 8 · 搜索抽屉</sub>
97
+ </div>
98
+
99
+ ## 安装
100
+
101
+ 需要 dsh v0.1.1-* 。提供 GitHub tag / npm /本地包三种安装方式。
102
+
103
+ **GitHub tag**
104
+
105
+ ```
106
+ dsh plugin --profile web add github:<owner>/dsh-mega-chat-nav#v0.1.1
107
+ ```
108
+
109
+ **本地包**
110
+
111
+ ```
112
+ dsh plugin --profile web add dsh-mega-chat-nav-0.1.1.tgz
113
+ ```
114
+
115
+ **npm(发布暂缓中,暂不可用)**
116
+
117
+ ```
118
+ dsh plugin --profile web add dsh-mega-chat-nav@0.1.1
119
+ ```
120
+
121
+ 卸载:
122
+
123
+ ```
124
+ dsh plugin --profile web remove dsh-mega-chat-nav
125
+ ```
126
+
127
+ > 说明:插件分 host 与 client 两半。改动 host 侧需要重启 dsh web;纯界面(client)改动刷新页面即可生效。
128
+
129
+ ## 快速上手
130
+
131
+ 1. 在导航条设置中切换**风格**:简约 / Codex / Deepseek Chat(各风格独立保存配置);
132
+ 2. **跳转**:点击导航条任意节点/把手直达对应提问,阅读位置自动高亮跟随;
133
+ 3. **搜索**:点 🔍 全文搜索(含未加载历史),可按用户/助手/工具范围过滤;命中词高亮,点击直达;
134
+ 4. **收藏**:点 ⭐ 只看已收藏提问(在悬停卡或消息面板行首切换收藏);
135
+ 5. **停靠侧**:设置中对齐左/右,随停靠侧自动镜像;
136
+ 6. **收纳**:安装了 mega-settings 时,完整设置页自动收纳进其成员列表(名称 **mega 导航**);未安装时提供自足完整设置页。
137
+
138
+ ## 适用 dsh 版本与兼容性
139
+
140
+ - **适用 dsh 版本:0.1.1-rc.1、0.1.1-rc.2**;
141
+ - 宿主启动会按版本策略自检(默认 `= 0.1.1-*`,即 dsh 0.1.1 全预发布线);其他版本控制台会打印
142
+ `dsh-mega-chat-nav 可能不适配 dsh <版本> 版本,请慎重使用`,插件仍可加载使用;
143
+ - 维护者可自行调整 `src/index.ts` 的 `DSCH_COMPAT_POLICY`(支持 > / < / = 与通配、数组)。
144
+
145
+ ## 常见问题
146
+
147
+ **搜索没反应?** 搜索依赖 host 侧路由(webServer/sessions)。若部署环境缺少这些服务,搜索不可用,导航条的跳转等其余功能不受影响。
148
+
149
+ **助手消息的思考(think)内容能搜到吗?** 暂不参与搜索。
@@ -0,0 +1,4 @@
1
+ # dsh bundle patch:row id 避开官方 core row(tools/session/llm/web/permission)
2
+ - insert:
3
+ - id: ui-mega-chat-nav
4
+ name: dsh-mega-chat-nav
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // 悬浮层挂载点(shell.overlay):TabGate 守卫 + 会话子 seat 桥
3
+ import { Fragment, useEffect, useRef, useState } from 'react';
4
+ import { isChatViewVisible, hasTrajectoryView } from "./pure.js";
5
+ export function useScope(scope) {
6
+ const [, force] = useState(0);
7
+ useEffect(() => {
8
+ if (!scope)
9
+ return;
10
+ return scope.subscribe(() => force((n) => n + 1));
11
+ }, [scope]);
12
+ return scope?.getSnapshot().value;
13
+ }
14
+ export function NavOverlay(props) {
15
+ const cfg = useScope(props.scope);
16
+ const [active, setActive] = useState(true);
17
+ const raf = useRef(0);
18
+ // TabGate:rAF 合并检测(chat 可见且无 trajectory)
19
+ useEffect(() => {
20
+ let stopped = false;
21
+ const check = () => {
22
+ if (stopped)
23
+ return;
24
+ const next = isChatViewVisible(document) && !hasTrajectoryView(document);
25
+ setActive((prev) => (prev === next ? prev : next));
26
+ raf.current = requestAnimationFrame(check);
27
+ };
28
+ raf.current = requestAnimationFrame(check);
29
+ return () => { stopped = true; cancelAnimationFrame(raf.current); };
30
+ }, []);
31
+ if (!cfg?.general?.enabled || !active)
32
+ return null;
33
+ const Provider = props.SessionProvider ?? Fragment;
34
+ return _jsx(Provider, { children: props.renderSlot ? props.renderSlot('mega.chat.nav') : null });
35
+ }
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // 会话级导航条(M0 骨架:投影接入 + 悬浮形态;M1 起补三风格)
3
+ import { useState } from 'react';
4
+ import { formatTime, truncate } from "./pure.js";
5
+ export function NavRail(props) {
6
+ const wire = props.useProjection?.('msgNavMessages');
7
+ const items = wire?.items ?? [];
8
+ const [collapsed, setCollapsed] = useState(false);
9
+ const tr = props.t ?? ((k) => k);
10
+ const last = items.length > 0 ? items[items.length - 1] : undefined;
11
+ return (_jsxs("div", { className: "mgs-rail mgs-rail--right", role: "navigation", "aria-label": tr('a11y.list'), children: [_jsx("button", { type: "button", className: "mgs-rail__toggle", onClick: () => setCollapsed((v) => !v), "aria-label": tr(collapsed ? 'collapse.expand' : 'collapse.collapse'), children: collapsed ? '›' : '‹' }), !collapsed && (_jsxs("div", { className: "mgs-rail__body", children: [_jsx("div", { className: "mgs-rail__summary", children: tr('count.messages', { n: items.length }) }), last ? (_jsxs("div", { className: "mgs-rail__last", title: last.text, children: [truncate(last.text, 40), " \u00B7 ", formatTime(last.time)] })) : (_jsx("div", { className: "mgs-rail__empty", children: tr('empty') }))] }))] }));
12
+ }
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ /**
3
+ * The plugin's settings page inside the shell's Plugins section
4
+ * (`settings.plugins.tab`): two segmented controls — which edge of the
5
+ * conversation column the dot rail anchors to, and how many hidden dots one
6
+ * ▲/▼ paging-button click reveals. The choices are written to the
7
+ * `mega-chat-nav` settings namespace (registered by the host half); the strip
8
+ * re-anchors and re-steps live when the snapshot changes.
9
+ *
10
+ * @module dsh-mega-chat-nav/client/settings-tab
11
+ */
12
+ import { useEffect, useState } from 'react';
13
+ import { ALIGN_OPTIONS } from "../core/align.js";
14
+ import { PAGE_SIZE_OPTIONS } from "../core/page-size.js";
15
+ /** Re-render on settings snapshot changes (the register inject face is static). */
16
+ function useSettingsTick(subscribe) {
17
+ const [, bump] = useState(0);
18
+ useEffect(() => subscribe(() => bump((n) => n + 1)), [subscribe]);
19
+ }
20
+ export function QuestionNavSettingsTab(props) {
21
+ useSettingsTick(props.subscribeSettings);
22
+ const align = props.align();
23
+ const pageSize = props.pageSize();
24
+ const t = props.t;
25
+ return (_jsxs("div", { className: 'mgs-settings', children: [_jsx("p", { className: 'mgs-settingsTitle', children: t('settings.align.title') }), _jsx("p", { className: 'mgs-settingsDesc', children: t('settings.align.desc') }), _jsx("div", { className: 'mgs-segmented', role: "radiogroup", "aria-label": t('settings.align.title'), children: ALIGN_OPTIONS.map((option) => (_jsx("button", { type: "button", role: "radio", "aria-checked": align === option, className: align === option ? `${'mgs-segment'} ${'mgs-segmentActive'}` : 'mgs-segment', onClick: () => props.setAlign(option), children: t(option === 'left' ? 'settings.align.left' : 'settings.align.right') }, option))) }), _jsx("p", { className: 'mgs-settingsTitle', children: t('settings.pagesize.title') }), _jsx("p", { className: 'mgs-settingsDesc', children: t('settings.pagesize.desc') }), _jsx("div", { className: 'mgs-segmented', role: "radiogroup", "aria-label": t('settings.pagesize.title'), children: PAGE_SIZE_OPTIONS.map((option) => (_jsx("button", { type: "button", role: "radio", "aria-checked": pageSize === option, className: pageSize === option ? `${'mgs-segment'} ${'mgs-segmentActive'}` : 'mgs-segment', onClick: () => props.setPageSize(option), children: option }, option))) })] }));
26
+ }