Skip to content

Conversation

babarot
Copy link
Owner

@babarot babarot commented Feb 20, 2025

This PR introduces a significant refactoring of the codebase to improve maintainability and code organization.

Major Architectural Changes

File Organization

  • Split UI logic into domain-specific files:
    • model.go: Core model definitions and initialization
    • commands.go: Command-related functions
    • messages.go: Message type definitions
    • view.go, view_detail.go, view_confirm.go: View-specific rendering logic
    • state.go: State management
    • update.go: Update logic for different view states

Key Architecture Improvements

  • Introduced a dedicated ViewState struct for better state management
  • Consolidated key mappings into a unified system in keymap.go
  • Reorganized styles with a more structured approach in styles.go
  • Separated view rendering logic by responsibility

Code Structure

  • Clearer separation of concerns between:
    • State management
    • View rendering
    • Event handling
    • Command execution
  • More modular and testable components
  • Better type definitions and error handling

Benefits

  • Improved code maintainability
  • Clearer component boundaries
  • Easier to extend and modify individual parts
  • Better organized and more predictable state management
  • More consistent code structure across the application

This refactoring lays a stronger foundation for future feature development and maintenance.

@babarot babarot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, issues, etc. label Feb 20, 2025
@babarot babarot merged commit 6ff40db into main Feb 21, 2025
5 checks passed
@babarot babarot deleted the babarot/ui branch February 21, 2025 09:59
@github-actions github-actions bot mentioned this pull request Feb 20, 2025
tmeijn pushed a commit to tmeijn/dotfiles that referenced this pull request Mar 6, 2025
This MR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [babarot/gomi](https://github.com/babarot/gomi) | minor | `v1.4.3` -> `v1.5.1` |

MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot).

**Proposed changes to behavior should be submitted there as MRs.**

---

### Release Notes

<details>
<summary>babarot/gomi (babarot/gomi)</summary>

### [`v1.5.1`](https://github.com/babarot/gomi/blob/HEAD/CHANGELOG.md#v151---2025-02-23)

[Compare Source](babarot/gomi@v1.5.0...v1.5.1)

##### New Features

-   Add Log Rotation feature by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#82

### [`v1.5.0`](https://github.com/babarot/gomi/blob/HEAD/CHANGELOG.md#v150---2025-02-21)

[Compare Source](babarot/gomi@v1.4.3...v1.5.0)

##### New Features

-   Add Permanent Deletion Feature with Confirmation Dialog   by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#79

##### Refactorings

-   Large-scale Code Refactoring for Better Architecture by [@&#8203;babarot](https://github.com/babarot) in babarot/gomi#81

##### Others

-   Create missing log path by [@&#8203;kariudo](https://github.com/kariudo) in babarot/gomi#80

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this MR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box

---

This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xODIuNCIsInVwZGF0ZWRJblZlciI6IjM5LjE4Mi40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/cleanup Categorizes issue or PR as related to cleaning up code, issues, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants