@@ -376,10 +376,7 @@ export class ClineProvider
376376 */
377377 public readonly viewId : string
378378
379- /**
380- * Stable identifier for persisted per-view state keys; binds a durable entry to the
381- * webview that wrote it through the host-minted claim token.
382- */
379+ /** Stable id for persisted per-view state keys, bound by the host-minted claim. */
383380 private viewStateId : string
384381
385382 /**
@@ -597,10 +594,7 @@ export class ClineProvider
597594 return Object . assign ( Object . create ( null ) , viewStates )
598595 }
599596
600- /**
601- * Persist the non-secret selections through the serialized write queue, re-keying a
602- * pre-launch write to the stable id once the webview registers one.
603- */
597+ /** Persist the non-secret selections through the serialized write queue. */
604598 private async savePersistedViewState ( values : Partial < PersistedViewState > ) : Promise < void > {
605599 // Capture the id at change time: a write belongs to the view that was active
606600 // when the change was made, even if a newer id is registered while it is queued.
@@ -686,10 +680,7 @@ export class ClineProvider
686680 await write
687681 }
688682
689- /**
690- * Re-bind a claim-less viewStates entry with a freshly minted claim; its unowned
691- * selections are dropped so the new token cannot re-expose them.
692- */
683+ /** Re-bind a claim-less entry with a fresh claim; unowned selections are dropped. */
693684 private async rebindUnboundViewStateEntry ( viewStateId : string ) : Promise < string | undefined > {
694685 const claimToken = crypto . randomUUID ( )
695686 let rebound = false
@@ -781,10 +772,7 @@ export class ClineProvider
781772 await write
782773 }
783774
784- /**
785- * Register the stable view id and load its persisted selections. An entry that carries a
786- * claim is loaded only when the presented host-minted token matches it.
787- */
775+ /** Register the stable view id and load its persisted selections; a claim must match. */
788776 public async setViewStateId ( viewStateId : string | undefined , presentedClaim ?: string ) : Promise < void > {
789777 // The webview generates this id on purpose - it has to survive a webview reload,
790778 // which recreates the view on both sides - so the host cannot mint it instead.
@@ -892,8 +880,7 @@ export class ClineProvider
892880 this . postViewStateClaimToWebview ( this . viewStateId , adoptedClaim )
893881 }
894882
895- // Registration is only complete once the view's own persisted selections are in the
896- // buffer; nothing else loads them now that reset/import handling lives downstream.
883+ // Registration is what loads this view's own persisted selections.
897884 await this . loadViewState ( )
898885 } catch ( error ) {
899886 // A persistence failure must not leave the provider holding an id that was
0 commit comments