diff options
| author | soryu <soryu@soryu.co> | 2026-01-15 03:37:44 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-01-15 03:37:44 +0000 |
| commit | 764bd28d08ceaef03cd4050f9568a62d77bbcfca (patch) | |
| tree | dbd83ea7d213902f2b8021acc98798b6f3545946 /makima/src/server/mod.rs | |
| parent | eeafe072bc6bb81459f7d087b48fc921afe9cc11 (diff) | |
| download | soryu-764bd28d08ceaef03cd4050f9568a62d77bbcfca.tar.gz soryu-764bd28d08ceaef03cd4050f9568a62d77bbcfca.zip | |
Add repository history feature to store and suggest previously used repositories (#18)
- Add repository_history table migration with repo_type, repo_path, use_count, last_used_at
- Add RepositoryHistoryEntry model and CRUD database functions
- Create API endpoints: GET/POST/DELETE /api/v1/repository-history, GET /api/v1/repository-history/suggestions
- Update add_remote_repository and add_local_repository handlers to automatically track history
- Update frontend API with repository history types and functions
- Add Repository History section to Settings page with list of entries and delete functionality
- Add suggestions dropdown to RepositoryPanel when entering new repository URL/path
- Suggestions filter by repo type (remote vs local) and match on user input
Test plan:
- Add a remote repository to a contract - verify it appears in Settings history
- Add a local repository to a contract - verify it appears in Settings history
- Add same repository again - verify use_count increments, not duplicate
- When adding new repository, verify suggestions appear based on history
- Delete a history entry from Settings - verify it's removed
- Verify suggestions only show matching type (remote for remote, local for local)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/server/mod.rs')
| -rw-r--r-- | makima/src/server/mod.rs | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/makima/src/server/mod.rs b/makima/src/server/mod.rs index 27ee06c..0eba009 100644 --- a/makima/src/server/mod.rs +++ b/makima/src/server/mod.rs @@ -18,7 +18,7 @@ use tower_http::trace::TraceLayer; use utoipa::OpenApi; use utoipa_swagger_ui::SwaggerUi; -use crate::server::handlers::{api_keys, chat, contract_chat, contract_daemon, contracts, file_ws, files, listen, mesh, mesh_chat, mesh_daemon, mesh_merge, mesh_supervisor, mesh_ws, templates, transcript_analysis, users, versions}; +use crate::server::handlers::{api_keys, chat, contract_chat, contract_daemon, contracts, file_ws, files, listen, mesh, mesh_chat, mesh_daemon, mesh_merge, mesh_supervisor, mesh_ws, repository_history, templates, transcript_analysis, users, versions}; use crate::server::openapi::ApiDoc; use crate::server::state::SharedState; @@ -191,6 +191,19 @@ pub fn make_router(state: SharedState) -> Router { // Template endpoints .route("/templates", get(templates::list_templates)) .route("/templates/{id}", get(templates::get_template)) + // Settings endpoints + .route( + "/settings/repository-history", + get(repository_history::list_repository_history), + ) + .route( + "/settings/repository-history/suggestions", + get(repository_history::get_repository_suggestions), + ) + .route( + "/settings/repository-history/{id}", + axum::routing::delete(repository_history::delete_repository_history), + ) .with_state(state); let swagger = SwaggerUi::new("/swagger-ui") |
