@luziyang2026/dsh-question-nav 0.7.3 → 0.7.4

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.
package/src/settings.ts CHANGED
@@ -1,9 +1,10 @@
1
1
  /**
2
2
  * Host-side durable settings for the question-nav plugin, registered into the
3
- * DSH user-settings document. Currently one field: which edge of the
4
- * conversation column the rail anchors to (`align`). The browser half reads
5
- * the same namespace through the settings scope (`ctx.settingsScope.bind`)
6
- * and routes the user's choice back through `scope.set`.
3
+ * DSH user-settings document. Two fields: which edge of the conversation
4
+ * column the rail anchors to (`align`) and how many hidden dots one ▲/▼
5
+ * paging-button click reveals (`pageSize`). The browser half reads the same
6
+ * namespace through the settings scope (`ctx.settingsScope.bind`) and routes
7
+ * the user's choice back through `scope.set`.
7
8
  *
8
9
  * @module dsh-question-nav/settings
9
10
  */
@@ -14,16 +15,23 @@ import {
14
15
  ALIGN_FIELD, ALIGN_OPTIONS, DEFAULT_ALIGN, QUESTION_NAV_SETTINGS_NS,
15
16
  type AlignPreference,
16
17
  } from './core/align.ts'
18
+ import {
19
+ DEFAULT_PAGE_SIZE, PAGE_SIZE_FIELD, PAGE_SIZE_OPTIONS,
20
+ type PageSize,
21
+ } from './core/page-size.ts'
17
22
 
18
23
  /** Durable settings section shared by the Host schema and the browser scope. */
19
24
  export interface QuestionNavSettings {
20
25
  /** Anchor edge of the rail. */
21
26
  align: AlignPreference
27
+ /** Dots revealed per ▲/▼ paging-button click. */
28
+ pageSize: PageSize
22
29
  }
23
30
 
24
31
  /** Durable settings schema; also the wire envelope the browser scope validates against. */
25
32
  export const QuestionNavSettingsSchema: z<QuestionNavSettings> = z.object({
26
33
  [ALIGN_FIELD]: z.union([...ALIGN_OPTIONS]).default(DEFAULT_ALIGN),
34
+ [PAGE_SIZE_FIELD]: z.union([...PAGE_SIZE_OPTIONS]).default(DEFAULT_PAGE_SIZE),
27
35
  })
28
36
 
29
37
  /** The settings namespace this plugin owns, branded for the Host registry.