Skip to content

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

Open
JustForFun88 wants to merge 2 commits intoLGUG2Z:masterfrom
JustForFun88:use_id_istead_of_str
Open

refactor(container + bm): use Arc<str> and WsElementId for Workspace Element IDs#1489
JustForFun88 wants to merge 2 commits intoLGUG2Z:masterfrom
JustForFun88:use_id_istead_of_str

Conversation

@JustForFun88
Copy link
Contributor

@JustForFun88 JustForFun88 commented Jun 20, 2025

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.

@JustForFun88 JustForFun88 force-pushed the use_id_istead_of_str branch from 20d8b8b to 01cdc38 Compare June 21, 2025 15:07
@JustForFun88 JustForFun88 force-pushed the use_id_istead_of_str branch from 89f7de0 to d7158ee Compare June 23, 2025 07:10
@JustForFun88 JustForFun88 changed the title refactor(container + bm): use Arc<str> and WsElementId for Workspace Element IDs refactor(container + bm): use ContainerId for Container and WsElementId for Workspace Element IDs Jun 23, 2025
@JustForFun88 JustForFun88 force-pushed the use_id_istead_of_str branch from d7158ee to c279917 Compare June 23, 2025 19:04
@JustForFun88 JustForFun88 changed the title refactor(container + bm): use ContainerId for Container and WsElementId for Workspace Element IDs refactor(container + bm): use Arc<str> and WsElementId for Workspace Element IDs Jun 23, 2025
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