diff --git a/app/client/components/GristDoc.ts b/app/client/components/GristDoc.ts index fc9e6415..5fe7744f 100644 --- a/app/client/components/GristDoc.ts +++ b/app/client/components/GristDoc.ts @@ -518,17 +518,8 @@ export class GristDoc extends DisposableWithEvents { // panel to the table. this.autoDispose(this.viewModel.activeSection.subscribe((section) => { if (section.isDisposed() || section._isDeleted.peek()) { return; } - if ('chart' === section.parentKey.peek()) { + if (['chart', 'custom'].includes(section.parentKey.peek())) { commands.allCommands.viewTabFocus.run(); - } else if ('custom' === section.parentKey.peek()) { - // Check if user has seen custom URL tooltip. - const seenTooltip = this.behavioralPromptsManager.hasSeenTip('customURL'); - // If yes, just focus on the table if it is opened - if (seenTooltip) { - commands.allCommands.viewTabFocus.run(); - } else { - commands.allCommands.viewTabOpen.run(); - } } })); } diff --git a/test/nbrowser/RightPanel.ts b/test/nbrowser/RightPanel.ts index 753bc1f7..93a65f93 100644 --- a/test/nbrowser/RightPanel.ts +++ b/test/nbrowser/RightPanel.ts @@ -12,11 +12,18 @@ describe('RightPanel', function() { const mainSession = await gu.session().teamSite.login(); await mainSession.tempNewDoc(cleanup); + // Reset prefs. + await driver.executeScript('resetSeenPopups();'); + await gu.waitForServer(); + + // Refresh for a clean start. + await gu.reloadDoc(); + // Close panel and make sure it stays closed. await gu.toggleSidePanel('right', 'close'); // Add a chart section. - await gu.addNewSection('Chart', 'Table1'); + await gu.addNewSection('Chart', 'Table1', { dismissTips: true}); assert.isFalse(await gu.isSidePanelOpen('right')); await gu.undo();