HagiCode Fullstack

Filter und Summen hinzufügen

Draft: this lesson is an outline and will be expanded.

A list becomes useful when you can narrow it down and add it up. In this lesson you ask your AI assistant for two features: a filter, which shows only the items that match what you chose, and a total, which adds up the numbers. For a to-do list, use “done and not done” and “how many are left”.

What you will do

  1. Write each feature as a sentence that starts with “I can”. Example: “I can show only this week’s expenses.” Example: “I can see the total of what is on the screen.”
  2. Add the sentences to your done checklist.
  3. Ask the AI to add the filter first. Run the app and try it with enough items to see a difference.
  4. Check the filter on purpose with awkward cases: an empty list, an item that matches nothing, and an item right at the edge of the filter.
  5. Ask the AI to add the total. Work out the correct total yourself with a calculator for three items, and compare it with the app. Do not trust the AI’s arithmetic without checking it.
  6. Check that the total follows the filter, as your sentence says.
  7. Commit after each feature, with a message that names the feature.

Do one feature at a time. If you ask for both together and something breaks, you will not know which request caused it.

Check yourself

  • The filter shows exactly the items it should.
  • The total matches your own calculation.
  • You made two commits, one per feature.