/** * Pull unread replies (used for badge count). */ export async function getUnreadCount( threadId: string, token: string ): Promise<number> const data = await authFetch( `https://api.f95zone.to/v1/threads/$threadId/replies?unread=true`, token ); return data.unreadCount ?? 0;

// store threadId for later updates await context.state.set("f95_thread_id", threadId); context.ui.notify(`Thread created: $url`);

/** * Simple markdown builder – you can replace this with a template engine. */ export function buildReleaseMarkdown(opts: version: string; changelog: string; downloadUrl: string; coverImgUrl?: string; ): string const version, changelog, downloadUrl, coverImgUrl = opts; return ` # $opts.version – New Release!

import createThread, appendComment, buildReleaseMarkdown, from "./f95Client";

$coverImgUrl ? `![Cover]($coverImgUrl)\n` : ""

if (!res.ok) const txt = await res.text(); throw new Error(`F95Zone error $res.status: $txt`); return res.json(); }

## Changelog $changelog `;

For developers who prefer a no‑code approach, the plugin can expose a “Generate markdown” button that copies the output to the clipboard, allowing manual posting if the API is unavailable. 7️⃣ UI Mock‑up (Textual Description) +--------------------------------------------------------------+ | JSK Studio – Bottom Panel | |--------------------------------------------------------------| | [F95Zone] Connect | Status: Connected as <username> | |--------------------------------------------------------------| | Game Title: <input> | Category: <dropdown> | | Version: <input> | Cover image: <preview + upload> | |--------------------------------------------------------------| | [Publish Build] [Sync Changelog] [View Thread] [Analytics]| |--------------------------------------------------------------| | Unread Replies: 3 (badge) | Views: 1,254 Likes: 87 | +--------------------------------------------------------------+ All controls are optional – the developer can enable only the parts they need. 8️⃣ Testing & QA Checklist | Test | Description | |------|-------------| | OAuth flow | Verify token retrieval, expiration handling, and revocation. | | Thread creation | Mock API response; ensure markdown is correctly escaped. | | Update comment | Confirm that only the new part of the changelog is added. | | Badge count | Simulate a new reply and confirm badge increments. | | Analytics | Use a fake stats endpoint and verify chart rendering. | | Error handling | Force 429/500 responses and verify exponential back‑off. | | Security | Run static analysis to ensure no token leaks in logs. | | Cross‑platform | Test on Windows/macOS/Linux installations of JSK Studio. | 9️⃣ Release Plan | Milestone | Scope | Approx. Effort | |-----------|-------|----------------| | MVP | OAuth, thread creation, markdown