Skip to content

fix(tui): enable create room when a window is focused - #146

Merged
viktorstrate merged 1 commit into
viktorstrate:mainfrom
prascli:fix/create-room-button
Nov 26, 2026
Merged

viktorstrate merged 1 commit into
viktorstrate:mainfrom
prascli:fix/create-room-button

Conversation

@prascli

@prascli prascli commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Fixes #145

The "Create room" command is disabled on the normal path. AppCommands reads the focused window through @FocusedValue(WindowState.self), so when a window is focused windowState is non-nil. The current condition at Sources/MactrixApp/Commands.swift:86 therefore disables the button whenever it should be available.

The owner confirmed in #145 that the condition is inverted. The command should be disabled only when no window is available, because opening the screen in a new window after all windows are closed is not implemented yet. This changes only the condition; the action, label, help text and shortcut are untouched.

Verification

  • Confirmed the defect at upstream main commit a440d21:

$ grep -n 'disabled(windowState' Sources/MactrixApp/Commands.swift
86: .disabled(windowState != nil)

  • Checked after the edit that the optional is compared to nil in the same helper and that no other create-room condition changed:

$ python3 -c "p='Sources/MactrixApp/Commands.swift'; s=open(p).read(); helper=s[s.index('static func createRoomButton'):s.index('var conversationCommands')]; assert 'windowState == nil' in helper; assert 'windowState != nil' not in helper; print('condition corrected in createRoomButton')"
condition corrected in createRoomButton

  • $ git diff --check produced no output.
  • xcodebuild clean build analyze and xcodebuild test were not run here: this host has no macOS, Xcode or SwiftUI toolchain. The repository's "Xcode - Build and Test" workflow runs both on macOS for pull requests.

Prepared with an AI assistant and reviewed before submission.

Signed-off-by: Indra Prasetya <11029197+prascli@users.noreply.github.com>
@viktorstrate
viktorstrate merged commit 2364679 into viktorstrate:main Nov 26, 2026
3 checks passed
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.

Bug: Room creation permanently disabled

2 participants