feat: Implement recent chats feature with API endpoint and UI integration

This commit is contained in:
Andre Beging
2025-10-07 15:08:33 +02:00
parent 85094f8683
commit ddf29c1d36
7 changed files with 682 additions and 3 deletions

View File

@@ -53,6 +53,18 @@
</div>
</section>
<div class="helper-row">
<button
type="button"
id="recent-chats-btn"
class="secondary helper-button"
title="Authorize the session to view recent chats"
disabled
>
Browse recent chats
</button>
</div>
<section id="hooks-section" class="card">
<div class="section-header">
<h2>Hooks</h2>
@@ -144,6 +156,41 @@
</article>
</template>
<div
id="recent-chats-modal"
class="recent-chats-modal hidden"
role="dialog"
aria-modal="true"
aria-labelledby="recent-chats-title"
>
<div class="modal-card">
<div class="modal-header">
<h2 id="recent-chats-title">Recent chats</h2>
<button type="button" id="close-recent-chats" class="secondary icon-button modal-close" aria-label="Close recent chats">
<svg class="icon icon-close" viewBox="0 0 24 24" aria-hidden="true">
<path d="M18.3 5.71 12 12l6.3 6.29-1.41 1.42L10.59 13.4 4.3 19.71 2.89 18.3 9.17 12 2.89 5.71 4.3 4.3l6.3 6.29 6.29-6.3z" />
</svg>
<span class="sr-only">Close recent chats</span>
</button>
</div>
<p class="recent-chats-description">
These are your most recent Telegram chats. Review chat details or copy an ID to reuse it when creating a hook.
</p>
<div class="recent-chats-search-wrapper" role="search">
<label for="recent-chats-search" class="sr-only">Search recent chats</label>
<input
type="search"
id="recent-chats-search"
class="recent-chats-search"
placeholder="Search chats…"
autocomplete="off"
spellcheck="false"
/>
</div>
<div id="recent-chats-list" class="recent-chats-list" role="document"></div>
</div>
</div>
<footer>
<p>Need to trigger a message manually? Hit <span class="mono">GET /action/&lt;hook-id&gt;</span>.</p>
</footer>