From ac2655c856830359a096a664b6e763e78663f339 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 10:49:51 +0000 Subject: [PATCH 01/51] docs: record first connection lifecycle UX decisions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../iterations/01-pr1136-ux-review.md | 474 ++++++++++++++++-- 1 file changed, 424 insertions(+), 50 deletions(-) diff --git a/docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr1136-ux-review.md b/docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr1136-ux-review.md index 6c4be6c61..62250d6c0 100644 --- a/docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr1136-ux-review.md +++ b/docs/ai-and-plans/features/connection-lifecycle/iterations/01-pr1136-ux-review.md @@ -37,11 +37,17 @@ removal, quoting the actual messages rather than only naming their surfaces. ## How this review was run -**Preparation only so far. No hands-on observations have been made in this review.** +**Preparation followed by the operator's first hands-on feedback on 2026-11-27.** The assistant read the manifest, command handlers, tree recovery paths, retained-view -components and controllers, worker recovery and Azure account flows. The six seeded -Flags describe confirmed code-path gaps or divergences; their severity and actual -runtime impact still need the operator's confirmation. +components and controllers, worker recovery and Azure account flows. The original six +Flags were code-derived seeds. Their bodies now distinguish the operator's observations, +accepted changes, remaining suggestions and version-uncertain reproduction requests. +No product fixes have been implemented in this review. + +Appendix C continues to quote **current source wording**, not pretend approved wording +has shipped. Decisions below and notes beside the relevant scenarios identify the +requested replacements. Operator transcripts omit the supplied server hostname; +that identifier is unnecessary to understand the observed behavior. During the live pass, the person drives the extension and dictates observations; the assistant verifies each observation against the source and updates this ledger and the @@ -249,11 +255,13 @@ The extension aims to recover silently when the connection identity has not chan and to preserve work rather than replay interrupted operations or silently change permissions. Explicit Disconnect offers a tab choice and a single tree Reconnect; changed saved settings permanently retire old webviews, while workers have separately -documented restart rules. The strongest suspected P1 gaps are an offered Shell recovery -that may not open, unnecessarily restrictive worker recovery wording, and inconsistent -feedback between cluster and descendant tree failures. Three P2 Flags cover Retry -feedback placement, stale-action silence, and Playground sign-in completion feedback. -None has yet been confirmed through hands-on use in this review. +documented restart rules. The live pass confirms that Shell and Playground can recover after tree Reconnect +without a new terminal or connection pick, despite their wording. The operator wants +unauthenticated Shell access from failure rows, modal errors for tree-originated actions, +simpler retained-view labels and readable, consistent debugging output. A missing +Disconnect menu item after credential repair still needs current-version reproduction; +Retry/stale-action feedback choices remain open. The lack of a dedicated Playground +sign-in completion message is accepted as-is. --- @@ -261,12 +269,18 @@ None has yet been confirmed through hands-on use in this review. | # | Priority | Item | Status | | --- | --- | --- | --- | -| F1 | **P1** | Open shell recovery is offered when cache eviction can block opening | 🟠 Open | +| F1 | **P1** | Offer unauthenticated Shell from failure rows; choose a clear label | 🟠 Open | | F2 | **P1** | Worker recovery wording requests unnecessary new Shell / connection pick | 🟠 Open | -| F3 | **P1** | Cluster and descendant tree failures use different feedback surfaces | 🟠 Open | +| F3 | **P1** | Use modal failure feedback for tree-originated actions | 🟠 Open | +| F7 | **P1** | Disconnect missing after credential repair; version uncertain | 🟡 Open (soft) | | F4 | **P2** | Retry exceptions appear outside the retained-view dialog | 🟠 Open | | F5 | **P2** | State-drift guards silently terminate explicit recovery clicks | 🟠 Open | -| F6 | **P2** | Playground sign-in succeeds without a completion or rerun cue | 🟠 Open | +| F8 | **P2** | Shell Disconnected output looks like text entered at the prompt | 🟠 Open | +| F9 | **P2** | Shorten Keep open (disabled) to Keep open | 🟠 Open | +| F10 | **P2** | Explain that decoded-password confirmation saves the correctly formatted password | 🟠 Open | +| F11 | **P2** | X label should describe access, not only copying | 🟠 Open | +| F12 | **P2** | Unify connection/worker debug-stat format for human readability | 🟠 Open | +| F6 | **P2** | Playground sign-in succeeds without a completion or rerun cue | 🚫 Closed | ## P0 — Blocking (the user gets stuck) @@ -274,36 +288,78 @@ No P0 seeded. Promote an item only after confirming that no usable recovery path ## P1 — Broken / misleading, or consistency & safety -### F1. Open shell recovery can end before a terminal opens ⚠️ +### F1. Error-recovery Shell should not retry the failing authentication ⚠️ **Priority:** P1 · **Status:** 🟠 Open -**Observation:** Not yet observed live. Fail an initial stored Native-auth connection, -dismiss the modal, and click its Open shell recovery row. +**Observation (operator, 2026-11-27):** a No Authentication connection opened the Shell +and showed a prompt. An invalid key/password opened a Shell that attempted the saved +authentication and failed. Relevant output, with the host omitted: + +```text +Connected to: {test host} +Authentication: No Authentication | Database: test +Type "help" for available commands. +test> +``` + +```text +Failed to connect: Invalid key +Run a command to try connecting again, or close this terminal. +test> +``` + +> **TN leans towards always offering Shell without authentication from error rows.** +> The label should make that difference explicit; “Open shell (w/o auth)” was offered +> as a possible name, not a final wording decision. **Finding:** -- ⚠️ [Every cluster failure offers Open shell](../../../../../src/tree/documentdb/ClusterItemBase.ts#L431), - but [the Shell command refuses to open without cached credentials](../../../../../src/commands/openInteractiveShell/openInteractiveShell.ts#L63). +- ⚠️ [Every cluster failure offers Open shell](../../../../../src/tree/documentdb/ClusterItemBase.ts#L431). + The [current command uses ordinary Shell startup](../../../../../src/commands/openInteractiveShell/openInteractiveShell.ts#L60); + [the worker builds Native authentication from cached credentials](../../../../../src/documentdb/shell/ShellSessionManager.ts#L435), + rather than selecting an unauthenticated diagnostic session for failure rows. + This supports the reported NoAuth-versus-invalid-key behavior. - [Failed startup evicts non-recoverable credentials](../../../../../src/tree/documentdb/ClusterItemBase.ts#L324); [the stored connection calls that cleanup](../../../../../src/tree/connections-view/DocumentDBClusterItem.ts#L386) before returning its recovery children. The user can therefore receive “Not signed in” - instead of the promised diagnostic terminal. + instead of the promised diagnostic terminal. This original pre-assessment branch + remains conditional; it does **not** mean every invalid-key click fails to open. + The operator's tested branch opened and then failed authentication instead. - 🔍 This conflicts with the stated intent that experts can open a Shell on every failure in the [tree architecture guidance](../../../../../.github/skills/tree-cluster-architecture/SKILL.md#failure-presentation-actions-only). It is a command precondition gap, not evidence that Shell automatically repairs authentication. -💡 **Suggestion:** Confirm the failed-auth and failed-network variants separately, then -make the offered action usable or accurately gate/explain it. Do not introduce automatic -sign-in or execution merely to make the row work. +💡 **Suggestion:** For error-row entry only, open a separately unauthenticated Shell +without changing saved credentials or the existing connection identity. Do not silently +fall back to saved credentials after a server rejects anonymous operations. A Shell +opening without authentication is not a promise that database commands are authorized. +Normal context-menu Open Shell should keep its existing authenticated behavior. + +| Name option | Pros | Cons | +| --- | --- | --- | +| **Open shell without authentication** | Recommended; explicit, plain language, no abbreviation | Longer tree row | +| Open unauthenticated shell | Accurate and shorter | More technical vocabulary | +| Open shell (no authentication) | Consistent with the No Authentication method label | Parenthetical is less readable in a narrow tree | +| Open shell (w/o auth) | Short | Two abbreviations; least clear for non-experts | + +**Decision state:** operator's preferred recovery direction recorded; final label and +implementation are still open. No anonymous-startup behavior has been added. ### F2. Retained-worker guidance overstates when reopening or re-picking is required ⚠️ **Priority:** P1 · **Status:** 🟠 Open -**Observation:** Not yet observed live. Disconnect with unchanged settings, try the -retained Shell/Playground while disconnected, reconnect in the tree, then run again -without opening a new terminal or selecting a connection. +**Observation (operator, 2026-11-27):** the disconnected Shell requested a tree reconnect +and a new Shell, but after reconnecting the **same terminal** ran the query successfully. +The disconnected Playground warned: + +> This connection is unavailable. Reconnect from the tree, then re-pick it here. + +After tree Reconnect, running the retained Playground recovered without a connection +pick. The operator found “re-pick it here” difficult to interpret. The other two +observations reported with F2 are tracked separately as [F7](#f7-disconnect-menu-missing-after-credential-repair) +and [F8](#f8-disconnected-is-written-beside-the-active-shell-prompt). **Finding:** @@ -319,16 +375,28 @@ without opening a new terminal or selecting a connection. Source behavior supports that intent; the error wording is the mismatch. Identity or destination changes still require the stricter guidance. -💡 **Suggestion:** Separate unchanged-connection recovery wording from removed/changed -connection wording. Confirm worker-local variables/cursors are lost and interrupted -commands are not replayed; do not promise state preservation beyond text and scrollback. +> **Decision (Iteration 1):** for an unchanged disconnected connection, direct the person +> to reconnect from the tree and run the command/script again, not open a new Shell or +> re-pick the Playground. **Reason:** the operator verified in-place recovery; “re-pick +> it here” is not easy to follow. + +💡 **Proposed copy:** Shell: +**“Disconnected. Reconnect from the tree, then run your command again.”** +Playground: +**“This connection is disconnected. Reconnect from the tree, then run the script again.”** +These are proposed exact strings for the approved direction, not current source copy. +Preserve separate guidance when the connection was removed or its host/identity changed; +do not promise recovery or preservation of worker-local variables in those cases. ### F3. Sibling tree expansion failures use modal versus notification feedback ⚠️ **Priority:** P1 · **Status:** 🟠 Open -**Observation:** Not yet observed live. Compare expanding the cluster and an already -visible database/Indexes node after the same infrastructure failure. +**Observation / direction (operator, 2026-11-27):** +“yes, modal all the way please, that's our ux guideline.” +The later clarification is: **“I meant modals for tree actions.”** +This is a policy decision; the operator did not supply a new reproduction transcript +for each descendant failure. **Finding:** @@ -343,9 +411,37 @@ visible database/Indexes node after the same infrastructure failure. not a newly introduced renderer; code wins for current behavior, while the discrepancy should be resolved explicitly rather than silently treating the guidance as implemented. -💡 **Suggestion:** Confirm the practical recovery path at both hierarchy levels and choose -a consistent tree policy. Keep worker and database-command notification policy separate; -see [O1](#o1-which-failures-need-a-modal-versus-in-context-feedback-f3f4). +> **Decision (Iteration 1):** failures of tree-originated actions, including expansion +> and tree commands, use modal feedback. **Reason:** this is the operator's stated UX +> guideline. Keep tree children as recovery actions, not error paragraphs. + +This does **not** make every worker or webview failure a host modal. It supersedes the +earlier suggestion here to leave tree database-command notification policy separate. +Use a translated heading and separate error detail consistently; avoid two modals for +one action. [O1](#o1-tree-modal-policy-and-in-view-feedback-are-separate-f3f4) +records the same scoped decision. + +### F7. Disconnect menu missing after credential repair + +**Priority:** P1 · **Status:** 🟡 Open (soft) + +**Observation (operator, 2026-11-27):** failed connect → Update Credentials → allow +reconnect with fresh credentials → the cluster context menu did not offer Disconnect. +The operator explicitly questioned whether an older version was being tested. +After restart and a fresh healthy connection, Disconnect was available. + +**Finding:** + +- 🔍 [The manifest gates Disconnect](../../../../../package.json#L1355) on a cluster + tree item with the `connected` context tag and no multi-selection. +- [The tag is emitted when a cached client exists and no latch applies](../../../../../src/tree/documentdb/ClusterItemBase.ts#L689); + [the stored cluster uses that helper](../../../../../src/tree/connections-view/DocumentDBClusterItem.ts#L484). +- [Credential repair resets error state when reconnect was chosen, then refreshes](../../../../../src/commands/updateCredentials/updateCredentials.ts#L183). + These are the current-code eligibility checks, **not a confirmed root cause**. + +💡 **Suggestion:** reproduce that exact sequence in the current build before changing +the menu. Capture client existence/latch and the refreshed tree context tag. Do not +claim the old-version possibility has been ruled out or mark the feature fixed by restart. ## P2 — Polish, expectation, or feature gap @@ -368,6 +464,11 @@ unreachable; compare a typed unavailable result and an unclassified thrown error failure should update the dialog or remain a notification. Preserve the translated reason and the ability to copy/close; never replay the failed operation. +**Operator request (Iteration 1):** provide options with pros/cons. Recommendation: +keep Retry failure **inside the existing in-view dialog**, without stacking a host modal. +[O2](#o2-where-should-a-failed-in-view-retry-be-explained-f4) gives the alternatives. +This remains a suggestion; F3's tree-modal decision does not decide F4 automatically. + ### F5. Stale recovery actions can be safely rejected without explaining why ⚠️ **Priority:** P2 · **Status:** 🟠 Open @@ -391,13 +492,20 @@ available, change the connection's state elsewhere, then invoke the old action. should stay quiet, from an explicit click on a still-visible stale action. Consider a refresh or brief bounded next-step notice only for the latter. +**Operator request (Iteration 1):** provide options with pros/cons. Recommendation: +re-check and refresh on explicit stale clicks; show an actionable **modal for a failed +tree-originated action**, but keep cancellation/background disposal quiet and do not +report an already-completed action as an error. See +[O3](#o3-how-should-an-explicit-stale-action-end-f5). Decision remains open. + ### F6. Playground sign-in has no equivalent of Shell's “run again” completion cue ⚠️ -**Priority:** P2 · **Status:** 🟠 Open +**Priority:** P2 · **Status:** 🚫 Closed -**Observation:** Not yet observed live. Let a Playground run fail because sign-in is -required, choose Sign in again, complete authentication, then inspect the retained result -and connection affordances without rerunning. +**Observation / comment (operator, 2026-11-27):** F6 is acceptable. The operator also did +not notice Shell's “Sign-in restored” line during testing, possibly because a `find()` +produced enough output to consume the visible scrollback. That explanation is a +possibility, not a verified cause. **Finding:** @@ -408,13 +516,145 @@ and connection affordances without rerunning. The authentication provider may show its own UI, but the Playground recovery handler supplies no equivalent completion/rerun cue. -💡 **Suggestion:** Confirm whether the surrounding VS Code UI is sufficient. If not, add -a small success/next-step signal rather than automatically executing the query. +> **Decision (Iteration 1):** leave the Playground completion behavior as-is. +> **Reason:** the operator accepts the lack of a dedicated completion/rerun cue. + +**Closed reason:** accepted as-is; no implementation change and no commit claimed. +Shell's line is emitted only after the explicit Shell Sign in again route succeeds +([source](../../../../../src/documentdb/shell/DocumentDBShellPty.ts#L962)); ordinary +tree Reconnect/worker restart is not evidence that the line must have appeared. +See [Q1](#q1-can-the-shell-scrollback-buffer-be-configured) for the buffer question. + +### F8. Disconnected is written beside the active Shell prompt + +**Priority:** P2 · **Status:** 🟠 Open + +**Observation (operator, 2026-11-27):** + +```text +a11y-db> +a11y-db> Disconnected +a11y-db> +``` + +The system word looks like something the person entered at the prompt, rather than a +separate connection-state message. + +**Finding:** [disconnect writes Disconnected without first moving off the current line](../../../../../src/documentdb/shell/DocumentDBShellPty.ts#L274); +[writeLine appends only a trailing CRLF](../../../../../src/documentdb/shell/DocumentDBShellPty.ts#L1120), +and [showPrompt leaves the cursor after the prompt](../../../../../src/documentdb/shell/DocumentDBShellPty.ts#L1081). +This directly supports the reported rendering. + +> **Decision (Iteration 1):** render Disconnected on a separate system-output line +> before a fresh prompt. **Reason:** it must not look like user-entered input. + +💡 **Suggestion:** verify idle, partially typed and evaluating states when implementing; +preserve input intentionally rather than blindly adding a newline in every output path. + +### F9. Shorten the retained-tab choice + +**Priority:** P2 · **Status:** 🟠 Open + +**Observation / comment:** C0's host-modal option “Keep open (disabled)” is too complex; +the operator knows the state is disabled but finds the label unclear. + +**Finding:** [the teardown modal currently uses Keep open (disabled)](../../../../../src/documentdb/connectionTeardown.ts#L78). +The choice controls retained webviews; it does not close the Shell terminal or Playground +file. The later overlay can explain unavailable database operations. + +> **Decision (Iteration 1):** change the visible choice to **“Keep open”**, dropping +> “(disabled)”. **Reason:** the suffix is unclear and unnecessarily complex. + +Retain disabled-operation behavior; this is a label change, not permission to execute. + +### F10. Explain what the decoded-password save will store + +**Priority:** P2 · **Status:** 🟠 Open + +**Observation / comment:** after decoding succeeds, enhance +“Connected to "Orders" using the decoded password. Would you like to update your saved credentials?” +so it states that the saved credentials will receive the correctly formatted password. + +**Finding:** [the current successful-retry prompt](../../../../../src/tree/connections-view/DocumentDBClusterItem.ts#L350) +offers “Update saved password” and saves the decoded password only on that explicit action. +It does not reveal the password in the prompt. + +**Requested change (Iteration 1):** explicitly describe saving the correctly formatted +password into the connection's saved credentials. The operator specified the information +to add; no separate rationale or final exact sentence was supplied. + +💡 **Proposed copy:** +**“Connected to "Orders" using the decoded password. Would you like to update your saved credentials with the correctly formatted password?”** +Keep the existing “Update saved password” action and do not include the secret value. + +### F11. X should describe access to retained contents + +**Priority:** P2 · **Status:** 🟠 Open + +**Observation / comment:** C6's X accessible name should describe accessing contents, +not only copying them. + +**Finding:** [the overlay's current accessible name](../../../../../src/webviews/components/DisconnectedOverlay.tsx#L105) +is “Dismiss dialog to copy view contents”; dismissal exposes the retained content while +database-operation guards remain in place. + +> **Decision (Iteration 1):** use **“Dismiss dialog to access view contents”**. +> **Reason:** dismissing enables access/inspection, not just the narrower act of copying. + +No change to recovery or close semantics is implied. + +### F12. Make connection and worker debugging output use one readable format + +**Priority:** P2 · **Status:** 🟠 Open + +**Observation / comment:** Show Connection Stats and Show Worker Stats use different +formats. The operator requests unification and authorizes selecting the better format, +emphasizing that humans also read this debugging output. + +**Finding:** [connection stats compress multiple fields onto one Client line](../../../../../src/commands/showConnectionStats/showConnectionStats.ts#L40); +[worker stats use ruled headings and one field per line](../../../../../src/commands/showWorkerStats/showWorkerStats.ts#L18). +These commands report different things: host cached clients versus worker/session state. + +> **Decision (Iteration 1):** unify presentation for human-readable debugging. +> **Reason:** the operator explicitly prioritizes readability for human investigation. + +**Selected format recommendation:** use the worker-style **multiline labeled record** +structure for both commands, with consistent indentation, headings and units; omit +decorative ruler lines. Do not flatten it into the host command's dense key/value line. +Preserve the separate facts and field availability. A cached client is not proof of a +live socket, and worker count is not necessarily connection count. +See [O4](#o4-shared-debug-stat-format-f12) for a concrete shape and trade-offs. ## P3 — Nice-to-have / cosmetic / acknowledged -No cosmetic items seeded. Inspect layout, wording, themes and focus during the live pass; -do not turn this preparation into a pixel-level review. +### Q1. Can the Shell scrollback buffer be configured? + +🔍 **Answered** + +**Observation:** the operator printed 50 documents and could not scroll back through +all output. Document count is not the same as terminal line count: multiline/wrapped +documents can consume many more lines. + +**Answer:** yes. The DocumentDB Shell uses a VS Code terminal; the live scrollback is +controlled by **`terminal.integrated.scrollback`**, whose documented default is **1000 +lines**. For example, in **user** settings: + +```json +{ + "terminal.integrated.scrollback": 10000 +} +``` + +This is a suggestion, not a setting changed by this review. Increase it before reproducing +the long-output case; output already discarded from scrollback is not recovered. +`terminal.integrated.persistentSessionScrollback` is a separate restored-session setting, +not the primary live-buffer control. The Shell's `clear` handling explicitly clears +scrollback, so increasing the limit does not preserve output across that action. + +Sources: [VS Code terminal buffer documentation](https://code.visualstudio.com/docs/terminal/basics#_navigating-the-buffer), +[persistent sessions](https://code.visualstudio.com/docs/terminal/advanced#_persistent-sessions), +[Shell clear](../../../../../src/documentdb/shell/DocumentDBShellPty.ts#L1002). +No new extension-specific scrollback setting is proposed. ## Implemented @@ -432,17 +672,34 @@ not relabeled as a fix from this pass. | F1–F3 | Recovery availability, worker guidance, sibling tree feedback | None; code-verified seeds only | 🟠 Open → hands-on Iteration 1 | | F4–F6 | Retry feedback, stale clicks, Playground sign-in completion | None; code-verified seeds only | 🟠 Open → hands-on Iteration 1 | -### Iteration 1 — hands-on pass pending +### Iteration 1 — operator feedback recorded, implementation pending -Work one journey at a time using Appendix B. Record the operator's observation before -adjusting a Flag. Capture each approved choice and its reason before coding; commit fixes -individually and link verification. Everything unresolved carries to Iteration 2. +| # | Operator outcome / reason | Current outcome | +| --- | --- | --- | +| F1 | Prefers anonymous Shell on error rows; invalid saved auth otherwise fails again | 🟠 Open; final label/implementation not decided | +| F2 | In-place worker recovery works; re-pick wording is unclear | 🟠 Open; rerun guidance approved | +| F3 / O1 | Modal errors for tree actions are the UX guideline | 🟠 Open; scoped policy approved | +| F4 / O2 | Wants guidance with pros/cons | 🟠 Open; recommendation recorded, no choice yet | +| F5 / O3 | Wants guidance with pros/cons | 🟠 Open; recommendation recorded, no choice yet | +| F6 | Acceptable as-is | 🚫 Closed; no code change | +| F7 | Possibly tested an older version | 🟡 Open (soft); current-build reproduction required | +| F8 | Disconnected must not look like entered input | 🟠 Open; separate output line approved | +| F9 | Disabled suffix is unclear/complex | 🟠 Open; Keep open approved | +| F10 | Wants the saved, correctly formatted password made explicit | 🟠 Open; proposed copy recorded | +| F11 | Access is broader than copying | 🟠 Open; accessible name approved | +| F12 | Debugging is also for humans; prioritize readability | 🟠 Open; shared multiline records recommended | +| Dashboard diagnostics link | Future work rather than widening this PR | 🔗 Tracked in [#1141](https://github.com/microsoft/vscode-documentdb/issues/1141) | +| Q1 | Asks how to increase Shell buffer capacity | 🔍 Answered; VS Code scrollback setting | + +No product changes were requested for execution in this recording pass. Open items stay +in the ledger and carry to the next fix iteration; code, tests, localization and shipped +documentation have not been changed to pretend these choices are already implemented. --- ## Open ideas — options, pros & cons -### O1. Which failures need a modal versus in-context feedback? (F3/F4) +### O1. Tree modal policy and in-view feedback are separate (F3/F4) Accepted design already places typed unavailable webview reasons in a modal and keeps worker failures in bounded output/notifications. The open question is the *sibling @@ -454,8 +711,110 @@ failure branches*, not whether every error in the extension should block the use | **B. Align tree-expansion errors; keep Retry failures inside their existing dialog** | One feedback location per journey; clearer relation between cause and recovery | Changes a shared tree boundary and needs explicit scope, accessibility and regression checks | | **C. Make every lifecycle failure a host modal** | Prominent feedback everywhere | Can stack host/webview modals; disrupts workers and conflicts with deliberate surface-specific design | -> 💡 **Suggested:** B if the live pass confirms missed or confusing feedback. Preserve -> worker output and silent background recovery. This is not an approved design change. +> **Decision (Iteration 1):** B's tree-alignment direction is accepted, with the +> operator's clarification **“I meant modals for tree actions.”** +> **Reason:** modal feedback for tree-originated failures is the UX guideline (F3). + +Tree-originated expansion and command failures should therefore be aligned to modal +feedback. This is not option C: do not impose host modals on all worker/webview errors. +The original B bundled tree alignment with in-dialog Retry feedback; F4 remains open +because the operator separately requests its pros/cons. O2 records that recommendation +without treating the tree decision as approval of a particular in-dialog implementation. + +### O2. Where should a failed in-view Retry be explained? (F4) + +| Option | Pros | Cons | +| --- | --- | --- | +| **A. Keep the current host notification** | Minimal implementation; existing error renderer and translated cause | May be missed while an old reason dialog remains; two feedback locations | +| **B. Show the Retry failure inside the existing unavailable dialog** | Recommended; keeps cause and actions together; no second modal; can announce the error once | Needs a clear distinction between the persistent unavailable reason and the failed attempt; detailed causes should not overwhelm the short explanation | +| **C. Open an additional host modal** | Prominent, hard to miss | Stacks host and webview modals; extra dismissal; does not follow from the tree-only modal policy | + +💡 **Suggested:** B. Keep the existing reason and add a concise failure explanation, +for example **“Could not reconnect. Check the network or server, then try Retry again.”** +only when that cause is supported; otherwise use a bounded **“Unable to recover the connection.”** +Keep translated technical detail available without replacing the user's next step with +a raw stack. Retry/Close/X become usable again after failure; no operation replay. +Use an alert/live announcement so a keyboard/screen-reader user notices the failed attempt. +Exact wording and detail disclosure remain proposals, not approved behavior. + +**Decision state:** awaiting the operator's choice. Modal **inside** the webview is +already the current unavailable presentation; the recommendation is to keep subsequent +failure feedback there, not open a new host modal. + +### O3. How should an explicit stale action end? (F5) + +| Option | Pros | Cons | +| --- | --- | --- | +| **A. Preserve every silent early return** | Least intrusive; no accidental startup or identity changes | Person can click an apparent action and see nothing happen | +| **B. Show a modal for every stale event** | Uniformly visible | Noisy for background replies, cancellation and already-completed actions; can show obsolete errors | +| **C. Classify the outcome of an explicit click, refresh, then explain only a failed user action** | Recommended; keeps safety guards; consistent with tree-modal guideline; silence remains appropriate for non-actions | Requires precise classification of missing/changed/already-completed state and foreground ownership | + +💡 **Suggested:** C, with these separate endings: + +- **Explicit tree click, removed/changed target:** refresh relevant tree state, then a + bounded modal with a next step; proposed examples: + **“This connection was removed. Choose another connection.”** or + **“This connection changed. Refresh the tree and try again.”** + Use the actual reason, not an inferred generic network failure. +- **Already healthy/completed:** refresh/reveal the current state; do not call a successful + or no-longer-needed recovery an error. Any completion acknowledgement is optional. +- **Worker Sign in again notification became stale:** explain only if the terminal/file + still exists and that person actually chose the action; use that worker's existing + bounded surface, not the tree's host-modal rule by accident. +- **User cancelled, view disposed, obsolete background reply:** remain silent. + +Do not auto-connect another identity or restart a disposed worker to make a stale click +look successful. **Decision state:** awaiting operator choice. + +### O4. Shared debug-stat format (F12) + +| Format | Pros | Cons | +| --- | --- | --- | +| **Multiline labeled blocks** | Recommended; scan and compare fields; explicit units; works in Output without column alignment | More vertical space | +| Dense key/value lines | Compact; easy to grep a whole record | Existing host format is harder for humans to scan | +| Aligned tables | Compact comparison for a small set of common columns | Long IDs wrap; host/worker fields differ; missing cells can look like real zero values | + +**Recommended shape**, illustrative rather than current output: + +```text +[Connection Stats] + Entries: 1 + Connection 1: + Source: Extension host + Client state: cached + Generation: 4 + Age (ms): 32000 + Auth method: NativeAuth + Startup ID: {startup ID} + +[Worker Stats] + Shell sessions: 1 + Shell 1: + Terminal: {terminal title} + Worker state: ready + Initialized: true + Evaluating: false + Database: test + Auth method: NativeAuth +``` + +Use the same record/field conventions for Playground workers, include the existing +counts, held/pending states, Entra expiry, session IDs and init-duration facts where +available, and choose one explicit missing-value representation. Preserve truthful +labels: client state `cached` is not equivalent to a successful ping; a pending startup +is not a live client. Keep existing redaction boundaries and do not add credential values. +This is the selected recommendation under the operator's request to choose a readable +format; no debug command has yet been changed. + +### O5. Dashboard link to Connection Diagnostics + +**Status:** 🔗 Tracked in [#1141](https://github.com/microsoft/vscode-documentdb/issues/1141). + +The operator requested future work to make Connection Diagnostics reachable from the +Dashboard for its own connection. It is distinct from View Raw Diagnostics, which +exports different information. The issue asks for discoverable navigation and reuse +of the existing diagnostics flow, without silently selecting another connection. +It is not an active implementation item in #1136. --- @@ -549,7 +908,9 @@ pre-merge review so this snapshot is not mistaken for current behavior. ## Appendix C — message walkthrough: what the user sees, and when -This is a **script for the hands-on review, not a record of runtime results**. +This is the **source-based script for the hands-on review**; runtime observations and +decisions from Iteration 1 are recorded in the F-items above, not retroactively substituted +for the current source wording here. The source snapshot is unchanged from the preparation above. Quoted wording is the English source wording; `Orders`, `inventory` and `reviews` are fictional display names used to instantiate templates. `{error}`, `{host}` and similar placeholders @@ -584,6 +945,10 @@ Links identify the renderer or caller that selects each message. tagged `error`. They are **not** passive error-summary rows. Read the failure modal first, then review whether the surviving action labels are enough to guide recovery. +**Iteration 1 wording decision:** the host-modal choice quoted above is still the current +**“Keep open (disabled)”**; the approved replacement is **“Keep open”** ([F9](#f9-shorten-the-retained-tab-choice)). +The retained-view behavior stays unavailable for database operations. + ### C1. “I expand Orders and connect for the first time” Start with a saved scratch connection. Expand it, then repeat with a connection slow @@ -704,6 +1069,11 @@ The action is **“Update saved password”**. Sources: [decoding offer](../../../../../src/documentdb/auth/urlEncodedPassword.ts#L101), [successful retry](../../../../../src/tree/connections-view/DocumentDBClusterItem.ts#L350). +**Iteration 1 comment:** make this explicit about storing the correctly formatted +password. [F10](#f10-explain-what-the-decoded-password-save-will-store) proposes: +**“Connected to "Orders" using the decoded password. Would you like to update your saved credentials with the correctly formatted password?”** +The source sentence above remains unchanged until implementation. + **Review checkpoint:** read the modal, dismiss it, and explain the next step using only the remaining rows. Compare a cluster failure with a database/Indexes expansion failure: the latter's explained failure is a **notification**, formatted as @@ -910,6 +1280,8 @@ every surface or that every low-level error is mapped. is not reconnecting. The contents become accessible for copying; attempting another database operation reveals the reason again. Confirm this distinction without assuming a visible disabled toolbar persists after dismissal. + **Iteration 1 approved replacement:** **“Dismiss dialog to access view contents”**, + because access/inspection is broader than copying ([F11](#f11-x-should-describe-access-to-retained-contents)). - **Retry:** while pending, Retry, Close view and the X are disabled/focusable. Their labels do not change to “Retrying…” and this component adds no recovery spinner. On success the overlay disappears and a live region announces **“Reconnected”**; @@ -1285,5 +1657,7 @@ For each scenario, dictate a short sequence using this review card: | What was preserved or lost? | Draft, result, query text, scrollback, worker variables; whether anything unexpectedly replayed | | Is this observed or only inferred? | Runtime evidence versus a source-only branch; link an existing F-item where applicable | -The six seeded Flags remain suggestions pending this walkthrough. No new UX decisions, -runtime findings or implementation fixes are implied by adding this message inventory. +This appendix preserves the message inventory from the source snapshot. Iteration 1 +decisions and observations are explicit in the ledger above; unresolved suggestions +remain open, F6 is closed as accepted, and none of the requested fixes has shipped merely +because it was recorded here. From dd11ca7d3710ab3c007b726705d1eb09974522c9 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 11:04:58 +0000 Subject: [PATCH 02/51] docs: record implementaiton plan for ux issues --- .../features/connection-lifecycle/README.md | 18 +- .../iterations/02-ux-implementation-plan.md | 336 ++++++++++++++++++ 2 files changed, 346 insertions(+), 8 deletions(-) create mode 100644 docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md diff --git a/docs/ai-and-plans/features/connection-lifecycle/README.md b/docs/ai-and-plans/features/connection-lifecycle/README.md index b70afc179..1c9f670c4 100644 --- a/docs/ai-and-plans/features/connection-lifecycle/README.md +++ b/docs/ai-and-plans/features/connection-lifecycle/README.md @@ -105,14 +105,15 @@ entries are unpublished drafts and do not represent a shipped release. ## Documents -| Document | Kind | -| ------------------------------------------------------------------------------ | --------- | -| [research-findings.md](./research-findings.md) | research | -| [decisions.md](./decisions.md) | decisions | -| [iterations/01-implementation-plan.md](./iterations/01-implementation-plan.md) | plan | -| [iterations/01-dev-plan.md](./iterations/01-dev-plan.md) | plan | -| [iterations/01-pr1136-final-review.md](./iterations/01-pr1136-final-review.md) | review | -| [iterations/01-pr1136-ux-review.md](./iterations/01-pr1136-ux-review.md) | ux-review | +| Document | Kind | +| ----------------------------------------------------------------------------------- | --------- | +| [research-findings.md](./research-findings.md) | research | +| [decisions.md](./decisions.md) | decisions | +| [iterations/01-implementation-plan.md](./iterations/01-implementation-plan.md) | plan | +| [iterations/01-dev-plan.md](./iterations/01-dev-plan.md) | plan | +| [iterations/02-ux-implementation-plan.md](./iterations/02-ux-implementation-plan.md) | plan | +| [iterations/01-pr1136-final-review.md](./iterations/01-pr1136-final-review.md) | review | +| [iterations/01-pr1136-ux-review.md](./iterations/01-pr1136-ux-review.md) | ux-review | ## Decisions index @@ -151,3 +152,4 @@ See [decisions.md](./decisions.md): | 2026-11-24 | WI-6 through WI-8 implement bound views, teardown and Dashboard behavior | | 2026-11-25 | WI-2 review fixes and WI-9 lifecycle measurements | | 2026-11-26 | WI-10 documentation draft, skill updates and unpublished 1.2.0 notes | +| 2026-11-27 | UX review findings organized into a draft implementation plan | diff --git a/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md b/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md new file mode 100644 index 000000000..67ba8dd5d --- /dev/null +++ b/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md @@ -0,0 +1,336 @@ +--- +feature: connection-lifecycle +kind: plan +status: draft +created: 2026-11-27 +code: + - src/tree/documentdb/ClusterItemBase.ts + - src/tree/documentdb/DatabaseItem.ts + - src/tree/documentdb/IndexesItem.ts + - src/tree/BaseExtendedTreeDataProvider.ts + - src/commands/openInteractiveShell/openInteractiveShell.ts + - src/documentdb/shell/ShellSessionManager.ts + - src/documentdb/shell/DocumentDBShellPty.ts + - src/commands/playground/executePlaygroundCode.ts + - src/webviews/documentdb/useBoundViewRecovery.ts + - src/webviews/components/DisconnectedOverlay.tsx + - src/documentdb/connectionTeardown.ts + - src/tree/connections-view/DocumentDBClusterItem.ts + - src/commands/showConnectionStats/showConnectionStats.ts + - src/commands/showWorkerStats/showWorkerStats.ts +--- + +# Iteration 2: implement the connection-lifecycle UX review findings + +> **Purpose:** translate the open findings in the +> [PR #1136 UX review](./01-pr1136-ux-review.md) into bounded implementation work for +> review, then execution by the `lead` skill. This plan is not approval to implement +> unresolved recommendations. + +**Source of truth:** the review records the observed behavior, operator decisions, +recommendations and remaining uncertainty. Existing feature intent and accepted +constraints remain in the [feature overview](../README.md) and +[decisions](../decisions.md). If current code differs from the review's cited snapshot, +verify the current behavior before changing it; do not treat snapshot references as proof +that a reported issue still reproduces. + +## Goal and scope + +Implement the review's open, actionable user-experience findings while preserving the +connection-lifecycle safety rules: never change the identity bound to a retained view, +never replay a failed database operation, retain action-only tree recovery rows, and keep +worker/webview feedback on its intended surface. + +In scope: F1–F5 and F7–F12 from the review. F6 is closed as accepted-as-is; Q1 is answered +without an extension change; the Dashboard diagnostics link is tracked in #1141. Do not +expand this work into broader network resilience, account sign-out handling, telemetry +redesign, or unrelated error-message cleanup. + +## Authority and decision gates + +1. Approved directions in the UX review are constraints: F2's rerun guidance, F3's + tree-action modal policy, F8's separate Shell system-output line, F9's “Keep open” + label, F10's explicit saved-password explanation, F11's accessible name, and F12's + human-readable shared debug format. +2. The review's recommendations for F1, F4 and F5 are **not all final decisions**. + Before implementing each item, confirm its unresolved behavior or exact wording with + the operator. In particular: + - F1 leans toward an unauthenticated Shell from error rows, but final label and + behavior are still open. + - F4's recommended in-dialog Retry failure treatment is not approved. + - F5's recommended stale-explicit-click handling is not approved. +3. F7 is a reproduction gate, not a confirmed regression. Reproduce the exact credential + repair sequence on the current build before changing menu eligibility. If it does not + reproduce, record the evidence and close it without a speculative code change. +4. Do not append a decision to `decisions.md` for a recommendation merely because this + plan records it. Once the operator confirms a significant new behavior, record that + decision with their rationale before or alongside implementation. +5. Recheck affected source, related tests, and current localization patterns at execution + time. Keep changes in the existing command/tree/webview surfaces; avoid new lifecycle + abstractions unless current code demonstrates they are necessary. + +## Workstream order and dependencies + +```text +WI-0: Revalidate findings and settle gates + ├── WI-1: Tree feedback and explicit stale tree actions (F3; F5 decision-gated) + ├── WI-2: Worker recovery wording and Shell output line (F2, F8) + ├── WI-3: Retained-view Retry failure feedback (F4) + ├── WI-4: Teardown, decoded-password, and overlay wording (F9–F11) + ├── WI-5: Human-readable connection and worker stats (F12) + ├── WI-6: Unauthenticated Shell from connection failure rows (F1) + └── WI-7: Investigate F7 only if it reproduces +``` + +WI-1 through WI-6 are independent after WI-0 except: + +- WI-1's stale-action behavior depends on the operator choosing an F5 option. +- WI-3 depends on the operator choosing an F4 option. +- WI-6 depends on the operator confirming F1's behavior and label. +- F7 is included in WI-0; only a reproducible defect creates a small implementation + follow-up, which must be reviewed as a separate scoped change. + +Workstreams may be grouped into reviewable PRs by surface, but keep distinct behavior +changes and their tests independently reviewable. Do not combine unrelated changes just +to reduce the number of PRs. + +## WI-0: Revalidate findings and settle decision gates + +**Review items:** F1, F4, F5, F7 +**Depends on:** none +**Deliverable:** verified current-code baseline and explicit operator answers for the +behavior gates. + +1. Check the current branch/build against the review's evidence; inspect the current + implementations and tests named in the relevant F sections. +2. Reproduce F7 in the current build: failed connection → Update Credentials → choose + reconnect with fresh credentials → inspect the cluster context menu after refresh. + Capture whether a client exists, whether a latch applies, and the refreshed tree + context tag. Do not infer the cause from a restart. +3. Present the operator the options and trade-offs in O2 and O3 and ask for a decision + before coding F4 or F5. +4. Confirm F1's error-row Shell behavior and user-facing label. Keep normal context-menu + Shell startup authenticated unless explicitly changed by a decision. +5. Record what was confirmed, rejected, or not reproducible in the progress notes for + this plan. No code change is required for a non-reproducible F7. + +**Done when:** current behavior is verified; F4/F5/F1 are either explicitly decided or +marked blocked; F7 has reproduction evidence and a disposition. Do not silently resolve +any of these gates in implementation. + +## WI-1: Align tree-action failures and stale explicit recovery (F3, F5) + +**Depends on:** WI-0 for F5; F3's tree-modal direction is already approved. +**Likely areas:** `BaseExtendedTreeDataProvider`, database/index expansion providers, +tree recovery commands, and their existing tests. + +- Use modal feedback for failures caused by tree actions, including descendant tree + expansion and explicit tree commands, consistent with the cluster-expansion pattern + and error-translation guidance. +- Present a translated heading and separate error detail. Avoid duplicate modals for one + action, raw error paragraphs in tree children, or changing recovery children from + actions into status text. +- Apply the chosen F5 policy only to an explicit click on a still-visible stale action: + re-check state, refresh/reveal current tree state where appropriate, and explain an + actually failed action using the selected behavior. Keep cancellation, disposed work, + obsolete background replies, and already-completed recovery quiet. +- Never connect a different identity or restart work for a removed/disposed target just + to make the stale action appear successful. + +**Acceptance:** + +- A failed database or index expansion gives one modal with the actionable explanation; + no second notification/modal is emitted for the same failure. +- Tree items still expose recovery actions only. +- An explicit stale action follows the operator-approved outcome; cancellation and stale + background work remain silent. +- The result does not bypass existing identity, epoch, or latch guards. + +**Tests:** focused provider/command tests for modal feedback, one-error/one-feedback +behavior, current-state refresh, and quiet cancellation/background paths. Use existing +tree/error-translation helpers and assert the translated-message contract rather than +duplicating framework behavior. + +## WI-2: Correct worker recovery guidance and Shell status output (F2, F8) + +**Depends on:** none. +**Likely areas:** `DocumentDBShellPty`, `executePlaygroundCode`, their tests, and the +connection-lifecycle user manual. + +- For an unchanged disconnected connection, tell the user to reconnect from the tree and + run the command/script again in the existing Shell/Playground. Do not request a new + Shell or a new connection pick when the retained binding can recover in place. +- Preserve stricter guidance for a removed connection or changed host/identity. Do not + promise worker-local variables survive when a worker must restart. +- Emit Shell “Disconnected” as system output on a separate line from the interactive + prompt. Handle idle, partially typed, and evaluating states deliberately; preserve + user input when possible rather than applying a newline blindly. +- Localize changed/new user-facing copy and update the manual's disconnect/reconnect + guidance so it matches the implemented behavior. + +**Acceptance:** + +- Same-identity Disconnect → Reconnect guidance allows a retained Shell and Playground + to retry without reopening/re-picking. +- Changed or removed bindings retain their accurate non-recovery guidance. +- “Disconnected” cannot be mistaken for text typed at the Shell prompt, including when + emitted during partial input or evaluation. + +**Tests:** focused Shell output tests for idle/partial/evaluating states; Playground +message tests for unchanged versus changed/removed bindings; relevant manual link/content +check if available. + +## WI-3: Keep failed retained-view Retry feedback in context (F4) + +**Depends on:** WI-0 operator decision. +**Likely areas:** `useBoundViewRecovery`, `DisconnectedOverlay`, and the three retained +view recovery tests/scenarios. + +Implement only the operator-selected O2 option. If the recommended in-dialog option is +selected: + +- Keep the persistent unavailable reason distinct from the latest Retry failure. +- Show a concise, bounded failure explanation in the existing dialog; do not replace the + original reason with unsupported network/server assumptions or expose a raw stack. +- Make Retry, Close view, and X behavior available again after failure. Ensure an + assistive-technology user is notified of the new failure. +- Do not add a host modal, replay the failed database operation, or change the retained + content/copy behavior. + +**Acceptance:** a typed unavailable result and an unclassified thrown exception both +leave the user with one coherent in-view explanation and usable recovery/close controls; +failure does not execute the original operation again. + +**Tests:** focused hook/component tests for typed and thrown Retry failures, restored +controls, announcement, and no operation replay. Exercise Collection View, Document View, +and Dashboard if their shared integration wiring differs. + +## WI-4: Clarify teardown and retained-content wording (F9–F11) + +**Depends on:** none. +**Likely areas:** `connectionTeardown`, `DocumentDBClusterItem`, `DisconnectedOverlay`, +related tests, and localization. + +- Change the retained-view choice label from “Keep open (disabled)” to “Keep open”. + Preserve the disabled-operation behavior and existing help that explains the resulting + state. +- In the decoded-password confirmation, say that the correctly formatted password will + be saved into the connection's saved credentials. Preserve the existing explicit + opt-in action and never include the secret value. +- Change the overlay X accessible name to “Dismiss dialog to access view contents”. + Preserve the existing behavior: dismissing exposes retained contents for inspection + and copying but does not restore database operations. +- Update localized strings using the repository localization workflow when implementing. + +**Acceptance:** + +- The teardown option is “Keep open” and does not change teardown semantics. +- The password confirmation communicates what is saved without revealing the password + or changing the save action. +- The accessible name describes content access, and dismissing still leaves database + operations blocked. + +**Tests:** focused existing component/command tests for the rendered label, confirmation +copy and action, accessible name, and blocked-operation behavior. + +## WI-5: Unify human-readable debug-stat formatting (F12) + +**Depends on:** none. +**Likely areas:** `showConnectionStats`, `showWorkerStats`, their tests. + +- Use multiline labeled records for both commands, with consistent headings, indentation, + units, and a single explicit missing-value convention. Do not use decorative rulers. +- Preserve each command's existing facts and availability, including worker/session + counts, held/pending states, Entra expiry, session identifiers, and init-duration facts + where currently available. +- Keep state descriptions truthful: a cached client is not a successful ping; pending + startup is not a live connection. Preserve redaction boundaries and do not add + credential values or new identifying information. +- Keep host-client and worker/session data distinct; formatting consistency does not + imply they measure the same thing. + +**Acceptance:** both commands use the same readable record conventions without losing +existing fields, inventing values, or disclosing sensitive data. + +**Tests:** focused output tests for headings, field labels/units, missing values, and +redaction-safe output. Assert representative formatting without overfitting whitespace +that is not user-visible. + +## WI-6: Offer an unauthenticated Shell from connection failure rows (F1) + +**Depends on:** WI-0 operator confirmation of behavior and label. +**Likely areas:** `ClusterItemBase`, `openInteractiveShell`, Shell startup options, and +focused command/tree tests. + +- Add a distinct error-row entry path that starts a Shell without attempting the failed + saved authentication. Do not change ordinary authenticated Shell startup from the + cluster context menu. +- Keep saved credentials, `CredentialCache`, connection identity, and existing clients + unchanged. Do not silently fall back to saved authentication after anonymous database + operations are rejected. +- Make clear in the final, operator-approved label that this Shell starts without + authentication. Opening it does not promise that database commands are authorized. +- Preserve existing error-row recovery behavior and action ordering. + +**Acceptance:** + +- Error-row Shell startup does not read/use cached credentials or make an authenticated + startup attempt. +- Normal context-menu Shell startup remains authenticated and unchanged. +- Anonymous command failure is surfaced honestly; no credential state is modified. + +**Tests:** focused command tests contrasting error-row and normal entry, proving no +credential use or mutation on the former and preserving the latter's existing startup +path. Test the anonymous command failure feedback. + +## WI-7: Investigate F7 only if WI-0 reproduces it + +**Depends on:** WI-0 evidence. +**Likely areas if confirmed:** credential repair refresh path, connected context-tag +calculation, Disconnect menu condition. + +Do not pre-emptively alter command visibility. If reproduced, identify and fix the +smallest stale-state or refresh defect supported by evidence; preserve the rule that +Disconnect is available only for a currently connected eligible tree item. If not +reproduced, record the tested build and state checks in this plan and close the finding +without a code change. + +**Acceptance if fixed:** after successful credential repair and reconnect, the refreshed +connected cluster item exposes Disconnect; disconnected/error items do not. + +**Tests if fixed:** regression test the exact state transition and ensure the menu remains +hidden when no connected client is present or a latch applies. + +## Cross-workstream verification + +For code changes, follow the repository's Case 1 checks while implementation is in +progress: `npm run build` and `npx vitest run `. Run `npm run l10n` +only if localized strings change. Do not claim the full handoff suite passed unless it +was actually run; if this work is later prepared for review, follow the repository's +Case 2 requirements. + +Before calling this iteration complete: + +- Verify all new/changed strings use `vscode.l10n.t()` where required and generated + localization output is current. +- Verify tree recovery remains action-only and connection/view identity safety is + unchanged. +- Run the focused regression tests for every implemented workstream; run relevant webview + scenarios for changed retained-view behavior. +- Update the user manual only where the implemented recovery guidance changes. +- Record each operator decision, deviation, test result, and any non-reproduced finding + in the corresponding workstream progress record. Do not mark an unimplemented finding + fixed. + +## Progress + +| WI | Status | Outcome / decision / verification | +| --- | --- | --- | +| WI-0 | Pending operator review | | +| WI-1 | Pending | | +| WI-2 | Pending | | +| WI-3 | Pending operator decision | | +| WI-4 | Pending | | +| WI-5 | Pending | | +| WI-6 | Pending operator decision | | +| WI-7 | Conditional on reproduction | | From 1d8b12a97cdb4263f62a4150cac780d178650c4a Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 11:21:10 +0000 Subject: [PATCH 03/51] docs: record iteration 2 WI-0 operator approvals Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../connection-lifecycle/decisions.md | 61 ++++++++++++++++++- .../iterations/02-ux-implementation-plan.md | 29 +++++++++ 2 files changed, 89 insertions(+), 1 deletion(-) diff --git a/docs/ai-and-plans/features/connection-lifecycle/decisions.md b/docs/ai-and-plans/features/connection-lifecycle/decisions.md index 237b1b4b9..b24e7fc0d 100644 --- a/docs/ai-and-plans/features/connection-lifecycle/decisions.md +++ b/docs/ai-and-plans/features/connection-lifecycle/decisions.md @@ -26,13 +26,17 @@ created: 2026-11-19 | 0012 | Keep the lifecycle design minimal: no state machine, one epoch, no prompts in getClient, one-step teardown | Accepted | Operator: approved every proposed simplification | 2026-11-19 | — | | 0013 | Correct the minimal design where it lost edits, identity or recovery: latch before save, epoch checks | Accepted (modifies 0012) | Operator: "update the plan" after the omissions review | 2026-11-19 | — | | 0014 | Keep in-memory connection settings after a rejection for a verified Entra identity | Accepted | Operator selected A to make sign-in recovery smoother | 2026-11-23 | Yes; WI-5 previously said to delete the entry | -| 0015 | Use the existing latch to block startup after authentication rejection | Accepted | Operator selected A; keep the approach simple and pragmatic | 2026-11-23 | Yes; expands the existing latch rather than adding a second hold | +| 0015 | Use the existing latch to block startup after authentication rejection | Accepted (modified by 0022) | Operator selected A; keep the approach simple and pragmatic | 2026-11-23 | Yes; expands the existing latch rather than adding a second hold | | 0016 | Keep disconnected webviews open under a full-view overlay | Accepted (modified by 0017) | Operator chose a simple disabled state with explicit actions | 2026-11-24 | Yes; replaces the inline banner and single-action layout | | 0017 | Limit unavailable webview recovery to Retry and Close view | Accepted (modified by 0018) | Operator wants credential repair in the tree and no extra recovery workflow in a tab | 2026-11-24 | Yes; removes in-view credential repair | | 0018 | Saved connection edits permanently lock existing views | Accepted | Operator prefers simple reconnect for unchanged settings over recovery after edits | 2026-11-24 | Yes; removes same-identity recovery after a saved edit | | 0019 | Require a fresh Dashboard delete after Disconnect and keep Paste Collection in the tree | Accepted | Operator: a lifecycle change cancels the pending delete and never replays it | 2026-11-24 | — | | 0020 | Defer the cross-release comparison of late failures | Accepted | Operator: keep descriptive telemetry and defer the comparison | 2026-11-26 | Yes; removes the WI-9 before/after comparison for 1.2.0 | | 0021 | Key the in-memory connection fingerprint per extension host | Accepted | Operator: use HMAC and verify CodeQL without dismissing a remaining alert | 2026-11-26 | Yes; replaces unkeyed SHA-256 without changing identity rules | +| 0022 | Offer a separately unauthenticated Shell from failure rows only | Accepted | Operator approved the bounded F1 policy in the iteration 2 lead run | 2026-11-27 | Modifies 0015 only for this explicit anonymous entry | +| 0023 | Keep retained-view Retry failure feedback inside the unavailable dialog | Accepted | Operator selected F4 option B and bounded failure copy | 2026-11-27 | No host modal or operation replay | +| 0024 | Classify explicit stale recovery clicks and explain only failed actions | Accepted | Operator selected F5 option C | 2026-11-27 | Cancellation, disposed work and obsolete replies remain quiet | +| 0025 | Tree-origin failures use modals; webview-origin command feedback stays unchanged | Accepted | Operator confirmed F3 scope | 2026-11-27 | Shared command registrations must preserve origin | > Entries below are **semantically** immutable: append new entries rather than rewriting old ones, > and record reversals as a new entry plus a status change above. Heading text is frozen once @@ -520,3 +524,58 @@ options may contain credentials and are not treated as sanitized data. Do not retain historical connection strings in an identity map or persist the HMAC key. Recheck [CodeQL alert 39](https://github.com/microsoft/vscode-documentdb/security/code-scanning/39). If it still reports the HMAC call, leave it open for review rather than suppressing it. + +## 0022. Offer a separately unauthenticated Shell from failure rows only + +**Accepted** by the operator on 2026-11-27 during +[iteration 2](./iterations/02-ux-implementation-plan.md). + +Replace the failure-row Shell action with **Open shell without authentication**. +Normal context-menu Shell startup remains authenticated. The anonymous entry may bypass +rejected or missing authentication holds, but must honor removal, credential-update and +explicit Disconnect guards. It does not clear a latch, use or modify `CredentialCache`, +change saved credentials or connection identity, or fall back to saved authentication. + +Use an available model or stored endpoint stripped of credentials and authentication +options. Do not fetch an endpoint from ARM on this path; report an unavailable endpoint +honestly. Retain the existing host-gated TLS and emulator rules. Opening the terminal +does not promise that anonymous database operations are authorized. + +This is the operator's explicit approval of the proposed policy, including its authentication +boundary. No additional rationale was supplied. Implementation remains subject to verifying +the endpoint and lifecycle contracts against the current source. + +## 0023. Keep retained-view Retry failure feedback inside the unavailable dialog + +**Accepted** by the operator on 2026-11-27: F4 option B. + +Keep the original unavailable reason distinct from the latest failed attempt. Use the bounded +copy **Unable to recover the connection. Try Retry again, or close this view.** for an +unclassified failure, without exposing a raw exception or stack. Announce the failure in-view +and restore Retry, Close view and X after the attempt. Do not add a host modal, change the +bound identity, or replay the failed database operation. No additional rationale was supplied. + +## 0024. Classify explicit stale recovery clicks and explain only failed actions + +**Accepted** by the operator on 2026-11-27: F5 option C. + +Refresh current tree state and explain actually failed explicit clicks using their real reason: +**This connection was removed. Choose another connection.** or +**This connection changed. Refresh the tree and try again.** +Already-completed recovery refreshes or reveals current state without an error. +Cancellation, disposed work and obsolete background replies remain quiet. + +An explicit stale worker sign-in click uses its existing bounded worker surface when that +terminal or file still exists, not the tree's host-modal policy. Never connect another identity +or restart disposed work to make a stale action appear successful. No additional rationale +was supplied. + +## 0025. Tree-origin failures use modals; webview-origin command feedback stays unchanged + +**Accepted** by the operator on 2026-11-27. + +F3 covers explicit tree-origin actions, including tree expansion and commands, but does not +turn shared webview-origin command failures into host modals. One failed action gives one +modal with a translated heading and separate detail. Tree children remain recovery actions, +not error or information rows. Background replies and cancellations stay quiet. +No additional rationale was supplied. diff --git a/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md b/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md index 67ba8dd5d..ede3b3d67 100644 --- a/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md +++ b/docs/ai-and-plans/features/connection-lifecycle/iterations/02-ux-implementation-plan.md @@ -69,6 +69,35 @@ redesign, or unrelated error-message cleanup. time. Keep changes in the existing command/tree/webview surfaces; avoid new lifecycle abstractions unless current code demonstrates they are necessary. +### Execution authorization (2026-11-27) + +The operator invoked `/lead` to process this plan, then explicitly approved the item/model +mapping and the remaining F1/F4/F5/F3 choices. The endpoint is **local work and commits**: +no push, external edits or Case 2 handoff was requested. + +- Advisor: `claude-opus-5.5`. +- WI-1 expansion, WI-2, WI-3 and WI-5: `mai-code-2`, substituted for the advisor's + `gpt-6.1-terra` recommendations at the operator's request. +- WI-4: `gpt-6-luna`, the advisor's mechanical-copy recommendation. +- WI-1 stale recovery and WI-6: `gpt-6.1-sol`, retained for lifecycle/authentication logic. +- Tests, builds and other tool-running agents: `mai-code-2-flash`. +- F1: replace the error-row action with **Open shell without authentication**, using the + bounded authentication/endpoint policy in [decision 0022](../decisions.md#0022-offer-a-separately-unauthenticated-shell-from-failure-rows-only). +- F4: option B, with the bounded copy and in-view announcement in + [decision 0023](../decisions.md#0023-keep-retained-view-retry-failure-feedback-inside-the-unavailable-dialog). +- F5: option C, with the explicit-click and quiet-background policy in + [decision 0024](../decisions.md#0024-classify-explicit-stale-recovery-clicks-and-explain-only-failed-actions). +- F3: explicit tree-origin commands are included; webview-origin feedback is unchanged + ([decision 0025](../decisions.md#0025-tree-origin-failures-use-modals-webview-origin-command-feedback-stays-unchanged)). +- WI-2: the operator requested proposed copy for other unavailable reasons before editing; + that wording remains gated. +- WI-4: F10 changes explanatory copy only; the opt-in credential-save branch is unchanged. +- F7: current source inspection has not established a defect. A live reproduction is + still pending; no speculative menu change is authorized. + +Unrelated untracked `.copilot-connection-relays/` and `.copilot-connection-telemetry/` +directories were present at intake and are left untouched. + ## Workstream order and dependencies ```text From 5d00558cb1f209c005792073f53153d2e88ee374 Mon Sep 17 00:00:00 2001 From: Tomasz Naumowicz Date: Fri, 27 Nov 2026 11:36:34 +0000 Subject: [PATCH 04/51] fix: WI-4 clarify retained-content and saved-password wording Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- build/verification/browser/scenarios.ts | 2 +- src/documentdb/connectionTeardown.test.ts | 2 +- src/documentdb/connectionTeardown.ts | 2 +- .../DocumentDBClusterItem.test.ts | 20 +++++++++++++++++++ .../connections-view/DocumentDBClusterItem.ts | 2 +- .../components/DisconnectedOverlay.test.tsx | 6 +++++- .../components/DisconnectedOverlay.tsx | 2 +- 7 files changed, 30 insertions(+), 6 deletions(-) diff --git a/build/verification/browser/scenarios.ts b/build/verification/browser/scenarios.ts index 5be950f87..6efcce13d 100644 --- a/build/verification/browser/scenarios.ts +++ b/build/verification/browser/scenarios.ts @@ -2709,7 +2709,7 @@ const collectionViewScenarios = { selector: '.disconnectedOverlayBackground', attribute: 'inert', expected: null, - steps: [{ action: 'click', role: 'button', name: 'Dismiss dialog to copy view contents' }], + steps: [{ action: 'click', role: 'button', name: 'Dismiss dialog to access view contents' }], }, { kind: 'text', diff --git a/src/documentdb/connectionTeardown.test.ts b/src/documentdb/connectionTeardown.test.ts index 1c1ecab89..03bc04070 100644 --- a/src/documentdb/connectionTeardown.test.ts +++ b/src/documentdb/connectionTeardown.test.ts @@ -185,7 +185,7 @@ describe('connection teardown', () => { 'Disconnect?', expect.objectContaining({ modal: true }), 'Close all', - 'Keep open (disabled)', + 'Keep open', ); expect(draft.dispose).not.toHaveBeenCalled(); expect(draft.disable).not.toHaveBeenCalled(); diff --git a/src/documentdb/connectionTeardown.ts b/src/documentdb/connectionTeardown.ts index a0e280eef..b52147385 100644 --- a/src/documentdb/connectionTeardown.ts +++ b/src/documentdb/connectionTeardown.ts @@ -75,7 +75,7 @@ export async function confirmTeardown( setting !== 'keepOpenDisabled' && ids.some((id) => getConnectionSurfaces(id).length) ) { - const keepOpen = vscode.l10n.t('Keep open (disabled)'); + const keepOpen = vscode.l10n.t('Keep open'); const selected = await vscode.window.showWarningMessage( intent === 'connectionRemoved' ? vscode.l10n.t('Remove the connection?') : vscode.l10n.t('Disconnect?'), { modal: true, detail: vscode.l10n.t('What should happen to the open tabs for this connection?') }, diff --git a/src/tree/connections-view/DocumentDBClusterItem.test.ts b/src/tree/connections-view/DocumentDBClusterItem.test.ts index 74027545f..779e05e44 100644 --- a/src/tree/connections-view/DocumentDBClusterItem.test.ts +++ b/src/tree/connections-view/DocumentDBClusterItem.test.ts @@ -318,6 +318,26 @@ describe('connect request telemetry', () => { }); }); + it('does not save the decoded password when the saved-credentials offer is dismissed', async (): Promise => { + const connection = makeConnection('mongodb://localhost:27017/', AuthMethodId.NativeAuth); + connection.secrets.nativeAuthConfig = { connectionUser: 'test-user', connectionPassword: 'test%40password' }; + vi.mocked(ConnectionStorageService.get).mockResolvedValue(connection); + vi.mocked(ClustersClient.connectInteractive) + .mockRejectedValueOnce(new Error('Authentication failed.')) + .mockResolvedValueOnce({ connectionCorrelationId: 'retry' } as ClustersClient); + showErrorMessage.mockResolvedValueOnce('Try with decoded password'); + vi.mocked(vscode.window.showInformationMessage).mockResolvedValueOnce(undefined); + + await expect(makeItem().connect()).resolves.toMatchObject({ connectionCorrelationId: 'retry' }); + + expect(vscode.window.showInformationMessage).toHaveBeenCalledExactlyOnceWith( + 'Connected to "Saved connection" using the decoded password. Would you like to update your saved credentials with the correctly formatted password?', + { modal: false }, + 'Update saved password', + ); + expect(ConnectionStorageService.save).not.toHaveBeenCalled(); + }); + it('reports a successful connection with its connection ID', async (): Promise => { vi.mocked(ClustersClient.connectInteractive).mockResolvedValue({ connectionCorrelationId: 'attempt', diff --git a/src/tree/connections-view/DocumentDBClusterItem.ts b/src/tree/connections-view/DocumentDBClusterItem.ts index df2f60ac1..6ca2156a0 100644 --- a/src/tree/connections-view/DocumentDBClusterItem.ts +++ b/src/tree/connections-view/DocumentDBClusterItem.ts @@ -352,7 +352,7 @@ export class DocumentDBClusterItem extends ClusterItemBase - dialog()?.querySelector('button[aria-label^="Dismiss dialog"]')?.click(), + dialog() + ?.querySelector( + 'button[aria-label="Dismiss dialog to access view contents"]', + ) + ?.click(), ); expect(onDismiss).toHaveBeenCalledOnce(); expect(confirm).not.toHaveBeenCalled(); diff --git a/src/webviews/components/DisconnectedOverlay.tsx b/src/webviews/components/DisconnectedOverlay.tsx index 0bc56d3f1..0042463f7 100644 --- a/src/webviews/components/DisconnectedOverlay.tsx +++ b/src/webviews/components/DisconnectedOverlay.tsx @@ -98,7 +98,7 @@ export function DisconnectedOverlay({