Skip to content

Add static task categories with default Medium and badge rendering - #26

Open
rtraidcleverit with Copilot wants to merge 6 commits into
mainfrom
copilot/fr-01-categorizacion-estatica-tareas
Open

Add static task categories with default Medium and badge rendering#26
rtraidcleverit with Copilot wants to merge 6 commits into
mainfrom
copilot/fr-01-categorizacion-estatica-tareas

Conversation

Copilot AI commented May 28, 2026

Copy link
Copy Markdown

This PR implements FR-01 by adding predefined task categories (High, Medium, Low) at task creation time, defaulting to Medium when omitted or invalid. It also surfaces the category in the task list as a badge under each task title.

  • Frontend: task creation + category UX

    • Added category selector to the create-task form (High|Medium|Low) with Medium preselected.
    • Sends category with create requests.
    • Uses a shared DEFAULT_CATEGORY constant to avoid category drift.
  • Frontend: task list rendering

    • Renders category badge below task title (category-high, category-medium, category-low).
    • Switched task item rendering from interpolated innerHTML to DOM node construction for user-provided fields.
    • Added accessible action labels, including state-aware complete/incomplete labeling.
  • Backend: category normalization + input constraints

    • Added centralized category normalization (normalizeCategory) for create/update flows.
    • Persists category on create; preserves valid values and falls back to Medium otherwise.
    • Added non-empty trimmed title validation for create and update; update now trims title before persisting.
  • Styling

    • Added category badge styles and improved contrast for category text.
    • Reduced duplicated input/select styling rules.
// backend/controllers/tasksController.js
const VALID_CATEGORIES = ['High', 'Medium', 'Low'];

function normalizeCategory(category) {
  return VALID_CATEGORIES.includes(category) ? category : 'Medium';
}

const { title, category = 'Medium' } = req.body;
if (typeof title !== 'string' || title.trim() === '') {
  return res.status(400).json({ message: 'Title is required and cannot be empty' });
}

const newTask = {
  id: uuidv4(),
  title: title.trim(),
  category: normalizeCategory(category)
};
Original prompt

Funcionalidad: Categorización Estática de Tareas (FR-01)
Descripción: Permitir al usuario asignar una categoría predefinida a cada tarea al momento de su creación. Utiliza las categorías (High, Medium y Low), muéstralas como un badge debajo del título y si no se selecciona una categoría, utiliza médium por defecto.

[Chronological Review: The conversation began with a user request to analyze the project structure and execute necessary commands to run the application using Docker Compose. Following this, the user specified a functionality requirement for static task categorization, detailing how tasks should be assigned predefined categories (High, Medium, Low) with a default of Medium if none is selected.]

[Intent Mapping:

  1. "Analiza la estructura del proyecto y ejecuta los comandos necesarios para levantar la aplicación utilizando Docker Compose." - User wants to analyze the project structure and run the application with Docker Compose.
  2. "Funcionalidad: Categorización Estática de Tareas (FR-01)" - User specifies a feature requirement for task categorization with details on how it should function.]

[Technical Inventory:

  • Docker Compose: Tool for defining and running multi-container Docker applications.
  • Static Task Categorization: Feature involving predefined categories for tasks, with specific UI requirements for displaying these categories.]

[Code Archaeology: No specific files or code changes were discussed yet, but the feature request implies potential modifications to task management components.]

[Progress Assessment:

  • Completed Tasks: None yet, as the conversation is still in the planning phase.
  • Partially Complete Work: The analysis of the project structure and the feature specification for task categorization are in progress.]

[Context Validation: All necessary context for continuing the work on Docker Compose setup and task categorization feature is captured.]

[Recent Commands Analysis:

  • Last Agent Commands: The user requested an analysis of the project structure and execution of Docker Compose commands.
  • Tool Results Summary: No tool results were returned yet as the commands have not been executed.
  • Pre-Summary State: The agent was preparing to analyze the project structure and implement the Docker Compose commands when the token budget was exceeded.
  • Operation Context: These commands are essential for setting up the development environment and ensuring the application runs correctly, which aligns with the user's goal of implementing the task categorization feature.]
1. Conversation Overview: - Primary Objectives: - "Analiza la estructura del proyecto y ejecuta los comandos necesarios para levantar la aplicación utilizando Docker Compose." - "Funcionalidad: Categorización Estática de Tareas (FR-01)" - User aims to implement a feature for categorizing tasks. - Session Context: The conversation has focused on setting up the application environment and defining a new feature for task management. - User Intent Evolution: The user started with a technical setup request and then moved to a specific feature requirement.
  1. Technical Foundation:
  • Docker Compose: Tool for managing multi-container Docker applications, essential for running the application.
  • Static Task Categorization: Feature requiring UI elements for task categorization with specific default behaviors.
  1. Codebase Status:
  • No specific files or code changes have been discussed yet, but the task categorization feature will likely involve modifications to task-related components.
  1. Problem Resolution:
  • Issues Encountered: None reported yet as the setup and feature implementation are still in the planning phase.
  • Solutions Implemented: No solutions have been implemented yet.
  • Debugging Context: No debugging efforts have been initiated.
  • Lessons Learned: Insights will emerge as the project progresses.
  1. Progress Tracking:
  • Completed Tasks: None completed yet.
  • Partially Complete Work: Analysis of project structure and feature specification for task categorization are ongoing.
  1. Active Work State:
  • Current Focus: Analyzing the project structure and preparing to execute Docker Compose commands.
  • Recent Context: The user has requested to analyze the project and implement a feature for task categorization.
  • Working Code: No specific code snippets have been discussed yet.
  • Immediate Context: The agent was preparing to execute commands related to Docker Compose when the token budget was exceeded.
  1. Recent Operations:
  • Last Agent Commands: User requested analysis of the project structure and execution of Docker Compose commands.
  • Tool Results Summary: No results returned yet as commands have not been executed.
  • Pre-Summary State: The agent was actively preparing for project analysis and Docker setup.
  • Operation Context: These commands are crucial for establishing the development environment and supporting the task categorization feature.
  1. Continuation Plan:
    ...

Created from VS Code.

Copilot AI changed the title [WIP] Add functionality for static task categorization Add static task categories with default Medium and badge rendering May 28, 2026
Copilot AI requested a review from rtraidcleverit May 28, 2026 20:36
@rtraidcleverit
rtraidcleverit marked this pull request as ready for review May 28, 2026 20:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants