diff options
| author | soryu <soryu@soryu.co> | 2026-02-17 13:04:18 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-17 13:04:18 +0000 |
| commit | 049fd3e8a15952627954678838ca5382c11ecd04 (patch) | |
| tree | 0e0c79185d358e508830802876f4ae87cd7c9507 | |
| parent | b67b3f8e8d63361d9ff19f87fd608c03bfa3fd43 (diff) | |
| download | soryu-049fd3e8a15952627954678838ca5382c11ecd04.tar.gz soryu-049fd3e8a15952627954678838ca5382c11ecd04.zip | |
feat: reorder nav, link orders to steps, improve PR titles (#68)
* feat: soryu-co/soryu: Reorder navigation: move Orders before Contracts
* feat: soryu-co/soryu: Generate PR titles from step content instead of directive title
* feat: soryu-co/soryu: Add orderId field to step creation and link orders to steps
* feat: soryu-co/soryu: Handle completed orders during plan-orders flow
| -rw-r--r-- | makima/frontend/src/components/NavStrip.tsx | 2 | ||||
| -rw-r--r-- | makima/frontend/src/components/orders/OrderDetail.tsx | 2 | ||||
| -rw-r--r-- | makima/frontend/src/components/orders/OrderList.tsx | 2 | ||||
| -rw-r--r-- | makima/migrations/20260217000000_add_order_under_review_status.sql | 4 | ||||
| -rw-r--r-- | makima/src/db/repository.rs | 13 | ||||
| -rw-r--r-- | makima/src/orchestration/directive.rs | 32 | ||||
| -rw-r--r-- | makima/src/server/handlers/directives.rs | 1 |
7 files changed, 44 insertions, 12 deletions
diff --git a/makima/frontend/src/components/NavStrip.tsx b/makima/frontend/src/components/NavStrip.tsx index 5aba6a3..117f4e1 100644 --- a/makima/frontend/src/components/NavStrip.tsx +++ b/makima/frontend/src/components/NavStrip.tsx @@ -11,8 +11,8 @@ interface NavLink { const NAV_LINKS: NavLink[] = [ { label: "Listen", href: "/listen" }, { label: "Directives", href: "/directives", requiresAuth: true }, - { label: "Contracts", href: "/contracts", requiresAuth: true }, { label: "Orders", href: "/orders", requiresAuth: true }, + { label: "Contracts", href: "/contracts", requiresAuth: true }, { label: "Mesh", href: "/mesh", requiresAuth: true }, { label: "History", href: "/history", requiresAuth: true }, ]; diff --git a/makima/frontend/src/components/orders/OrderDetail.tsx b/makima/frontend/src/components/orders/OrderDetail.tsx index 1b8d76e..9c3ac97 100644 --- a/makima/frontend/src/components/orders/OrderDetail.tsx +++ b/makima/frontend/src/components/orders/OrderDetail.tsx @@ -11,7 +11,7 @@ import type { const STATUS_BADGE: Record<OrderStatus, { color: string; label: string }> = { open: { color: "text-[#75aafc] border-[rgba(117,170,252,0.4)]", label: "OPEN" }, in_progress: { color: "text-yellow-400 border-yellow-800", label: "IN PROGRESS" }, - under_review: { color: "text-amber-400 border-amber-800", label: "UNDER REVIEW" }, + under_review: { color: "bg-purple-400/20 text-purple-400 border-purple-800", label: "UNDER REVIEW" }, done: { color: "text-emerald-400 border-emerald-800", label: "DONE" }, archived: { color: "text-[#556677] border-[#2a3a5a]", label: "ARCHIVED" }, }; diff --git a/makima/frontend/src/components/orders/OrderList.tsx b/makima/frontend/src/components/orders/OrderList.tsx index 3d63c54..0ebd18d 100644 --- a/makima/frontend/src/components/orders/OrderList.tsx +++ b/makima/frontend/src/components/orders/OrderList.tsx @@ -4,7 +4,7 @@ import type { Order, OrderStatus, OrderPriority, OrderType } from "../../lib/api const STATUS_BADGE: Record<OrderStatus, { color: string; label: string }> = { open: { color: "text-[#75aafc] border-[rgba(117,170,252,0.4)]", label: "OPEN" }, in_progress: { color: "text-yellow-400 border-yellow-800", label: "IN PROGRESS" }, - under_review: { color: "text-amber-400 border-amber-800", label: "REVIEW" }, + under_review: { color: "text-purple-400 border-purple-800", label: "REVIEW" }, done: { color: "text-emerald-400 border-emerald-800", label: "DONE" }, archived: { color: "text-[#556677] border-[#2a3a5a]", label: "ARCHIVED" }, }; diff --git a/makima/migrations/20260217000000_add_order_under_review_status.sql b/makima/migrations/20260217000000_add_order_under_review_status.sql new file mode 100644 index 0000000..166be32 --- /dev/null +++ b/makima/migrations/20260217000000_add_order_under_review_status.sql @@ -0,0 +1,4 @@ +-- Add under_review status to orders for orders whose steps exist but are not yet merged +ALTER TABLE orders DROP CONSTRAINT IF EXISTS orders_status_check; +ALTER TABLE orders ADD CONSTRAINT orders_status_check + CHECK (status IN ('open', 'in_progress', 'under_review', 'done', 'archived')); diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs index aa1203a..c7b0a1f 100644 --- a/makima/src/db/repository.rs +++ b/makima/src/db/repository.rs @@ -5363,6 +5363,19 @@ pub async fn get_last_completed_step_task_id( // Directive Step CRUD // ============================================================================= +/// Get a single directive step by ID. +pub async fn get_directive_step( + pool: &PgPool, + step_id: Uuid, +) -> Result<Option<DirectiveStep>, sqlx::Error> { + sqlx::query_as::<_, DirectiveStep>( + r#"SELECT * FROM directive_steps WHERE id = $1"#, + ) + .bind(step_id) + .fetch_optional(pool) + .await +} + /// List all steps for a directive, ordered by order_index. pub async fn list_directive_steps( pool: &PgPool, diff --git a/makima/src/orchestration/directive.rs b/makima/src/orchestration/directive.rs index 5c134d6..eb157a3 100644 --- a/makima/src/orchestration/directive.rs +++ b/makima/src/orchestration/directive.rs @@ -1378,9 +1378,14 @@ git checkout -b "$NEW_BRANCH" origin/{base_branch} git push -u origin "$NEW_BRANCH" ``` -3. Create a new PR. Generate a concise, descriptive PR title (max 72 characters) based on the steps completed. -The title should summarize what the changes actually accomplish — do NOT just use the directive name "{title}". -Focus on the actual work done in the steps listed below. +3. Generate a descriptive PR title and create a new PR: + +Based on the steps completed above, generate a descriptive PR title that summarizes the actual changes (not just the directive name "{title}"). The title should: +- Be concise (under 72 characters) +- Describe WHAT was done, not just the project name +- Use conventional commit style if appropriate (feat:, fix:, refactor:, etc.) + +Then create the PR: ``` gh pr create --title "<YOUR_GENERATED_TITLE>" --body "{pr_body}" --head "$NEW_BRANCH" --base {base_branch} ``` @@ -1446,10 +1451,13 @@ git checkout -b {directive_branch} origin/{base_branch} git push -u origin {directive_branch} ``` -Then create the PR. You MUST generate a concise, descriptive PR title (max 72 characters) based on the steps completed above. -The title should summarize what the changes actually accomplish — do NOT just use the directive name "{title}". +Then generate a descriptive PR title and create the PR: + +Based on the steps completed above, generate a descriptive PR title that summarizes the actual changes (not just the directive name "{title}"). The title should: +- Be concise (under 72 characters) +- Describe WHAT was done, not just the project name +- Use conventional commit style if appropriate (feat:, fix:, refactor:, etc.) For example, instead of "soryu-co/soryu - makima" use something like "Fix order lifecycle, PR update, and contracts overflow". -Focus on the actual work done in the steps. ``` gh pr create --title "<YOUR_GENERATED_TITLE>" --body "{pr_body}" --head {directive_branch} --base {base_branch} @@ -1514,9 +1522,15 @@ Done — the PR already exists. git ls-remote --heads origin {pr_branch} ``` -4. If the branch exists, create the PR: +4. If the branch exists, generate a descriptive PR title and create the PR: + +Based on the branch name and directive "{title}", generate a descriptive PR title that summarizes the actual changes. The title should: +- Be concise (under 72 characters) +- Describe WHAT was done, not just the project name +- Use conventional commit style if appropriate (feat:, fix:, refactor:, etc.) + ``` -gh pr create --title "{title}" --body "Directive PR verification — auto-created" --head {pr_branch} --base {base_branch} +gh pr create --title "<YOUR_GENERATED_TITLE>" --body "Directive PR verification — auto-created" --head {pr_branch} --base {base_branch} ``` Then store the resulting URL: ``` @@ -1590,7 +1604,7 @@ pub fn build_order_pickup_prompt( Review them and create steps to fulfil them.\n\n"); for (i, order) in orders.iter().enumerate() { prompt.push_str(&format!( - " {}. [{}] [{}] {} \n orderId: {}\n", + " {}. [{}] [{}] {}\n orderId: {}\n", i + 1, order.priority, order.order_type, diff --git a/makima/src/server/handlers/directives.rs b/makima/src/server/handlers/directives.rs index cb59581..b4b438a 100644 --- a/makima/src/server/handlers/directives.rs +++ b/makima/src/server/handlers/directives.rs @@ -13,6 +13,7 @@ use crate::db::models::{ CreateDirectiveStepRequest, Directive, DirectiveListResponse, DirectiveStep, DirectiveWithSteps, PickUpOrdersResponse, UpdateDirectiveRequest, UpdateDirectiveStepRequest, UpdateGoalRequest, + UpdateOrderRequest, }; use crate::db::repository; use crate::orchestration::directive::build_order_pickup_prompt; |
