Skip to content

feat(windows): add single_window_new_tab option for bare relaunch - #280

Closed
ItzELECTR0 wants to merge 1 commit into
noctalia-dev:mainfrom
ItzELECTR0:feat/single-window-new-tab
Closed

ItzELECTR0 wants to merge 1 commit into
noctalia-dev:mainfrom
ItzELECTR0:feat/single-window-new-tab

Conversation

@ItzELECTR0

Copy link
Copy Markdown

Summary

  • Add browser.single_window_new_tab (false by default) to BrowserSettings and expose it as "Open New Tab on Relaunch" under Settings > General > Tabs and Windows (shown when "Single Window" is on).
  • Update WorkspaceApplication::open so that when single_window and single_window_new_tab are both enabled, launching luciole without locations opens a new tab in the existing window instead of just focusing it.
  • Guard restoreLastWindow with !existing so a bare relaunch in an already-open window opens a fresh tab rather than restoring a closed window's session.
  • Add translations, user/design documentation updates, and settings unit tests.

Motivation

When "Single Window" is enabled, launching luciole again without arguments only focuses the existing window. Those who bind a global shortcut to launch their file manager (e.g. SUPER+E) and expect repeated presses to open new tabs (as in Thunar for example) had no way to opt into that behavior. The default is false keeping the existing behavior but also allowing to change it.

Type of Change

  • New feature

Related Issue

Closes #262

Testing

  • I verified that the functionality works and the option is displayed correctly.
  • CCACHE_DIR=/tmp/ccache just build: built luciole cleanly with zero warnings.
  • meson test -C build-debug settings --print-errorlogs: luciole:settings passed (1/1 OK).
  • CCACHE_DIR=/tmp/ccache just test: 77/79 tests passed; preview-metadata and thumbnail failed but are unrelated to this change.
  • CCACHE_DIR=/tmp/ccache just lint: clang-tidy (226 files, --warnings-as-errors='*'), lint-python, and lint-prose passed.
  • just format-check && just i18n-check && just role-alpha-check: all passed (2416 keys checked).

Screenshots / Videos

Screen.Recording.2026-12-01.153448.mp4

Checklist

  • This PR is ready for review, or it is marked as Draft.
  • This change fits SCOPE.md, or its scope was agreed in an issue or on Discord first.
  • I read and followed the relevant guidance in CONTRIBUTING.md.
  • I ran just format, or this PR has no C++ changes.
  • I ran just lint and the relevant build or test commands, or explained why they were not run.
  • I ran just role-alpha-check, or this PR does not change UI colors.
  • I tested the change in a running Luciole where automated checks are insufficient.
  • I self-reviewed the changes.
  • I checked for new warnings or errors.
  • I updated docs/, or this PR does not change user-facing behavior or settings.
  • I used canonical names for settings, paths, and identifiers.

@ItsLemmy ItsLemmy added the talia-review Ask Talia for a preliminary AI review (removed once posted) label Dec 1, 2026

@talia-ci talia-ci Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Talia preliminary review

Check Result
Merge score 🟡 3/5 — Minor changes needed before merging
Findings 🟡 1 medium
Review depth 3/5 — how thoroughly the changed code could be checked by reading it
Coverage 10 of 10 changed files reviewed

What Talia checked: Checked the open()/restoreLastWindow paths, BrowserSettings/BrowserPreferenceId descriptors and static order assertions, dialog row visibility/search wiring, docs and tests; the remaining uncertainty is runtime UI refresh after settings change during an active search.

Findings

# Severity Finding Location
1 🟡 P2 Search results state goes stale when the relaunch row hides during sync src/ui/dialogs/settings_dialog.cpp:308

Each finding is explained in a review comment on its line.

Run details
  • Commit reviewed: 169d231
  • Source lookups: 51 file reads, 60 searches
  • Prompt version: 859b7490ca3d

Preliminary automated review: Talia read the changed code and related source; nothing was built, run or tested, and AI can make mistakes. It is not a scope acceptance or a promise to merge; a human reviewer makes the final call. See our ethos.

const auto it = std::ranges::find(m_searchRows, m_singleWindowNewTabRow, &SearchRow::node);
shown = it != m_searchRows.end() && it->text.contains(m_query);
}
showNode(m_singleWindowNewTabRow, shown);

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 (medium) · Search results state goes stale when the relaunch row hides during sync

The new SingleWindow wrapper in sync() hides m_singleWindowNewTabRow when m_current.singleWindow is false, but it only calls showNode on that row. applySearch (lines 713-718) shows/hides the row's card and m_noResults from the match set, and sync does not refresh them. Trigger: with Single Window on, search a query that matches only this row (e.g. "relaunch"), then click Reset All (onResetClicked -> m_resetAll -> preferences change -> sync), or let a config-file edit flip single_window off while the dialog is open. sync now hides the row, yet its "Tabs and Windows" card remains visible (shown by the earlier match) and the "No settings match" label stays hidden, leaving an empty results card. Correction: when the wrapper changes this row's availability during an active query, re-run applySearch(m_query) or otherwise recompute its card and m_noResults state instead of only hiding the row.

Talia preliminary review · correctness

@talia-ci talia-ci Bot removed the talia-review Ask Talia for a preliminary AI review (removed once posted) label Dec 1, 2026
@ItsLemmy

ItsLemmy commented Dec 1, 2026

Copy link
Copy Markdown
Member

Thanks for the PR! Closing it because Single Window already covers this without a new option: a launch with a folder opens a tab in the existing window, so binding SUPER+E to 'luciole ~' gives a new tab on each press.
A bare launch keeps raising the window, which is what a dock or launcher click expects. I've added a note about this to the tabs-and-windows docs.

@ItsLemmy ItsLemmy closed this Dec 1, 2026
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.

[FEATURE] Open a new tab when launching Luciole again in Single Window mode

2 participants