This lands the clue collection line on top of origin/dev (v0.32.1, DSH
0.2.2-rc.2). The 14 commits that carried it are squashed into this one
because every one of them overlapped upstream's own changes (version,
19 dictionaries, CHANGELOG), and each intermediate commit would have
failed to compile against rc.2's menu API. The pre-integration head is
kept at backup/clues-uiux-refresh-pre-rebase.
What the feature is:
- a Clues tab that reads local files, Feishu tasks/docs and GitHub
issues/pulls through one source registry, with a scope row, shared
search, filters, paging and stable [[dsh-clue:...]] references;
- one window host for detail, pack management, source configuration,
new pack and sharing (preview and edit are separate paths: a read is
never saved over);
- .cluepack export/import with per-row resolvability previews;
- a source runtime that owns dependency installs and connection
authorization (gh, lark-cli device code) and only probes on an
explicit read;
- the public betterSidebarClues service and the windows capability
(features gains clues / windowHost).
Merged with upstream rather than over it:
- the settings section keeps upstream's start-page takeover group and
this branch's clue sources group; navigation is now six groups;
- the dictionaries keep both sides' new keys (1211 each, verified equal
across all 19), the external-plugin guide and CHANGELOG keep both
histories, and service features list both capability sets.
Adapted to 0.2.2-rc.2:
- menu call sites use anchorPoint instead of getAnchorRect;
- the shared SelectMenu mounts the host menu only while open, because
rc.2's Menu reads the DOM during render and broke server-rendered
settings surfaces;
- the submenu flip workaround stays deleted (the host positions
submenus now), pinned by an updated layout-css assertion.
Version 0.33.0 (three synced spots) with a new 未发布 / Unreleased
changelog section; package.json regains the ./clues export, lib/clues.js
and the uqr dependency that upstream never had.
Gates: typecheck, lint, 5410 unit tests, build, check:consumer-types and
the full mount lane (35 passed) against dsh 0.2.2-rc.2 in Chromium.
Keep the contributor independent-page implementation, but make it opt-in: the default is still one shared page with the session last/newest reattach, and Settings -> Side card -> Side chat can switch to one native page per thread. The descriptor gains a dynamic multiple predicate, native sync re-registers on a flip, and occurrence bindings are read/written only for sidebar://sidechat/<uuid> contentIds so the shared page can never be captured by an old binding.
Long subtitles were clamped to two lines and grew the card; keep them on one line with a text-overflow ellipsis, and pin the rule with a CSS regression test.
Better Sidebar rows now use the same tabsEnabled feature switch in the reorder dialog and the start-page inventory; disabled rows stay in the inventory so they can be turned back on. The shared Switch now derives the next value from the controlled prop, fixing switches that could be turned off but not back on.
Call webTerminals launcher methods on the service (the detached call lost its remote receiver), and restore the host browse/create plugin rows in an always-present More card alongside icon-plus-title overflow rows.
Add centered/top alignment, a default-on start-page takeover switch, icon-plus-title More rows, and share the row-count input between settings and the reorder dialog.
Replace the host guide body with a plugin start page: responsive two-column cards, configurable rows, a More card for overflow, persisted order and visibility in Side Card settings, and the terminal card shell menu through the host webTerminals service.
A tab body keys memos and effects off `scope` (the diff pane resolves its
media/html routes from it, the editor restores its preview scroll, the side
chat rebuilds its prose-rewrite cache), but the tab cell built
`{ sessionId, cwd }` fresh on every render. Every such dependency therefore
looked changed whenever the cell re-rendered — which the memo comparator
allows exactly when a COMPARED field moves: `expanded` on a directory toggle,
plus `revealed`, `localeRevision`, `tabsVersion`. The diff preview then
re-ran its whole-document rewrite and its content tab re-issued a whole-file
`fs.read`, flashing its loading row.
`useSessionScope` is now the one place a scope for a component tree is built;
the tab cell, the diff tab, the native tab adapter, and the shell's badge /
rightActions / `+` menu / lifecycle-callback seams all use it. Those last
ones are documented external plug-in surfaces, so a plug-in memoizing on
`scope` stops churning on every unrelated re-render too.
Stabilizing the object removes the only path the diff pane's `content` tab
had to re-read after the file changed on disk, so the header's refresh button
now drives it explicitly (the pane owns the gesture; the loader no longer
leaks its internal counter).
Seven comments asserted that the scope object's identity churns on every
render; that premise is gone, so the ones that still apply say what they
actually guard.
Use an activation-scoped Cordis controller for session, agent, and job-owner entries. Reuse native Context tabs, cancel stale navigation, and close source overlays without canceling pending requests.
Verify optional capability lifecycle, truthful job ownership, three real dsh-context configurations, and the existing mount regression suite.
`fileParamsOf` already split the `path:line` spec off the address (#828)
but kept only `spec.path` — so both spellings opened the file and left the
reader on line 1: `path:131` dropped the parsed line, and the host's own
`#L131` fragment was already delivered as `navigation.params.line` and
dropped just the same.
Carry the line the rest of the way: address → `SidebarTab.line` →
`FileViewerProps.line` → one reveal in the text editor. Both spellings
land on the same row.
Three decisions:
- `line` is transient: `sanitizePersistedTab` copies a whitelist and this
field is deliberately left out of it, so a reload does not yank the
reader back to a line a link named days ago. Same treatment as
`revealed`.
- markdown/html flip out of preview when a line is present: preview has no
source lines to put a cursor on, and its own mount-time scroll restore
would fight the jump (both write the same `scrollTop`). The reference
asked for source, so the flip does not record the key and the re-run
after the mode change does the jump — which also dissolves the conflict
instead of arbitrating it.
- A range keeps only its first line and the column is dropped: the editor
has exactly one cursor.
The record must also be able to DROP the line, not only set it — an
in-place switch from `a.ts:131` to a bare `a.ts` would otherwise leave 131
behind and the editor would bounce the reader back on every notification.
Comparing against the current value instead of "was one passed" also keeps
the synthetic record's identity when neither side has one, which matters
because the host keeps visited bodies mounted.
The native right sidebar keeps at most ONE page tab per kind, so a side chat
tab is never a copy: every open re-delivers the same tab with fresh navigation
params and an incremented `navigation.revision` (verified in the pinned host's
client bundle: `TabDomain.navigate` replaces the whole target and bumps the
revision, and `openContent` settles an already-held page tab through it). Two
opposite mistakes followed from that: `records.ensure` only read the seed
`meta` when it MINTED a record (so the header thread menu closed and nothing
changed — #762), while adopting it on every pass would clobber the thread id
the view writes back through `updateTab` (the orphan `Side: New thread` half of
#684).
Adopt a navigation's `params.meta` exactly once per revision, and reattach an
unbound auto-creating tab to the thread its session was last in instead of
minting another empty one.
Rewritten against the current dev tree rather than merged from the PR:
- #776 (7cf9626) made a record key `(seat session, native tab id)`; the
revision ledger is keyed the same way and is dropped together with the
record — in `drop` AND in `retain(sessions)`, which also forgets records.
- dev's existing branch never wrote `meta` and folds a url seed into
`nextPath`, so the PR's url/meta merge has no counterpart here and is
deliberately not ported: "revision unchanged" simply leaves `meta` alone,
which is what keeps #684's other half fixed.
- `updateTab` takes the seat session as its third argument (same commit), so
the reattach names it like the rest of the view does.
- The "newest real thread, placeholders last" heuristic already exists on dev
(477f627, the archive fallback); it is extracted into `newestThreadId` and
reused instead of being copied a second time.
- The remembered thread uses the client store's key space
(`dsh-sidebar:v1:sidechat-thread`), not the PR's `dsh-better-sidebar:*`.
- `openNewThread` starts the thread first and parks it for `createTab`, and an
auto-creating tab no longer offers a manual create button while it binds.
Tests (the PR reported none): the revision gate, its no-revision guard (both
fail on the unported adapter), the call-site wiring through `NativeTabBody`,
plus the two dev-side records cases around them.
Refs #839
The native right sidebar keeps at most ONE page tab per kind, so a side chat
tab is never a copy: every open re-delivers the same tab with fresh navigation
params and an incremented `navigation.revision` (verified in the pinned host's
client bundle: `TabDomain.navigate` replaces the whole target and bumps the
revision, and `openContent` settles an already-held page tab through it). Two
opposite mistakes followed from that: `records.ensure` only read the seed
`meta` when it MINTED a record (so the header thread menu closed and nothing
changed — #762), while adopting it on every pass would clobber the thread id
the view writes back through `updateTab` (the orphan `Side: New thread` half of
#684).
Adopt a navigation's `params.meta` exactly once per revision, and reattach an
unbound auto-creating tab to the thread its session was last in instead of
minting another empty one.
Rewritten against the current dev tree rather than merged from the PR:
- #776 (7cf9626) made a record key `(seat session, native tab id)`; the
revision ledger is keyed the same way and is dropped together with the
record — in `drop` AND in `retain(sessions)`, which also forgets records.
- dev's existing branch never wrote `meta` and folds a url seed into
`nextPath`, so the PR's url/meta merge has no counterpart here and is
deliberately not ported: "revision unchanged" simply leaves `meta` alone,
which is what keeps #684's other half fixed.
- `updateTab` takes the seat session as its third argument (same commit), so
the reattach names it like the rest of the view does.
- The "newest real thread, placeholders last" heuristic already exists on dev
(477f627, the archive fallback); it is extracted into `newestThreadId` and
reused instead of being copied a second time.
- The remembered thread uses the client store's key space
(`dsh-sidebar:v1:sidechat-thread`), not the PR's `dsh-better-sidebar:*`.
- `openNewThread` starts the thread first and parks it for `createTab`, and an
auto-creating tab no longer offers a manual create button while it binds.
Tests (the PR reported none): the revision gate, its no-revision guard (both
fail on the unported adapter), the call-site wiring through `NativeTabBody`,
plus the two dev-side records cases around them.
Refs #839
Co-authored-by: waser0434 <178004182+Waser750@users.noreply.github.com>
Two conflicts, both in the native tab adapter's per-session work — main's
`5c95002` moved the expansion set into the plugin store's session state while
this branch moved the RECORD identity to `sessionId::tabId`:
- `src/client/native/tab-adapter.tsx`: keep main's store-backed expansion as
the authority (`attachStore` / `syncExpanded` / `getSessionStates().expanded`)
and this branch's seat-scoped identity (`views` keyed `sessionId::tabId`,
`get/has/update/drop/versionOf/retain` take the seat session). `toggleExpanded`
keeps main's active-`reduce` / background-`reduceFor` split, but locates the
record by its seat and writes the SCOPE session's set — the set every view of
that session mirrors.
- `tests/native-surface.spec.ts`: main's five expansion cases adapted to the
session-scoped API (seat session on `ensure`, two-arg `get`/`drop`, seat on
`toggleExpanded`); the branch's cases now bind a store before toggling, since
expansion no longer lives in the record itself.
The `files` takeover guard and its registration invariants come from
main; this merge drops the branch's duplicate.