{# ============================================ Help System Macros Reusable tooltip and help panel components ============================================ #} {# --------------------------------------------- TOOLTIP MACRO Wraps text with hover tooltip Parameters: - label: The visible text to display - tip: The tooltip text shown on hover - position: 'top' (default), 'right', 'left', 'bottom' --------------------------------------------- #} {% macro tooltip(label, tip, position='top') %} {{ label }} {%- endmacro %} {# --------------------------------------------- LABEL WITH TOOLTIP MACRO Renders a label where the text itself has a tooltip Parameters: - label_text: The label text (will have tooltip on hover) - tooltip_text: The tooltip text shown on hover - for_id: The ID of the input (for label's 'for' attribute) - position: Tooltip position --------------------------------------------- #} {% macro label_with_tooltip(label_text, tooltip_text, for_id=none, position='top') %} {{ tooltip(label_text, tooltip_text, position) }} {%- endmacro %} {# --------------------------------------------- HELP PANEL MACRO Renders a collapsible help panel Parameters: - panel_id: Unique ID for the panel - title: Panel title - icon: FontAwesome icon (default: 'question-circle') - collapsed: Start collapsed (default: true) - dismissible: Show "don't show again" option (default: false) Usage: {% call help_panel('research-how', 'How Research Works') %}

Your content here...

{% endcall %} --------------------------------------------- #} {% macro help_panel(panel_id, title, icon='question-circle', collapsed=true, dismissible=false) %} {%- endmacro %} {# --------------------------------------------- HELP STEP MACRO Renders a numbered step in a help panel Parameters: - num: Step number - title: Step title - description: Step description --------------------------------------------- #} {% macro help_step(num, title, description) %}
{{ num }}
{{ title }}

{{ description }}

{%- endmacro %} {# --------------------------------------------- HELP TIP MACRO Renders a tip/note callout Parameters: - text: The tip text (can include HTML) - variant: 'info' (default), 'warning' --------------------------------------------- #} {% macro help_tip(text, variant='info') %}
{{ text|safe }}
{%- endmacro %} {# --------------------------------------------- HELP CARD MACRO Renders a help card (for storage modes, etc.) Parameters: - title: Card title - description: Card description - icon: FontAwesome icon - variant: 'success', 'warning', 'neutral', 'info' --------------------------------------------- #} {% macro help_card(title, description, icon='circle', variant='neutral') %}
{{ title }}

{{ description }}

{%- endmacro %} {# --------------------------------------------- PRIVACY NOTE MACRO Renders a privacy assurance note Parameters: - text: The privacy note text --------------------------------------------- #} {% macro privacy_note(text='All data is stored locally on your device only.') %}
{{ text }}
{%- endmacro %} {# --------------------------------------------- GLOSSARY TERM MACRO Renders an inline term with tooltip definition Parameters: - term: The term to display - definition: The definition to show in tooltip --------------------------------------------- #} {% macro glossary_term(term, definition) %} {{ term }} {%- endmacro %} {# --------------------------------------------- KEYBOARD HINT MACRO Renders a keyboard shortcut hint Parameters: - keys: List of keys, e.g., ['Ctrl', 'Enter'] - description: What the shortcut does --------------------------------------------- #} {% macro keyboard_hint(keys, description='') %} {% for key in keys %} {{ key }}{% if not loop.last %}+{% endif %} {% endfor %} {% if description %} {{ description }}{% endif %} {%- endmacro %}