File tree Expand file tree Collapse file tree 9 files changed +255
-68
lines changed Expand file tree Collapse file tree 9 files changed +255
-68
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,23 @@ Version 0.4.0
6
6
7
7
To be released.
8
8
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
+
9
26
10
27
Version 0.3.0
11
28
-------------
Original file line number Diff line number Diff line change 8
8
" temporal"
9
9
],
10
10
"imports" : {
11
- "@fedify/fedify" : " jsr:@fedify/fedify@^1.8.8 " ,
11
+ "@fedify/fedify" : " jsr:@fedify/fedify@1.9.0-dev.1516+8f42bff1 " ,
12
12
"@logtape/logtape" : " jsr:@logtape/logtape@^1.0.4" ,
13
13
"@std/fs" : " jsr:@std/fs@^1.0.19" ,
14
14
"@std/path" : " jsr:@std/path@^1.1.1" ,
Original file line number Diff line number Diff line change 23
23
"markdown-it" : " npm:markdown-it@^14.1.0" ,
24
24
"mime-db" : " npm:mime-db@^1.54.0" ,
25
25
"tsdown" : " npm:tsdown@^0.12.8" ,
26
+ "url-template" : " npm:url-template@^3.1.1" ,
26
27
"uuid" : " npm:uuid@^11.1.0" ,
27
28
"xss" : " npm:xss@^1.0.15"
28
29
},
Original file line number Diff line number Diff line change 94
94
"html-entities" : " ^2.6.0" ,
95
95
"markdown-it" : " ^14.1.0" ,
96
96
"mime-db" : " ^1.54.0" ,
97
+ "url-template" : " ^3.1.1" ,
97
98
"uuid" : " ^11.1.0" ,
98
99
"x-forwarded-fetch" : " catalog:" ,
99
100
"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