@@ -351,32 +351,31 @@ export class BrowserPanelController implements ReactiveController {
351351 }
352352 } catch ( error ) {
353353 if ( invocation . isCurrent ( ) ) {
354- this . reportError ( error ) ;
355354 if ( previousNavigationQueued && this . activeTargetId ) {
356355 const targetId = this . activeTargetId ;
357- const navigationErrorText = this . errorText ;
358356 // An earlier queued navigation may already have committed remotely.
359357 // Recover its actual document without replacing an unchanged view.
360- try {
361- const refreshed = await this . refreshTabsOnly ( client , ( ) => invocation . isCurrent ( ) ) ;
362- const active = this . tabs . find ( ( tab ) => tab . id === targetId ) ;
363- if ( refreshed === "accepted" && invocation . isCurrent ( ) && active ) {
364- await this . refreshView ( targetId , invocation . epoch ) ;
365- if (
366- invocation . isCurrent ( ) &&
367- this . view ?. targetId === targetId &&
368- this . errorText === navigationErrorText
369- ) {
370- this . operations . markNavigationReconciled ( client , targetId ) ;
371- }
358+ const refreshed = await this . refreshTabsOnly ( client , ( ) => invocation . isCurrent ( ) ) ;
359+ const active = this . tabs . find ( ( tab ) => tab . id === targetId ) ;
360+ if ( refreshed === "accepted" && invocation . isCurrent ( ) && active ) {
361+ this . setState ( "view" , null ) ;
362+ await this . refreshView ( targetId , invocation . epoch ) ;
363+ if ( invocation . isCurrent ( ) && this . view ?. targetId === targetId ) {
364+ this . operations . markNavigationReconciled ( client , targetId ) ;
372365 }
373- } catch {
374- // Recovery is best-effort; retain the original navigation failure.
375366 }
376- if ( invocation . isCurrent ( ) ) {
377- this . reportError ( error ) ;
367+ if (
368+ invocation . isCurrent ( ) &&
369+ this . operations . hasUnreconciledNavigation ( client , targetId )
370+ ) {
371+ this . setState ( "activeTargetId" , null ) ;
372+ this . setState ( "view" , null ) ;
373+ if ( ! this . urlDraftEditing ) {
374+ this . setState ( "urlDraft" , "" ) ;
375+ }
378376 }
379377 }
378+ this . reportError ( error ) ;
380379 }
381380 } finally {
382381 if ( invocation . isCurrent ( ) ) {
0 commit comments