Skip to content

perf(sway/workspaces): avoid full tree for simple configs#3

Open
SaveTheRbtz wants to merge 1 commit into
masterfrom
codex-sway-workspaces-fastpath
Open

perf(sway/workspaces): avoid full tree for simple configs#3
SaveTheRbtz wants to merge 1 commit into
masterfrom
codex-sway-workspaces-fastpath

Conversation

@SaveTheRbtz

@SaveTheRbtz SaveTheRbtz commented Jun 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • Request IPC_GET_WORKSPACES when sway/workspaces does not need per-window tree data.
  • Keep the existing IPC_GET_TREE path for window-rewrite, where child window nodes are required.
  • Avoid rewriting unchanged workspace button labels.

Why

Simple workspace configs only need Sway's workspace list, but Waybar was fetching and parsing the full tree on every workspace/window event. The smaller IPC reply reduces JSON parse and allocation work while preserving the tree-backed path for configs that need it.

Testing

  • ninja -C build
  • meson test -C build

@SaveTheRbtz SaveTheRbtz force-pushed the codex-sway-workspaces-fastpath branch from 66dda49 to 76112b5 Compare June 4, 2026 22:04
@SaveTheRbtz SaveTheRbtz changed the title [codex] Avoid full Sway tree for simple workspaces perf(sway/workspaces): avoid full tree for simple configs Jun 4, 2026
@SaveTheRbtz SaveTheRbtz marked this pull request as ready for review June 4, 2026 22:57

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76112b59c1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (node.isMember("nodes") || node.isMember("floating_nodes")) {
return node["nodes"].empty() && node["floating_nodes"].empty();
}
return node["target_output"].isString();

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 Preserve empty workspace detection on the fast path

When window-rewrite is not configured, the new IPC_GET_WORKSPACES path feeds real workspaces that do not contain nodes/floating_nodes; they also do not have target_output, so this fallback returns false for every real workspace. As a result, an actually empty Sway workspace no longer receives #workspaces button.empty unless the user enables window-rewrite and forces the tree path, breaking the documented empty styling for the common/simple config this optimization targets.

Useful? React with 👍 / 👎.

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