Sync: Workspace Commands & Configurable UI Options - #12
Open
malikbenkirane wants to merge 7 commits into
Open
Conversation
Implements hexagonal architecture by separating domain models from infrastructure adapters. Previously, adapter-specific types (proc_adapter.Process, state_adapter.NvimServer) were used directly throughout the application, creating tight coupling between application logic and infrastructure implementations. Changes: - Creates domain models in `internal/domain/proc` and `internal/domain/server` representing core application entities - Defines repository interfaces in `internal/repo` (Server, Proc) to establish clear contracts between layers - Moves SQLite adapter from `internal/adapter/sqlite/state` to `internal/adapter/state/sqlite` following port-adapter naming - Updates all adapters to implement repository interfaces and return domain types instead of adapter-specific structs - Removes interface definitions from adapter packages, centralizing them in the repository layer This inversion of dependencies allows the core application logic to remain independent of database or OS-specific implementations. Future enthusiat developers can now add new adapters (e.g., PostgreSQL, different process APIs) by implementing repo.Server or repo.Proc without modifying application code.
Renames functional option constructors from `WithX` to `OptionX` pattern to improve API consistency and readability. The previous `With` prefix is typically reserved for builder patterns that chain method calls, whereas these are standalone function options passed to constructors. Changes: - `WithDebug()` → `OptionDebug()` - `WithMinPort()` → `OptionStartPort()` (also improves naming clarity by indicating this sets the starting port for range allocation rather than a minimum constraint) This follows the hexagonal architecture refactoring from commit 77a73c6 which established clearer naming conventions across the repository layer. The new names better communicate that these are discrete configuration options rather than chainable modifiers. All callsites in cmd/attach.go, cmd/duplicate.go, and cmd/new.go updated to use the new function names. No functional changes to application behavior.
The client attachment functionality was previously hardcoded to use Neovide with specific grid dimensions and frame settings. This made it impossible to use the application with terminal-based nvim or to customize the UI configuration for different use cases. I personally churned away from Neovide because of some issues I experienced attaching a session to a previously detached session observing empty buffers (UI-wisely only). I guess these come from the redrawn logic and [some people are also complaining from crashes using Neovide noice.nvim](neovim/neovim#22344). I previously implemented [last-font.nvim] plugin to be able to set GUI fonts persistent through Neovide (or any other Neovim GUI) sessions. But as I am turning back to TUI, I choosed to come back to Wezterm that offers `config.font_size` and `config.font` > A couple `sed` commands and your're set! As being a fan of the [fish-shell](https://fishshell.com/) I implemented a couple [autoloading fish functions]( https://fishshell.com/docs/current/language.html#autoloading-functions) to manage `wezfont` (this one is coupled with [sk](https://github.com/skim-rs/skim for fzf-like font selection) and `wezfont_size SIZE`. If you want to get the bird-eye picture checkout my dotfiles for [nvim](https://github.com/malikbenkirane/.nvim) and [fish](https://github.com/malikbenkirane/.fish). To wrap up the disgression on my "intelligent" setup, being a "dumb" maxos user that would prefer to work on [OpenBSD](https://www.openbsd.org), I do use [raycast](https://www.raycast.com/) and the terminal UIcombines well with the emoji extension 😅 ... Now, this commit introduces three new option functions to configure how clients attach to the server: - OptionTermUI(): Configures terminal-based nvim using --remote-ui, which runs in the foreground and inherits stdio streams - OptionNeovideUI(columns, lines): Configures Neovide with customizable grid dimensions (defaults to 160x120) and transparent frames, which forks as a background process - OptionUI(fork, command, args...): Low-level option that accepts any command with format string substitution for port numbers The Config struct now stores a cmd function that generates the exec.Cmd with the appropriate port, plus a fork boolean that determines whether to use cmd.Start() (background) or cmd.Run() (foreground). Terminal UI is applied as the default configuration, replacing the previous hardcoded Neovide behavior. The Attach() method now properly configures stdio streams and selects the execution mode based on the fork setting, enabling both interactive terminal usage and GUI client workflows.
Simplifies navigation and context switching for users handling multiple project directories. Introduces a workspace concept where each workspace is a labeled file‑system path. Provides a `neomux workspace list` command to display all defined workspaces and a `neomux workspace <LABEL>` command to change to the associated directory and start a new shell. Part of 4sp1#10
Adds a command to delete Neomux workspaces. Simplifies cleanup of unused or obsolete workspace configurations. Improves user workflow by providing a direct way to remove workspaces without manual state edit. Part of 4sp1#11
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds comprehensive workspace management, makes client UI attachment fully configurable, and finalises the earlier hexagonal‑architecture refactor.
Key changes
list, labeled navigation (neomux workspace <LABEL>), anddeletefor clean removal of workspaces.OptionTermUI,OptionNeovideUI, and genericOptionUIallowing terminal or Neovide clients with custom dimensions and fork behaviour; default shifts to terminal UI.WithDebug→OptionDebug,WithMinPort→OptionStartPortfor clearer option semantics.Notes
With*option functions.OptionNeovideUIif that behaviour is required.