Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arc] Enhance "Search Tabs" to Prioritize Windows with Active Space #16412

Open
ocflex opened this issue Jan 16, 2025 · 2 comments
Open

[Arc] Enhance "Search Tabs" to Prioritize Windows with Active Space #16412

ocflex opened this issue Jan 16, 2025 · 2 comments
Labels
extension: arc Issues related to the arc extension extension Issues related to one of the extensions in the Store feature request New feature or improvement

Comments

@ocflex
Copy link

ocflex commented Jan 16, 2025

Extension

https://www.raycast.com/the-browser-company/arc

Description

When using the Arc extension's "Search Tabs" feature in a multi-monitor setup with multiple Arc windows, the current behavior always opens tabs in the primary monitor by switching to the appropriate space. This isn't optimal for users who maintain different spaces across multiple windows for context management.

Environment:

  • Raycast Version: 1.89.0
  • Arc Extension Version: 2024-10-25

Current Behavior:

  • When searching for a tab that exists in a space, the extension opens it in the primary monitor
  • Forces a space switch even if the target space is already active in another window
  • Disrupts workflow by changing focus to primary monitor unnecessarily

Desired Behavior:

  • When searching for a tab, prioritize opening it in windows where the relevant space is already active
  • Only fall back to space switching if the target space isn't currently visible in any window
  • Maintain context by respecting the user's window/space organization

Example Scenario:

  1. User has dual monitors with Arc windows on both
  2. Secondary monitor's Arc window is dedicated to a single space
  3. When searching for a tab that belongs to the space shown in the secondary monitor
  4. Extension should open the tab in the secondary monitor's window instead of switching spaces in the primary monitor

Who will benefit from this feature?

  • Users with multi-monitor setups
  • Power users who organize their Arc spaces across different windows
  • Users who maintain separate contexts per monitor/window
  • Anyone who wants to minimize unnecessary space switching and context switching

Anything else?

This enhancement would align better with Arc's space management philosophy and would help maintain the mental model of having dedicated spaces per window. The current behavior, while functional, creates unnecessary context switches that can disrupt workflow.

Suggested Implementation Approaches:

  1. Configurable Behavior:

    • Add a preference setting in the extension to choose the default behavior:
      • Always use primary window (current behavior)
      • Prioritize windows with active space
      • Always ask user
  2. Interactive Selection:

    • When showing search results, provide additional context/options:
      • Show which window/monitor the space is currently active in
      • Allow users to choose the target window when selecting a result
      • Could use Raycast's built-in action menu (⌘+K) for this purpose

Technical Note: This might require the extension to:

  1. Check all open Arc windows for the target space
  2. Prioritize windows where the space is already active
  3. Only trigger space switching as a fallback option
@ocflex ocflex added extension Issues related to one of the extensions in the Store feature request New feature or improvement labels Jan 16, 2025
@raycastbot raycastbot added the extension: arc Issues related to the arc extension label Jan 16, 2025
@raycastbot
Copy link
Collaborator

raycastbot commented Jan 16, 2025

Thank you for opening this issue!

🔔 @thomaspaulmann @zach-fuller @ankitchouhan1020 @pernielsentikaer @danpalmer @rgrunberg @tleo19 @loris @bdsqqq @xilopaint @jayeshbhole @hinzed1127 @omar-salama @underscoregeb @ridemountainpig @nebbles @alanxmay you might want to have a look.

💡 Author and Contributors commands

The author and contributors of the-browser-company/arc can trigger bot actions by commenting:

  • @raycastbot close this issue Closes the issue.
  • @raycastbot close as not planned Closes the issue as not planned.
  • @raycastbot rename this issue to "Awesome new title" Renames the issue.
  • @raycastbot reopen this issue Reopens the issue.
  • @raycastbot assign me Assigns yourself to the issue.
  • @raycastbot good first issue Adds the "Good first issue" label to the issue.
  • @raycastbot keep this issue open Make sure the issue won't go stale and will be kept open by the bot.

@ocflex
Copy link
Author

ocflex commented Jan 16, 2025

Implementation Suggestion:
The current behavior seems to stem from the findTab function in arc.ts, which returns the first matching tab it finds regardless of space visibility. This could be modified to prioritize tabs in active spaces:

  1. When searching through windows, get each window's currently active space
  2. For matching tabs:
    • Return immediately if the tab is in the current/active space of its window
    • Store as fallback if not in active space (continue searching)
  3. Fall back to first found instance if no tab is found in active spaces

This maintains backwards compatibility while preferring tabs that don't require space switching. Could be made configurable via extension settings to preserve original behavior if desired.

Pseudo-code:

-- Current behavior (simplified):
if url matches then
  return first_matching_tab_info
end if
-- Proposed behavior:
set fallback_output to ""
tell window
  set active_space to title of current space
  
  if url matches then
    if tab_location is equal to active_space then
      -- Tab is in currently visible space, return immediately
      return tab_info
    else if fallback_output is equal to "" then
      -- Store as fallback if we don't find any tabs in active spaces
      set fallback_output to tab_info
    end if
  end if
end tell
-- Return fallback if no tab found in active spaces
return fallback_output

Example pseudo-flow:
Window 1 (active space: "Work") → Tab in "Personal" space ❌ Store as fallback
Window 2 (active space: "Personal") → Tab in "Personal" space ✅ Return immediately

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension: arc Issues related to the arc extension extension Issues related to one of the extensions in the Store feature request New feature or improvement
Projects
None yet
Development

No branches or pull requests

2 participants