File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -6,6 +6,23 @@ Version 0.4.0
66
77To be released.
88
9+ ### @fedify/botkit
10+
11+ - Added a remote follow button to the web interface.
12+ [[ #10 ] , [ #14 ] by Hyeonseo Kim]
13+
14+ - Added a Follow button on the bot's profile page that allows users to
15+ follow the bot from their own fediverse instance without manual
16+ searching.
17+ - When clicked, the button opens a modal dialog where users can enter
18+ their fediverse handle (e.g., ` @username@instance.com ` ).
19+ - The feature uses WebFinger to discover the user's instance and
20+ automatically redirects to the appropriate follow page using the OStatus
21+ subscribe protocol.
22+
23+ [ #10 ] : https://github.com/fedify-dev/botkit/issues/10
24+ [ #14 ] : https://github.com/fedify-dev/botkit/pull/14
25+
926
1027Version 0.3.0
1128-------------
Original file line number Diff line number Diff line change 88 " temporal"
99 ],
1010 "imports" : {
11- "@fedify/fedify" : " jsr:@fedify/fedify@^1.8.8 " ,
11+ "@fedify/fedify" : " jsr:@fedify/fedify@1.9.0-dev.1516+8f42bff1 " ,
1212 "@logtape/logtape" : " jsr:@logtape/logtape@^1.0.4" ,
1313 "@std/fs" : " jsr:@std/fs@^1.0.19" ,
1414 "@std/path" : " jsr:@std/path@^1.1.1" ,
Original file line number Diff line number Diff line change 2323 "markdown-it" : " npm:markdown-it@^14.1.0" ,
2424 "mime-db" : " npm:mime-db@^1.54.0" ,
2525 "tsdown" : " npm:tsdown@^0.12.8" ,
26+ "url-template" : " npm:url-template@^3.1.1" ,
2627 "uuid" : " npm:uuid@^11.1.0" ,
2728 "xss" : " npm:xss@^1.0.15"
2829 },
Original file line number Diff line number Diff line change 9494 "html-entities" : " ^2.6.0" ,
9595 "markdown-it" : " ^14.1.0" ,
9696 "mime-db" : " ^1.54.0" ,
97+ "url-template" : " ^3.1.1" ,
9798 "uuid" : " ^11.1.0" ,
9899 "x-forwarded-fetch" : " catalog:" ,
99100 "xss" : " ^1.0.15"
Original file line number Diff line number Diff line change 1+ /** @jsxImportSource hono/jsx */
2+ import type { BotImpl } from "../bot-impl.ts" ;
3+
4+ export interface FollowButtonProps {
5+ readonly bot : BotImpl < unknown > ;
6+ }
7+
8+ export function FollowButton ( { bot } : FollowButtonProps ) {
9+ return (
10+ < >
11+ < button
12+ id = "follow-btn"
13+ type = "button"
14+ style = "padding: 0.5rem 1rem; background: var(--pico-primary); color: var(--pico-primary-inverse); border: none; border-radius: 0.25rem; cursor: pointer;"
15+ onclick = "showFollowModal()"
16+ >
17+ Follow
18+ </ button >
19+ < dialog id = "follow-modal" >
20+ < article style = "width: 400px;" >
21+ < header style = "display: flex; align-items: center; justify-content:space-between" >
22+ < h3 > Follow { bot . name ?? bot . username } </ h3 >
23+ < button
24+ aria-label = "Close"
25+ rel = "prev"
26+ type = "button"
27+ onclick = "closeFollowModal()"
28+ />
29+ </ header >
30+ < main >
31+ < p > Enter your fediverse handle to follow this account:</ p >
32+ < form action = "/follow" method = "post" >
33+ < input
34+ type = "text"
35+ id = "fediverse-handle"
36+ name = "handle"
37+ placeholder = "@username@instance.com"
38+ required
39+ style = "width: 100%; margin-bottom: 1rem;"
40+ />
41+ < button type = "submit" style = "width: 100%;" >
42+ Follow
43+ </ button >
44+ </ form >
45+ </ main >
46+ </ article >
47+ </ dialog >
48+ < script
49+ dangerouslySetInnerHTML = { {
50+ __html : `
51+ function showFollowModal() {
52+ document.getElementById('follow-modal').showModal();
53+ }
54+
55+ function closeFollowModal() {
56+ document.getElementById('follow-modal').close();
57+ }
58+ ` ,
59+ } }
60+ />
61+ </ >
62+ ) ;
63+ }
You can’t perform that action at this time.
0 commit comments