Skip to content

config: workspace display order#542

Merged
mahkoh merged 1 commit into
mahkoh:masterfrom
kotarac:kotarac/workspace-order
Jul 26, 2025
Merged

config: workspace display order#542
mahkoh merged 1 commit into
mahkoh:masterfrom
kotarac:kotarac/workspace-order

Conversation

@kotarac
Copy link
Copy Markdown
Contributor

@kotarac kotarac commented Jul 26, 2025

Point 1 from #519 done as we talked about here #541 (comment).

  • considered natural sorting but decided it's probably not worth it
  • maintains a sorted linked list of workspaces if workspace-display-order is set to sorted, handles workspace creation, drag, move-to-output
  • O(N) search to find an appropriate place to insert a workspace, but it's only on user actions and it's unlikely there's ever going to be many of them, so should be fine

Comment thread jay-config/src/lib.rs Outdated
Comment thread src/tree/output.rs Outdated
Comment thread src/tree/output.rs Outdated
Comment thread toml-config/src/config/parsers/config.rs Outdated
@mahkoh
Copy link
Copy Markdown
Owner

mahkoh commented Jul 26, 2025

I think it would be better if the workspaces were sorted in the linked list.

@kotarac
Copy link
Copy Markdown
Contributor Author

kotarac commented Jul 26, 2025

I think it would be better if the workspaces were sorted in the linked list.

You mean keeping the list of workspaces sorted at all times when it's updated?

@mahkoh
Copy link
Copy Markdown
Owner

mahkoh commented Jul 26, 2025

Yes.

@kotarac
Copy link
Copy Markdown
Contributor Author

kotarac commented Jul 26, 2025

Ignore the wip stuff, need to test this across different machines to figure out the workspace dragging and fix a couple of issues after the recent cleanup.

@kotarac kotarac force-pushed the kotarac/workspace-order branch 5 times, most recently from 7e83b5a to 283f4e0 Compare July 26, 2025 13:22
@kotarac
Copy link
Copy Markdown
Contributor Author

kotarac commented Jul 26, 2025

Can you take a look?

Needed to handle a bit more than I initially thought:

  • creation
  • drag
  • move-to-output

I tested all 3 cases and it seems to work ok.

@kotarac kotarac force-pushed the kotarac/workspace-order branch from 283f4e0 to cf4f996 Compare July 26, 2025 14:25
Comment thread src/config/handler.rs
Comment thread src/tree/output.rs Outdated
Comment thread src/config/handler.rs
@kotarac kotarac force-pushed the kotarac/workspace-order branch from cf4f996 to a6dda1e Compare July 26, 2025 15:53
@kotarac
Copy link
Copy Markdown
Contributor Author

kotarac commented Jul 26, 2025

Addressed those points. Squashed the commits, noticed in other PRs you prefer it that way and I've done it like that before as well.

Comment thread src/tree/output.rs Outdated
@kotarac kotarac force-pushed the kotarac/workspace-order branch from a6dda1e to 2e7368a Compare July 26, 2025 16:03
@mahkoh mahkoh force-pushed the kotarac/workspace-order branch from 2e7368a to e570152 Compare July 26, 2025 17:12
@mahkoh mahkoh merged commit 225dda8 into mahkoh:master Jul 26, 2025
6 checks passed
@mahkoh
Copy link
Copy Markdown
Owner

mahkoh commented Jul 26, 2025

Thanks!

@kotarac kotarac deleted the kotarac/workspace-order branch July 26, 2025 17:21
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.

2 participants