{% extends "dashboard/base.html" %} {% from "partials/_macros.html" import status_pill, pill, empty_state, info_toggle %} {% from "partials/_list_chrome.html" import list_controls, list_pagination %} {% from "partials/_charts.html" import sparkline %} {% block page %} {% call info_toggle(key='patterns', title="What is a pattern?") %}

A pattern is a small, reusable learning that sessions propose when they notice "we keep doing this" — e.g. "always run uv run pytest with --ignore=tests/test_dashboard.py in this repo". Patterns help future sessions skip rediscovery.

Patterns move proposedapproved (operator endorses) or rejected (operator disagrees). Approved patterns get surfaced to sessions working in the same workspace.

{% endcall %}
{% for s in ['proposed', 'approved', 'rejected', 'all'] %} {{ s }} {% endfor %}
{% set cat_opts = [('', 'All')] %} {% for c in category_options %}{% set _ = cat_opts.append((c, c)) %}{% endfor %} {{ list_controls( '/dashboard/patterns', search_value=search_value, search_placeholder='Search name / description / category…', filters=[ {'name': 'category', 'label': 'Category', 'value': category_filter, 'options': cat_opts}, ], per_page=per_page, ) }}
{% if patterns %} {% set _max = ((patterns | map(attribute='usage_count') | max) or 1) %} {% for p in patterns %} {% endfor %}
NameCategoryDescriptionStatusUsageRelative
{{ p.name }} {{ pill(p.category, tone='accent') }} {{ p.description }} {{ status_pill(p.status) }} {{ p.usage_count }}
{% else %} {{ empty_state( 'No patterns match the current filter', body='Patterns are proposed by sessions and approved by you. Try the `all` tab.', icon_name='layers' ) }} {% endif %}
{{ list_pagination( '/dashboard/patterns', page=page, per_page=per_page, total=total, search_value=search_value, filters=[{'name': 'category', 'value': category_filter}], extra_params={'status': status}, shown=patterns|length, ) }} {% endblock %}