feat: add clickable activity cards with comment anchor links to profile tab

Add `url` field to profile activity items so post cards link to `/posts/{slug}` and comment cards link to the parent post with a `#comment-{uid}` anchor, matching notification click behavior. Include the shared `_card_link.html` overlay in the template, fix XP bar rendering for missing `xp` key, and add API + e2e tests verifying the link structure and navigation.
This commit is contained in:
2026-07-04 20:24:59 +00:00
parent c79dfd0291
commit 7002b23eeb
11 changed files with 213 additions and 13 deletions
+8 -3
View File
@@ -39,10 +39,10 @@
<div class="profile-level-bar">
<div class="level-label">
<span>Progress to next level</span>
<span>{{ profile_user.get('xp', 0) % 100 }}%</span>
<span>{{ (profile_user.get('xp') or 0) % 100 }}%</span>
</div>
<div class="bar">
<div class="bar-fill" style="--bar-pct: {{ profile_user.get('xp', 0) % 100 }}%;"></div>
<div class="bar-fill" style="--bar-pct: {{ (profile_user.get('xp') or 0) % 100 }}%;"></div>
</div>
</div>
@@ -637,7 +637,12 @@
{% endif %}
{% else %}
{% for act in activities %}
<div class="post-card activity-card">
<div class="post-card activity-card card-link-host">
{% if act['url'] %}
{% set _href = act['url'] %}
{% set _label = (act['type'] == 'post') and 'View post' or 'View comment on post' %}
{% include "_card_link.html" %}
{% endif %}
<div class="activity-row">
<span class="activity-icon">
{% if act['type'] == 'post' %}&#x1F4DD;{% else %}&#x1F4AC;{% endif %}