[PR #1489] refactor(container + bm): use Arc<str> and WsElementId for Workspace Element IDs #1426

Open
opened 2026-01-05 14:55:14 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1489
Author: @JustForFun88
Created: 6/20/2025
Status: 🔄 Open

Base: masterHead: use_id_istead_of_str


📝 Commits (2)

  • c279917 Use Arc<str> and WsElementId instead of String
  • bafb615 make serialize and deserialize compact

📊 Changes

4 files changed (+84 additions, -45 deletions)

View changed files

📝 komorebi/src/border_manager/border.rs (+5 -4)
📝 komorebi/src/border_manager/mod.rs (+58 -35)
📝 komorebi/src/container.rs (+19 -4)
📝 komorebi/src/stackbar_manager/mod.rs (+2 -2)

📄 Description

This pull request switches to Arc<str> for container IDs and replaces plain strings with the WsElementId enum for workspace elements in the Border structure.

Motivation

  • Replacing String with Arc<str> for container IDs makes all cloning cheap.
  • The WsElementId enum eliminates heap allocation for floating window IDs in the Border structure.

Benefits

  • Lower memory usage and faster cloning of container/workspace state.
  • Stricter type checks to ensure correctness.
  • Cleaner API.

Notes

Deserialization from legacy JSON (string IDs) is preserved by custom (de)serializers.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/1489 **Author:** [@JustForFun88](https://github.com/JustForFun88) **Created:** 6/20/2025 **Status:** 🔄 Open **Base:** `master` ← **Head:** `use_id_istead_of_str` --- ### 📝 Commits (2) - [`c279917`](https://github.com/LGUG2Z/komorebi/commit/c27991716173a6f6feb61d3163efba7a3c57b02a) Use `Arc<str>` and `WsElementId` instead of `String` - [`bafb615`](https://github.com/LGUG2Z/komorebi/commit/bafb615f4a5696141ede791ecd77ef355b9ec915) make serialize and deserialize compact ### 📊 Changes **4 files changed** (+84 additions, -45 deletions) <details> <summary>View changed files</summary> 📝 `komorebi/src/border_manager/border.rs` (+5 -4) 📝 `komorebi/src/border_manager/mod.rs` (+58 -35) 📝 `komorebi/src/container.rs` (+19 -4) 📝 `komorebi/src/stackbar_manager/mod.rs` (+2 -2) </details> ### 📄 Description This pull request switches to `Arc<str>` for container IDs and replaces plain strings with the `WsElementId` enum for workspace elements in the `Border` structure. ## Motivation - Replacing `String` with `Arc<str>` for container IDs makes all cloning cheap. - The `WsElementId` enum eliminates heap allocation for floating window IDs in the `Border` structure. ## Benefits - Lower memory usage and faster cloning of container/workspace state. - Stricter type checks to ensure correctness. - Cleaner API. ## Notes Deserialization from legacy JSON (string IDs) is preserved by custom (de)serializers. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:55:14 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1426