Skip to content

Add command to open the search page in the current tab#2396

Open
szdarkhack wants to merge 1 commit intoyomidevs:masterfrom
szdarkhack:open-search-in-place
Open

Add command to open the search page in the current tab#2396
szdarkhack wants to merge 1 commit intoyomidevs:masterfrom
szdarkhack:open-search-in-place

Conversation

@szdarkhack
Copy link
Copy Markdown

This addresses #2393. I'll be the first to admit that JS/TS is certainly not my forte, but I tried to do minimal/sensible things (and followed the linter). Please feel free to point out any issues.

The changes resulted in the exact same npm test output as master, and I sucessfully tested the functionality on Firefox 150.0 & Chrome 147.0.7727.102 on Windows 11. As described in the issue, the new command is unbound by default.

@szdarkhack szdarkhack requested a review from a team as a code owner April 24, 2026 21:09
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 64065e6c4d

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +1223 to 1225
case 'existingOrCurrentTab':
try {
if (await openInTab()) { return; }
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Bypass existing-tab reuse for current-tab search command

The new existingOrCurrentTab mode still goes through openInTab(), so openSearchPageCurrentTab can focus an already-open search tab in another tab/window and return without touching the active tab. This breaks the command’s advertised behavior (“open ... in the current tab”) whenever any /search.html tab already exists. The current-tab mode should skip the existing-tab lookup and always navigate the active tab.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This follows the behavior of the current "Open search page" command (which uses existingOrNewTab), i.e. prioritizing focusing an existing search page if it exists, instead of opening a new one. I think the behavior is fairly intuitive (only one search page open at any time) once the user comes across it, but improving the description is always an option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant