The issue
The repository's frontend homepage component has grown into an unreadable ~850-line tome,
most of which is not JSX but rather a lot of large React hooks
(with some scoring cognitive complexity > 21 on the SonarQube analysis)
handling a lot of unrelated responsibilities all in a single component
which can make maintaining and modifying the frontend all the more difficult.
A single homepage component shouldn't be responsible for configuring:
- Tauri integration
- File importing and exporting
- Slash commands
- AI actions
- Drag-and-drop handling
- Keyboard shortcuts and menu actions
but rather orchestrating these functionalities together.
My proposal
Refactor the homepage into separate components
and make utility functions to move away some of the logic
the component hooks are currently responsible for
so that functionality can be maintained and modified separately.
The benefits
This would make maintaining the frontend easier, more productive,
lowering overall cognitive complexity,
making the codebase more structured
and helping the editor's frontend catch up with the more popular markdown editors.
The issue
The repository's frontend homepage component has grown into an unreadable ~850-line tome,
most of which is not JSX but rather a lot of large React hooks
(with some scoring cognitive complexity > 21 on the SonarQube analysis)
handling a lot of unrelated responsibilities all in a single component
which can make maintaining and modifying the frontend all the more difficult.
A single homepage component shouldn't be responsible for configuring:
but rather orchestrating these functionalities together.
My proposal
Refactor the homepage into separate components
and make utility functions to move away some of the logic
the component hooks are currently responsible for
so that functionality can be maintained and modified separately.
The benefits
This would make maintaining the frontend easier, more productive,
lowering overall cognitive complexity,
making the codebase more structured
and helping the editor's frontend catch up with the more popular markdown editors.