From 5af136b5f01899d8f5d87b9e08267e95b798c97e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:14 +0530 Subject: [PATCH 001/115] feat(profile): add local coding stats tracker and profile page --- src/lib/profileStats.js | 186 ++++++++++++++ src/pages/profile/index.js | 15 ++ src/pages/profile/profile.js | 453 +++++++++++++++++++++++++++++++++ src/pages/profile/profile.scss | 336 ++++++++++++++++++++++++ 4 files changed, 990 insertions(+) create mode 100644 src/lib/profileStats.js create mode 100644 src/pages/profile/index.js create mode 100644 src/pages/profile/profile.js create mode 100644 src/pages/profile/profile.scss diff --git a/src/lib/profileStats.js b/src/lib/profileStats.js new file mode 100644 index 0000000000..94f9f41fa8 --- /dev/null +++ b/src/lib/profileStats.js @@ -0,0 +1,186 @@ +/** + * Lightweight, on-device coding stats used by the profile page. + * Nothing here leaves the device: everything lives in localStorage. + */ + +const KEY = "acodeProfileStats"; +const FLUSH_MS = 30_000; +const MAX_DELTA_MS = 10 * 60_000; +const KEEP_DAYS = 120; +const ACTIVE_DAY_MS = 60_000; +const DAY_LABELS = ["S", "M", "T", "W", "T", "F", "S"]; + +let state = null; +let inited = false; +let foregroundSince = 0; + +function dayKey(date = new Date()) { + const y = date.getFullYear(); + const m = String(date.getMonth() + 1).padStart(2, "0"); + const d = String(date.getDate()).padStart(2, "0"); + return `${y}-${m}-${d}`; +} + +function emptyState() { + return { + launches: 0, + totalMs: 0, + saves: 0, + firstSeen: Date.now(), + days: {}, + }; +} + +function load() { + try { + const parsed = JSON.parse(localStorage.getItem(KEY)); + if (parsed && typeof parsed === "object") { + const merged = { ...emptyState(), ...parsed }; + if (!merged.days || typeof merged.days !== "object") merged.days = {}; + return merged; + } + } catch {} + return emptyState(); +} + +function ensure() { + if (!state) state = load(); + return state; +} + +function today() { + const s = ensure(); + const key = dayKey(); + if (!s.days[key]) s.days[key] = { ms: 0, saves: 0 }; + return s.days[key]; +} + +function persist() { + const s = ensure(); + const cutoff = Date.now() - KEEP_DAYS * 86_400_000; + for (const key of Object.keys(s.days)) { + const time = new Date(`${key}T00:00:00`).getTime(); + if (Number.isFinite(time) && time < cutoff) delete s.days[key]; + } + try { + localStorage.setItem(KEY, JSON.stringify(s)); + } catch {} +} + +function flush() { + if (!foregroundSince) return; + const now = Date.now(); + const delta = Math.min(Math.max(now - foregroundSince, 0), MAX_DELTA_MS); + foregroundSince = now; + if (!delta) return; + const s = ensure(); + s.totalMs += delta; + today().ms += delta; + persist(); +} + +function resume() { + if (!foregroundSince) foregroundSince = Date.now(); +} + +function pause() { + flush(); + foregroundSince = 0; +} + +function onSave() { + const s = ensure(); + s.saves += 1; + today().saves += 1; + persist(); +} + +function hookSaves() { + let tries = 0; + const timer = setInterval(() => { + tries += 1; + const manager = window.editorManager; + if (manager && typeof manager.on === "function") { + clearInterval(timer); + manager.on("save-file", onSave); + } else if (tries > 60) { + clearInterval(timer); + } + }, 1000); +} + +function isActive(day) { + return !!day && (day.ms >= ACTIVE_DAY_MS || day.saves > 0); +} + +const profileStats = { + /** Start tracking. Safe to call more than once. */ + init() { + if (inited) return; + inited = true; + + const s = ensure(); + s.launches += 1; + persist(); + + if (!document.hidden) resume(); + document.addEventListener("visibilitychange", () => { + if (document.hidden) pause(); + else resume(); + }); + document.addEventListener("pause", pause); + document.addEventListener("resume", resume); + setInterval(flush, FLUSH_MS); + hookSaves(); + }, + + /** Snapshot of the numbers shown on the profile page. */ + getStats() { + const s = ensure(); + flush(); + + const now = new Date(); + const week = []; + for (let i = 6; i >= 0; i--) { + const date = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i); + const key = dayKey(date); + const day = s.days[key] || { ms: 0, saves: 0 }; + week.push({ + key, + label: DAY_LABELS[date.getDay()], + ms: day.ms, + saves: day.saves, + isToday: i === 0, + }); + } + + // Streak: consecutive active days ending today (or yesterday). + let streak = 0; + for (let i = 0; i < KEEP_DAYS; i++) { + const date = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i); + const active = isActive(s.days[dayKey(date)]); + if (active) streak += 1; + else if (i > 0) break; + } + + return { + totalMs: s.totalMs, + saves: s.saves, + launches: s.launches, + firstSeen: s.firstSeen, + streak, + week, + weekMs: week.reduce((sum, d) => sum + d.ms, 0), + weekSaves: week.reduce((sum, d) => sum + d.saves, 0), + }; + }, + + /** Wipe all tracked stats. */ + reset() { + state = emptyState(); + state.launches = 1; + persist(); + }, +}; + +export default profileStats; diff --git a/src/pages/profile/index.js b/src/pages/profile/index.js new file mode 100644 index 0000000000..6023b0eb5a --- /dev/null +++ b/src/pages/profile/index.js @@ -0,0 +1,15 @@ +//jshint ignore:start + +/** + * Open the profile page. + * @param {object} options + * @param {object} options.user - logged in user + * @param {() => Promise} [options.getAvatarSrc] + * @param {() => Promise} [options.onLogout] + */ +function Profile(options) { + return import(/* webpackChunkName: "profile" */ "./profile").then((res) => { + return res.default(options); + }); +} +export default Profile; diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js new file mode 100644 index 0000000000..50a59254e2 --- /dev/null +++ b/src/pages/profile/profile.js @@ -0,0 +1,453 @@ +import "./profile.scss"; +import fsOperation from "fileSystem"; +import Page from "components/page"; +import Sidebar from "components/sidebar"; +import confirm from "dialogs/confirm"; +import actionStack from "lib/actionStack"; +import config from "lib/config"; +import { LOADED_PLUGINS } from "lib/loadPlugins"; +import openFile from "lib/openFile"; +import openFolder from "lib/openFolder"; +import profileStats from "lib/profileStats"; +import recents from "lib/recents"; +import helpers from "utils/helpers"; +import Uri from "utils/Uri"; +import Url from "utils/Url"; + +/* Feather-style stroke icons, so the page never depends on the icon font. */ +const ICONS = { + clock: + '', + zap: '', + save: '', + activity: '', + layers: + '', + package: + '', + file: '', + folder: + '', + sliders: + '', + contrast: + '', + info: '', + external: + '', + logout: + '', + chevron: '', + link: '', + verified: + '', + calendar: + '', + trash: + '', +}; + +function icon(name, size = 20) { + const el = document.createElement("span"); + el.className = "pf-icon"; + el.innerHTML = ``; + return el; +} + +function formatDuration(ms) { + const mins = Math.floor(ms / 60000); + if (mins < 1) return ms >= 1000 ? "<1m" : "0m"; + const h = Math.floor(mins / 60); + const m = mins % 60; + if (h >= 100) return `${h}h`; + return h ? `${h}h ${m}m` : `${m}m`; +} + +function formatMonthYear(value) { + const date = new Date(value); + if (Number.isNaN(date.getTime())) return ""; + return date.toLocaleDateString(undefined, { month: "short", year: "numeric" }); +} + +/** Same path breakdown the "recent" picker uses. */ +function pathDetails(url) { + url = Url.parse(url).url; + const isSafUri = /^content:/.test(url); + const displayPath = isSafUri + ? Uri.getDisplayPath(url) + : helpers.getVirtualPath(url); + const documentPath = isSafUri ? Uri.getDisplayPath(url, []) : displayPath; + const name = Url.basename(displayPath) || Url.basename(documentPath) || url; + const location = + Url.dirname(isSafUri ? documentPath : displayPath)?.replace(/\/$/, "") || + "/"; + return { name, location }; +} + +function section(title, trailing) { + const $body =
; + const $head = ( +
+

{title}

+
+ ); + if (trailing) $head.append(trailing); + const $el = ( +
+ {$head} + {$body} +
+ ); + return { $el, $body }; +} + +function row({ iconName, title, subtitle, onclick, danger = false, end }) { + const $text = ( +
+
{title}
+
+ ); + if (subtitle) { + $text.append(
{subtitle}
); + } + const $row = ( +
+
{icon(iconName)}
+ {$text} +
+ ); + $row.append(end || icon("chevron", 18)); + return $row; +} + +function statCard(className, label, iconName) { + return ( +
+
{icon(iconName, 18)}
+
–
+
{label}
+
+ ); +} + +/** + * Open the profile page. + * @param {object} options + * @param {object} options.user + * @param {() => Promise} [options.getAvatarSrc] + * @param {() => Promise} [options.onLogout] + */ +export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { + if (!user) return; + + const $page = Page("Profile"); + $page.classList.add("profile-page"); + + const close = () => { + $page.hide(); + Sidebar.hide(); + }; + const goto = (fn) => () => { + close(); + setTimeout(() => { + try { + fn(); + } catch (error) { + helpers.error(error); + } + }, 200); + }; + const openUrl = (url) => () => system.openInBrowser(url); + + /* ---------- hero ---------- */ + const initial = (user.name || user.email || "?").trim().charAt(0).toUpperCase(); + const $avatarImg = ; + const $avatar = ( +
+ {initial} + {$avatarImg} +
+ ); + $avatarImg.onload = () => $avatar.classList.add("loaded"); + if (typeof getAvatarSrc === "function") { + Promise.resolve(getAvatarSrc()) + .then((src) => { + if (src) $avatarImg.src = src; + }) + .catch(() => {}); + } + + const $nameRow = ( +
+

{user.name}

+
+ ); + if (user.verified) { + const $v = ; + $v.append(icon("verified", 18)); + $nameRow.append($v); + } + if (user.acode_pro) { + $nameRow.append(PRO); + } + if (user.isAdmin) { + $nameRow.append(ADMIN); + } + + const $chips =
; + const since = formatMonthYear(user.created_at); + if (since) { + const $c =
; + $c.append(icon("calendar", 14), `Member since ${since}`); + $chips.append($c); + } + if (user.github) { + const $c = ( +
+ ); + $c.append(icon("link", 14), `@${user.github}`); + $chips.append($c); + } + if (user.website) { + const site = String(user.website); + const $c = ( +
+ ); + $c.append(icon("external", 14), site.replace(/^https?:\/\//, "")); + $chips.append($c); + } + + const $hero = ( +
+ {$avatar} + {$nameRow} +
{user.email || ""}
+ {$chips} +
+ ); + + /* ---------- stats ---------- */ + const $grid = ( +
+ {statCard("stat-time", "Coding time", "clock")} + {statCard("stat-streak", "Day streak", "zap")} + {statCard("stat-saves", "Files saved", "save")} + {statCard("stat-launches", "App launches", "activity")} + {statCard("stat-tabs", "Open files", "layers")} + {statCard("stat-plugins", "Plugins", "package")} +
+ ); + + const $chart =
; + const $chartNote =
; + const activity = section("Last 7 days"); + activity.$body.append($chart, $chartNote); + + /* ---------- recents ---------- */ + const recent = section("Jump back in"); + const recentFiles = recents.files.filter(Boolean).slice(0, 5); + const recentFolders = recents.folders.filter((f) => f?.url).slice(0, 3); + + for (const file of recentFiles) { + const { name, location } = pathDetails(file); + recent.$body.append( + row({ + iconName: "file", + title: name, + subtitle: location, + onclick: goto(() => + Promise.resolve(openFile(file, { render: true })).catch((err) => + helpers.error(err), + ), + ), + }), + ); + } + for (const folder of recentFolders) { + const { name, location } = pathDetails(folder.url); + recent.$body.append( + row({ + iconName: "folder", + title: name, + subtitle: location, + onclick: goto(() => openFolder(folder.url, folder.opts)), + }), + ); + } + if (!recentFiles.length && !recentFolders.length) { + recent.$body.append( +
Files and folders you open will show up here.
, + ); + } + + /* ---------- quick actions ---------- */ + const actions = section("Quick actions"); + const actionRows = [ + { + iconName: "package", + title: "Plugins", + subtitle: "Browse and manage extensions", + onclick: goto(async () => + (await import(/* webpackChunkName: "plugins" */ "pages/plugins")).default(), + ), + }, + { + iconName: "sliders", + title: "Settings", + subtitle: "Editor, app and file preferences", + onclick: goto(async () => + ( + await import( + /* webpackChunkName: "mainSettings" */ "settings/mainSettings" + ) + ).default(), + ), + }, + { + iconName: "contrast", + title: "App theme", + subtitle: "Switch the look of Acode", + onclick: goto(async () => + ( + await import( + /* webpackChunkName: "changeTheme" */ "palettes/changeTheme" + ) + ).default("app"), + ), + }, + { + iconName: "folder", + title: "Open folder", + subtitle: "Add a project to the sidebar", + onclick: goto(() => acode.exec("open-folder")), + }, + { + iconName: "external", + title: "Acode account", + subtitle: String(config.BASE_URL || "").replace(/^https?:\/\//, ""), + onclick: openUrl(config.BASE_URL), + }, + { + iconName: "info", + title: "About", + subtitle: `Version ${window.BuildInfo?.version || ""}`.trim(), + onclick: goto(async () => + (await import(/* webpackChunkName: "about" */ "pages/about")).default(), + ), + }, + ]; + for (const item of actionRows) actions.$body.append(row(item)); + + /* ---------- danger zone ---------- */ + const $logout = ( +
+ {row({ + iconName: "logout", + title: strings.logout || "Logout", + danger: true, + end: , + onclick: async () => { + const ok = await confirm( + strings.logout || "Logout", + "Are you sure you want to log out of your Acode account?", + ); + if (!ok) return; + const success = onLogout ? await onLogout() : true; + if (success !== false) $page.hide(); + }, + })} + {row({ + iconName: "trash", + title: "Reset coding stats", + subtitle: "Clears the numbers above on this device", + danger: true, + end: , + onclick: async () => { + const ok = await confirm( + "Reset stats", + "This clears your coding time, streak and save counts on this device.", + ); + if (!ok) return; + profileStats.reset(); + fillStats(); + }, + })} +
+ ); + + const $main = ( +
+ {$hero} + {$grid} + {activity.$el} + {recent.$el} + {actions.$el} + {$logout} +
+ ); + + /* ---------- data ---------- */ + const setText = (selector, text) => { + const $el = $main.querySelector(selector); + if ($el) $el.textContent = text; + }; + + function fillStats() { + const s = profileStats.getStats(); + setText(".stat-time", formatDuration(s.totalMs)); + setText(".stat-streak", `${s.streak}d`); + setText(".stat-saves", String(s.saves)); + setText(".stat-launches", String(s.launches)); + setText(".stat-tabs", String(window.editorManager?.files?.length ?? 0)); + + const max = Math.max(...s.week.map((d) => d.ms), 1); + $chart.textContent = ""; + for (const day of s.week) { + const pct = day.ms > 0 ? Math.max((day.ms / max) * 100, 8) : 0; + const $bar =
; + $bar.style.height = `${pct}%`; + const $col = ( +
+
{$bar}
+
{day.label}
+
+ ); + $chart.append($col); + } + $chartNote.textContent = `${formatDuration(s.weekMs)} coding · ${s.weekSaves} saves this week. Tracked on this device only.`; + } + + async function fillPlugins() { + let total = LOADED_PLUGINS.size; + try { + const list = await fsOperation(PLUGIN_DIR).lsDir(); + total = list.length; + } catch {} + setText(".stat-plugins", String(total)); + } + + fillStats(); + fillPlugins(); + + $page.body = $main; + + actionStack.push({ + id: "profile", + action: $page.hide, + }); + + $page.onhide = function () { + actionStack.remove("profile"); + }; + + app.append($page); +} diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss new file mode 100644 index 0000000000..37d5f46a8e --- /dev/null +++ b/src/pages/profile/profile.scss @@ -0,0 +1,336 @@ +#profile-page { + --pf-accent: var(--active-color, #3b82f6); + --pf-muted: color-mix(in srgb, var(--primary-text-color) 60%, transparent); + --pf-card: color-mix(in srgb, var(--popup-background-color) 30%, transparent); + --pf-card-hover: color-mix(in srgb, var(--popup-background-color) 55%, transparent); + --pf-border: var(--border-color, rgba(255, 255, 255, 0.08)); + --pf-danger: var(--danger-color, #ff5c5c); + + box-sizing: border-box; + width: 100%; + max-width: 560px; + margin: 0 auto; + padding: 16px 16px 40px; + display: flex; + flex-direction: column; + gap: 20px; + overflow-y: auto; + color: var(--primary-text-color); + + .pf-icon { + display: inline-flex; + align-items: center; + justify-content: center; + flex-shrink: 0; + } + + /* ---------- hero ---------- */ + .pf-hero { + display: flex; + flex-direction: column; + align-items: center; + text-align: center; + gap: 6px; + padding: 28px 16px 20px; + border-radius: 20px; + border: 1px solid var(--pf-border); + background: + radial-gradient(120% 90% at 50% 0%, + color-mix(in srgb, var(--pf-accent) 28%, transparent), + transparent 70%), + var(--pf-card); + } + + .pf-avatar { + position: relative; + width: 92px; + height: 92px; + border-radius: 50%; + margin-bottom: 8px; + overflow: hidden; + display: flex; + align-items: center; + justify-content: center; + background: color-mix(in srgb, var(--pf-accent) 35%, var(--popup-background-color)); + box-shadow: + 0 0 0 3px var(--pf-accent), + 0 8px 24px rgba(0, 0, 0, 0.3); + + .pf-avatar-initial { + font-size: 38px; + font-weight: 600; + color: var(--popup-text-color, var(--primary-text-color)); + } + + .pf-avatar-img { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + object-fit: cover; + opacity: 0; + transition: opacity 0.25s ease; + } + + &.loaded { + .pf-avatar-img { opacity: 1; } + .pf-avatar-initial { display: none; } + } + } + + .pf-name-row { + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; + gap: 8px; + } + + .pf-name { + margin: 0; + font-size: 22px; + font-weight: 600; + line-height: 1.2; + word-break: break-word; + } + + .pf-verified { + display: inline-flex; + color: var(--pf-accent); + } + + .pf-badge { + padding: 2px 8px; + border-radius: 999px; + font-size: 11px; + font-weight: 600; + letter-spacing: 0.06em; + color: var(--pf-muted); + border: 1px solid var(--pf-border); + + &.pro { + color: #1b1300; + border-color: transparent; + background: linear-gradient(135deg, #ffd45e, #ffa63d); + } + } + + .pf-email { + font-size: 14px; + color: var(--pf-muted); + word-break: break-all; + } + + .pf-chips { + display: flex; + flex-wrap: wrap; + justify-content: center; + gap: 8px; + margin-top: 10px; + } + + .pf-chip { + display: inline-flex; + align-items: center; + gap: 6px; + padding: 6px 12px; + border-radius: 999px; + font-size: 12.5px; + color: var(--primary-text-color); + background: color-mix(in srgb, var(--primary-text-color) 8%, transparent); + + &.tap:active { + background: color-mix(in srgb, var(--pf-accent) 30%, transparent); + } + } + + /* ---------- stats grid ---------- */ + .pf-grid { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 10px; + } + + .pf-stat { + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 2px; + min-width: 0; + padding: 12px; + border-radius: 14px; + border: 1px solid var(--pf-border); + background: var(--pf-card); + + .pf-stat-icon { + display: inline-flex; + margin-bottom: 6px; + padding: 6px; + border-radius: 10px; + color: var(--pf-accent); + background: color-mix(in srgb, var(--pf-accent) 16%, transparent); + } + + .pf-stat-value { + font-size: 19px; + font-weight: 600; + line-height: 1.2; + max-width: 100%; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .pf-stat-label { + font-size: 11.5px; + color: var(--pf-muted); + } + } + + /* ---------- sections ---------- */ + .pf-section { + display: flex; + flex-direction: column; + gap: 8px; + } + + .pf-section-head { + display: flex; + align-items: center; + justify-content: space-between; + padding: 0 4px; + } + + .pf-section-title { + margin: 0; + font-size: 12px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 0.08em; + color: var(--pf-muted); + } + + .pf-card { + display: flex; + flex-direction: column; + border-radius: 16px; + border: 1px solid var(--pf-border); + background: var(--pf-card); + overflow: hidden; + } + + /* ---------- chart ---------- */ + .pf-chart { + display: flex; + align-items: stretch; + gap: 8px; + height: 120px; + padding: 16px 16px 8px; + } + + .pf-bar-col { + flex: 1; + display: flex; + flex-direction: column; + align-items: center; + gap: 6px; + min-width: 0; + + .pf-bar-track { + flex: 1; + width: 100%; + max-width: 30px; + display: flex; + align-items: flex-end; + border-radius: 8px; + background: color-mix(in srgb, var(--primary-text-color) 6%, transparent); + } + + .pf-bar { + width: 100%; + border-radius: 8px; + background: color-mix(in srgb, var(--pf-accent) 55%, transparent); + transition: height 0.4s ease; + } + + .pf-bar-label { + font-size: 11px; + color: var(--pf-muted); + } + + &.today { + .pf-bar { background: var(--pf-accent); } + .pf-bar-label { color: var(--primary-text-color); font-weight: 600; } + } + } + + .pf-note { + padding: 4px 16px 14px; + font-size: 12px; + color: var(--pf-muted); + } + + /* ---------- rows ---------- */ + .pf-row { + display: flex; + align-items: center; + gap: 12px; + padding: 12px 14px; + border-bottom: 1px solid var(--pf-border); + color: var(--primary-text-color); + transition: background 0.15s ease; + + &:last-child { border-bottom: none; } + &:active { background: var(--pf-card-hover); } + + > .pf-icon:last-child { color: var(--pf-muted); } + + .pf-row-icon { + display: inline-flex; + padding: 8px; + border-radius: 10px; + color: var(--pf-accent); + background: color-mix(in srgb, var(--pf-accent) 14%, transparent); + } + + .pf-row-text { + flex: 1; + min-width: 0; + } + + .pf-row-title { + font-size: 15px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + .pf-row-sub { + margin-top: 2px; + font-size: 12.5px; + color: var(--pf-muted); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + + &.danger { + .pf-row-title { color: var(--pf-danger); } + .pf-row-icon { + color: var(--pf-danger); + background: color-mix(in srgb, var(--pf-danger) 14%, transparent); + } + } + } + + .pf-empty { + padding: 18px 16px; + font-size: 13.5px; + text-align: center; + color: var(--pf-muted); + } + + @media (max-width: 340px) { + .pf-grid { grid-template-columns: repeat(2, 1fr); } + } +} From 8d88d1b54eeb7847283d3e7c38c25d659e617c6d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:21 +0530 Subject: [PATCH 002/115] Import profileStats so the sidebar can start tracking on app launch --- src/components/sidebar/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 7a862d8dc4..124e1b9168 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -7,6 +7,7 @@ import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; import auth, { loginEvents } from "lib/auth"; import config from "lib/config"; +import profileStats from "lib/profileStats"; import helpers from "utils/helpers"; import Url from "utils/Url"; From b461d181413cab6cee3b95b2164e05d03221d15c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:27 +0530 Subject: [PATCH 003/115] Drop the old user context menu ref --- src/components/sidebar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 124e1b9168..c69f73cf62 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -43,7 +43,6 @@ function create($container, $toggler) { const MAX_WIDTH = () => innerWidth * 0.7; //Max width of the side bar const resizeBar = Ref(); const userAvatar = Ref(); - const userContextMenu = Ref(); $container = $container || app; let mode = innerWidth > 750 ? "tab" : "phone"; From a5da65d744e7eb3cb2b4f4650cc19cd28ee865d9 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:34 +0530 Subject: [PATCH 004/115] Remove the small popup markup, replaced by the profile page --- src/components/sidebar/index.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index c69f73cf62..3bb45226c6 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -67,18 +67,6 @@ function create($container, $toggler) { onmousedown={onresize} ontouchstart={onresize} > - -
-
-
-
-
- {/*
*/} -
- - {strings.logout} -
-
); const mask = ; From d206b9e1fe20b4d9040d4a11a97b2a4167012442 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:47 +0530 Subject: [PATCH 005/115] Open the new profile page on avatar tap; make logout reusable from the page --- src/components/sidebar/index.js | 64 ++++++++++++--------------------- 1 file changed, 22 insertions(+), 42 deletions(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 3bb45226c6..4b2276998a 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -119,35 +119,15 @@ function create($container, $toggler) { } } - const menu = userContextMenu.el; - const isActive = menu.classList.toggle("active"); - - if (isActive) { - const menuName = userContextMenu.el.querySelector(".user-menu-name"); - const menuEmail = userContextMenu.el.querySelector(".user-menu-email"); - - if (menuName) { - menuName.content = ( -
- {user.name} - {Boolean(user.verified) && ( - - )} - {Boolean(user.acode_pro) && Pro} -
- ); - } - - if (menuEmail) { - menuEmail.textContent = user.email || ""; - } - - setTimeout(() => { - document.addEventListener("click", handleClickOutside); - }, 10); - } else { - document.removeEventListener("click", handleClickOutside); - } + loader.destroy(); + const { default: openProfile } = await import( + /* webpackChunkName: "profile" */ "pages/profile" + ); + await openProfile({ + user, + getAvatarSrc: () => getAvatarSrc(user), + onLogout: handleLogout, + }); } catch (error) { console.error("Error checking login status:", error); } finally { @@ -155,17 +135,17 @@ function create($container, $toggler) { } } - function handleClickOutside(e) { - if ( - !userContextMenu.el.contains(e.target) && - e.target !== userAvatar.el && - !userAvatar.el.contains(e.target) - ) { - userContextMenu.el.classList.remove("active"); - document.removeEventListener("click", handleClickOutside); - } + async function getAvatarSrc(user) { + const avatarFile = await getUserAvatar(user).catch(() => null); + return avatarFile + ? await helpers.toInternalUri(avatarFile) + : generateInitialsAvatar(user.name || user.email || "?"); } + /** + * Logs the user out. Used by the profile page. + * @returns {Promise} + */ async function handleLogout() { loader.create(strings["logout"], strings["loading..."]); loader.show(); @@ -173,8 +153,6 @@ function create($container, $toggler) { const user = await auth.getLoggedInUser(); const success = await auth.logout(); if (success) { - userContextMenu.el.classList.remove("active"); - document.removeEventListener("click", handleClickOutside); updateSidebarAvatar(); toast("Logged out successfully"); @@ -184,11 +162,13 @@ function create($container, $toggler) { await fsOperation(avatarFile).delete(); } } catch {} - } else { - toast("Failed to logout"); + return true; } + toast("Failed to logout"); + return false; } catch (error) { console.error("Error during logout:", error); + return false; } finally { loader.destroy(); } From 5819845c3c8cc6dd9f8e70a04ec64483a5bc9f82 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:31:54 +0530 Subject: [PATCH 006/115] Start the on-device coding stats tracker when the sidebar is created --- src/components/sidebar/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 4b2276998a..01fe81299e 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -94,6 +94,7 @@ function create($container, $toggler) { } loginEvents.addListener(updateSidebarAvatar); + profileStats.init(); async function handleUserIconClick(e) { try { From c9ec8b72c42883601eceafd435315360ae9a40d5 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:34:45 +0530 Subject: [PATCH 007/115] Biome formatting: wrap long Date constructor (week loop) --- src/lib/profileStats.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/profileStats.js b/src/lib/profileStats.js index 94f9f41fa8..70d1f6b23d 100644 --- a/src/lib/profileStats.js +++ b/src/lib/profileStats.js @@ -142,7 +142,11 @@ const profileStats = { const now = new Date(); const week = []; for (let i = 6; i >= 0; i--) { - const date = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i); + const date = new Date( + now.getFullYear(), + now.getMonth(), + now.getDate() - i, + ); const key = dayKey(date); const day = s.days[key] || { ms: 0, saves: 0 }; week.push({ From bab31bb06f317bc6a5cf81682b675959f5d0860a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:34:52 +0530 Subject: [PATCH 008/115] Biome formatting: wrap long Date constructor (streak loop) --- src/lib/profileStats.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/profileStats.js b/src/lib/profileStats.js index 70d1f6b23d..c870de6c46 100644 --- a/src/lib/profileStats.js +++ b/src/lib/profileStats.js @@ -161,7 +161,11 @@ const profileStats = { // Streak: consecutive active days ending today (or yesterday). let streak = 0; for (let i = 0; i < KEEP_DAYS; i++) { - const date = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i); + const date = new Date( + now.getFullYear(), + now.getMonth(), + now.getDate() - i, + ); const active = isActive(s.days[dayKey(date)]); if (active) streak += 1; else if (i > 0) break; From 138205813b8cac2705830c16ad02e0444da0f8b5 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:34:59 +0530 Subject: [PATCH 009/115] Biome formatting: wrap toLocaleDateString options --- src/pages/profile/profile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 50a59254e2..59d787ad47 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -66,7 +66,10 @@ function formatDuration(ms) { function formatMonthYear(value) { const date = new Date(value); if (Number.isNaN(date.getTime())) return ""; - return date.toLocaleDateString(undefined, { month: "short", year: "numeric" }); + return date.toLocaleDateString(undefined, { + month: "short", + year: "numeric", + }); } /** Same path breakdown the "recent" picker uses. */ From bd1a7d409e8986ced8a97b179dd850ebcd3c5687 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:35:06 +0530 Subject: [PATCH 010/115] Biome formatting: break the initial chain --- src/pages/profile/profile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 59d787ad47..b568b03dfb 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -163,7 +163,10 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { const openUrl = (url) => () => system.openInBrowser(url); /* ---------- hero ---------- */ - const initial = (user.name || user.email || "?").trim().charAt(0).toUpperCase(); + const initial = (user.name || user.email || "?") + .trim() + .charAt(0) + .toUpperCase(); const $avatarImg = ; const $avatar = (
From 25276e3e46cd87178ed40dbd2e8f7a68cde05d7e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:35:12 +0530 Subject: [PATCH 011/115] Biome formatting: wrap empty-state JSX --- src/pages/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index b568b03dfb..5235986ed1 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -288,7 +288,9 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { } if (!recentFiles.length && !recentFolders.length) { recent.$body.append( -
Files and folders you open will show up here.
, +
+ Files and folders you open will show up here. +
, ); } From e85a6c0c500c8e5f58f9dec5dd699d5cdb7543af Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:35:19 +0530 Subject: [PATCH 012/115] Biome formatting: wrap plugins dynamic import --- src/pages/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 5235986ed1..08b98d45f4 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -302,7 +302,9 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { title: "Plugins", subtitle: "Browse and manage extensions", onclick: goto(async () => - (await import(/* webpackChunkName: "plugins" */ "pages/plugins")).default(), + ( + await import(/* webpackChunkName: "plugins" */ "pages/plugins") + ).default(), ), }, { From ff5342a9c55fa9fb49d22e7a6edc1389a9547c71 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:58:13 +0530 Subject: [PATCH 013/115] feat(profile): work logged out, add Sign in button on the page --- src/pages/profile/profile.js | 244 +++++++++++++++++++++++------------ 1 file changed, 162 insertions(+), 82 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 08b98d45f4..4164f937de 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -37,6 +37,9 @@ const ICONS = { '', logout: '', + login: + '', + user: '', chevron: '', link: '', verified: @@ -87,6 +90,8 @@ function pathDetails(url) { return { name, location }; } +const openUrl = (url) => () => system.openInBrowser(url); + function section(title, trailing) { const $body =
; const $head = ( @@ -133,56 +138,32 @@ function statCard(className, label, iconName) { ); } -/** - * Open the profile page. - * @param {object} options - * @param {object} options.user - * @param {() => Promise} [options.getAvatarSrc] - * @param {() => Promise} [options.onLogout] - */ -export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { - if (!user) return; - - const $page = Page("Profile"); - $page.classList.add("profile-page"); - - const close = () => { - $page.hide(); - Sidebar.hide(); - }; - const goto = (fn) => () => { - close(); - setTimeout(() => { - try { - fn(); - } catch (error) { - helpers.error(error); - } - }, 200); - }; - const openUrl = (url) => () => system.openInBrowser(url); - - /* ---------- hero ---------- */ +/** Avatar circle: initial first, swaps to the picture once it has loaded. */ +function buildAvatar(user, getAvatarSrc) { const initial = (user.name || user.email || "?") .trim() .charAt(0) .toUpperCase(); - const $avatarImg = ; + const $img = ; const $avatar = (
{initial} - {$avatarImg} + {$img}
); - $avatarImg.onload = () => $avatar.classList.add("loaded"); + $img.onload = () => $avatar.classList.add("loaded"); if (typeof getAvatarSrc === "function") { - Promise.resolve(getAvatarSrc()) + Promise.resolve(getAvatarSrc(user)) .then((src) => { - if (src) $avatarImg.src = src; + if (src) $img.src = src; }) .catch(() => {}); } + return $avatar; +} +/** Header for a logged in user. */ +function buildUserHero(user, getAvatarSrc) { const $nameRow = (

{user.name}

@@ -219,24 +200,159 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { } if (user.website) { const site = String(user.website); - const $c = ( -
- ); + const url = /^https?:\/\//.test(site) ? site : `https://${site}`; + const $c =
; $c.append(icon("external", 14), site.replace(/^https?:\/\//, "")); $chips.append($c); } - const $hero = ( + return (
- {$avatar} + {buildAvatar(user, getAvatarSrc)} {$nameRow}
{user.email || ""}
{$chips}
); +} + +/** Header shown when nobody is logged in, with a sign in button. */ +function buildGuestHero(onSignIn) { + const $label = Sign in; + const $btn = ; + $btn.append(icon("login", 18), $label); + $btn.onclick = async () => { + if ($btn.disabled) return; + $btn.disabled = true; + $label.textContent = "Waiting for sign in…"; + try { + await onSignIn(); + } finally { + $btn.disabled = false; + $label.textContent = "Sign in"; + } + }; + + return ( +
+
{icon("user", 40)}
+

Welcome to Acode

+
+ Sign in with your Acode account to show your profile here. +
+ {$btn} +
Coding stats work without an account.
+
+ ); +} + +/** + * Open the profile page. Works logged in or out. + * @param {object} options + * @param {object|null} [options.user] - logged in user, if any + * @param {(user:object) => Promise} [options.getAvatarSrc] + * @param {() => Promise} [options.onLogin] - resolves the new user + * @param {() => Promise} [options.onLogout] + */ +export default function ProfileInclude({ + user: initialUser = null, + getAvatarSrc, + onLogin, + onLogout, +} = {}) { + let user = initialUser; + + const $page = Page("Profile"); + $page.classList.add("profile-page"); + + const close = () => { + $page.hide(); + Sidebar.hide(); + }; + const goto = (fn) => () => { + close(); + setTimeout(() => { + try { + fn(); + } catch (error) { + helpers.error(error); + } + }, 200); + }; + + /* ---------- account areas (re-rendered on login / logout) ---------- */ + const $heroSlot =
; + const $dangerSlot =
; + + async function signIn() { + if (!onLogin) return; + const next = await onLogin(); + if (next) { + user = next; + refreshAccount(); + } + } + + async function signOut() { + const ok = await confirm( + strings.logout || "Logout", + "Are you sure you want to log out of your Acode account?", + ); + if (!ok) return; + const success = onLogout ? await onLogout() : true; + if (success === false) return; + user = null; + refreshAccount(); + } + + async function resetStats() { + const ok = await confirm( + "Reset stats", + "This clears your coding time, streak and save counts on this device.", + ); + if (!ok) return; + profileStats.reset(); + fillStats(); + } + + function renderHero() { + $heroSlot.textContent = ""; + $heroSlot.append( + user ? buildUserHero(user, getAvatarSrc) : buildGuestHero(signIn), + ); + } + + function renderDanger() { + const $card =
; + if (user) { + $card.append( + row({ + iconName: "logout", + title: strings.logout || "Logout", + danger: true, + end: , + onclick: signOut, + }), + ); + } + $card.append( + row({ + iconName: "trash", + title: "Reset coding stats", + subtitle: "Clears the numbers above on this device", + danger: true, + end: , + onclick: resetStats, + }), + ); + $dangerSlot.textContent = ""; + $dangerSlot.append($card); + } + + function refreshAccount() { + renderHero(); + renderDanger(); + } /* ---------- stats ---------- */ const $grid = ( @@ -354,51 +470,14 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { ]; for (const item of actionRows) actions.$body.append(row(item)); - /* ---------- danger zone ---------- */ - const $logout = ( -
- {row({ - iconName: "logout", - title: strings.logout || "Logout", - danger: true, - end: , - onclick: async () => { - const ok = await confirm( - strings.logout || "Logout", - "Are you sure you want to log out of your Acode account?", - ); - if (!ok) return; - const success = onLogout ? await onLogout() : true; - if (success !== false) $page.hide(); - }, - })} - {row({ - iconName: "trash", - title: "Reset coding stats", - subtitle: "Clears the numbers above on this device", - danger: true, - end: , - onclick: async () => { - const ok = await confirm( - "Reset stats", - "This clears your coding time, streak and save counts on this device.", - ); - if (!ok) return; - profileStats.reset(); - fillStats(); - }, - })} -
- ); - const $main = (
- {$hero} + {$heroSlot} {$grid} {activity.$el} {recent.$el} {actions.$el} - {$logout} + {$dangerSlot}
); @@ -445,6 +524,7 @@ export default function ProfileInclude({ user, getAvatarSrc, onLogout } = {}) { setText(".stat-plugins", String(total)); } + refreshAccount(); fillStats(); fillPlugins(); From 2e21f3a4d35be71fe3b9c2ab2c1c51a0eaabb23a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:58:22 +0530 Subject: [PATCH 014/115] Styles for the signed-out hero and Sign in button --- src/pages/profile/profile.scss | 44 ++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 37d5f46a8e..65854c8ee6 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -330,6 +330,50 @@ color: var(--pf-muted); } + .pf-slot { + display: flex; + flex-direction: column; + } + + /* ---------- signed-out state ---------- */ + .pf-hero.guest { + .pf-avatar.guest { + color: var(--pf-muted); + background: color-mix(in srgb, var(--primary-text-color) 10%, transparent); + box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-text-color) 18%, transparent); + } + + .pf-email { + max-width: 280px; + word-break: normal; + } + } + + .pf-btn { + display: inline-flex; + align-items: center; + justify-content: center; + gap: 8px; + margin-top: 12px; + padding: 12px 26px; + border: none; + border-radius: 12px; + font-family: inherit; + font-size: 15px; + font-weight: 600; + color: #fff; + background: var(--pf-accent); + + &:active { filter: brightness(0.9); } + &:disabled { opacity: 0.6; } + } + + .pf-hint { + margin-top: 8px; + font-size: 12px; + color: var(--pf-muted); + } + @media (max-width: 340px) { .pf-grid { grid-template-columns: repeat(2, 1fr); } } From 568a727c88415188d3f608446d8d4a089b2fbe34 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:58:32 +0530 Subject: [PATCH 015/115] Avatar tap always opens the profile page; login now starts from the page --- src/components/sidebar/index.js | 52 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 01fe81299e..ff022e6c1e 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -96,43 +96,41 @@ function create($container, $toggler) { loginEvents.addListener(updateSidebarAvatar); profileStats.init(); - async function handleUserIconClick(e) { + async function handleUserIconClick() { + let user = null; try { - loader.create(strings["login"], strings["loading..."]); - let user = await auth.getLoggedInUser(); - - if (!user) { - const confirmation = await confirm( - strings.confirm, - strings["confirm-login"], - ); - - if (!confirmation) { - return; - } - - loader.show(); - - await auth.login(); - user = await auth.getLoggedInUser(); - if (!user) { - return; - } - } + user = await auth.getLoggedInUser(); + } catch (error) { + // offline or server error: still open the page as signed out + console.error("Error checking login status:", error); + } - loader.destroy(); + try { const { default: openProfile } = await import( /* webpackChunkName: "profile" */ "pages/profile" ); await openProfile({ user, - getAvatarSrc: () => getAvatarSrc(user), + getAvatarSrc, + onLogin: handleLogin, onLogout: handleLogout, }); } catch (error) { - console.error("Error checking login status:", error); - } finally { - loader.destroy(); + console.error("Error opening profile:", error); + } + } + + /** + * Starts the Acode login flow. Used by the profile page. + * @returns {Promise} the logged in user, if any + */ + async function handleLogin() { + try { + await auth.login(); + return (await auth.getLoggedInUser(true)) || null; + } catch (error) { + console.error("Error during login:", error); + return null; } } From cc86edfc25628f02cbecbee88ede1bfda92c88eb Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 21:58:39 +0530 Subject: [PATCH 016/115] Remove unused confirm import --- src/components/sidebar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index ff022e6c1e..fa53992482 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -1,7 +1,6 @@ import "./style.scss"; import fsOperation from "fileSystem"; import toast from "components/toast"; -import confirm from "dialogs/confirm"; import loader from "dialogs/loader"; import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; From 150035a7cb1b336f0452031f3db84674966eb26c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 22:41:35 +0530 Subject: [PATCH 017/115] refactor(profile): minimal redesign with GitHub contribution graph, drop local coding stats --- src/lib/profileStats.js | 194 --------------- src/pages/profile/github.js | 172 +++++++++++++ src/pages/profile/profile.js | 437 +++++++++++++++++++-------------- src/pages/profile/profile.scss | 338 ++++++++++++------------- 4 files changed, 579 insertions(+), 562 deletions(-) delete mode 100644 src/lib/profileStats.js create mode 100644 src/pages/profile/github.js diff --git a/src/lib/profileStats.js b/src/lib/profileStats.js deleted file mode 100644 index c870de6c46..0000000000 --- a/src/lib/profileStats.js +++ /dev/null @@ -1,194 +0,0 @@ -/** - * Lightweight, on-device coding stats used by the profile page. - * Nothing here leaves the device: everything lives in localStorage. - */ - -const KEY = "acodeProfileStats"; -const FLUSH_MS = 30_000; -const MAX_DELTA_MS = 10 * 60_000; -const KEEP_DAYS = 120; -const ACTIVE_DAY_MS = 60_000; -const DAY_LABELS = ["S", "M", "T", "W", "T", "F", "S"]; - -let state = null; -let inited = false; -let foregroundSince = 0; - -function dayKey(date = new Date()) { - const y = date.getFullYear(); - const m = String(date.getMonth() + 1).padStart(2, "0"); - const d = String(date.getDate()).padStart(2, "0"); - return `${y}-${m}-${d}`; -} - -function emptyState() { - return { - launches: 0, - totalMs: 0, - saves: 0, - firstSeen: Date.now(), - days: {}, - }; -} - -function load() { - try { - const parsed = JSON.parse(localStorage.getItem(KEY)); - if (parsed && typeof parsed === "object") { - const merged = { ...emptyState(), ...parsed }; - if (!merged.days || typeof merged.days !== "object") merged.days = {}; - return merged; - } - } catch {} - return emptyState(); -} - -function ensure() { - if (!state) state = load(); - return state; -} - -function today() { - const s = ensure(); - const key = dayKey(); - if (!s.days[key]) s.days[key] = { ms: 0, saves: 0 }; - return s.days[key]; -} - -function persist() { - const s = ensure(); - const cutoff = Date.now() - KEEP_DAYS * 86_400_000; - for (const key of Object.keys(s.days)) { - const time = new Date(`${key}T00:00:00`).getTime(); - if (Number.isFinite(time) && time < cutoff) delete s.days[key]; - } - try { - localStorage.setItem(KEY, JSON.stringify(s)); - } catch {} -} - -function flush() { - if (!foregroundSince) return; - const now = Date.now(); - const delta = Math.min(Math.max(now - foregroundSince, 0), MAX_DELTA_MS); - foregroundSince = now; - if (!delta) return; - const s = ensure(); - s.totalMs += delta; - today().ms += delta; - persist(); -} - -function resume() { - if (!foregroundSince) foregroundSince = Date.now(); -} - -function pause() { - flush(); - foregroundSince = 0; -} - -function onSave() { - const s = ensure(); - s.saves += 1; - today().saves += 1; - persist(); -} - -function hookSaves() { - let tries = 0; - const timer = setInterval(() => { - tries += 1; - const manager = window.editorManager; - if (manager && typeof manager.on === "function") { - clearInterval(timer); - manager.on("save-file", onSave); - } else if (tries > 60) { - clearInterval(timer); - } - }, 1000); -} - -function isActive(day) { - return !!day && (day.ms >= ACTIVE_DAY_MS || day.saves > 0); -} - -const profileStats = { - /** Start tracking. Safe to call more than once. */ - init() { - if (inited) return; - inited = true; - - const s = ensure(); - s.launches += 1; - persist(); - - if (!document.hidden) resume(); - document.addEventListener("visibilitychange", () => { - if (document.hidden) pause(); - else resume(); - }); - document.addEventListener("pause", pause); - document.addEventListener("resume", resume); - setInterval(flush, FLUSH_MS); - hookSaves(); - }, - - /** Snapshot of the numbers shown on the profile page. */ - getStats() { - const s = ensure(); - flush(); - - const now = new Date(); - const week = []; - for (let i = 6; i >= 0; i--) { - const date = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() - i, - ); - const key = dayKey(date); - const day = s.days[key] || { ms: 0, saves: 0 }; - week.push({ - key, - label: DAY_LABELS[date.getDay()], - ms: day.ms, - saves: day.saves, - isToday: i === 0, - }); - } - - // Streak: consecutive active days ending today (or yesterday). - let streak = 0; - for (let i = 0; i < KEEP_DAYS; i++) { - const date = new Date( - now.getFullYear(), - now.getMonth(), - now.getDate() - i, - ); - const active = isActive(s.days[dayKey(date)]); - if (active) streak += 1; - else if (i > 0) break; - } - - return { - totalMs: s.totalMs, - saves: s.saves, - launches: s.launches, - firstSeen: s.firstSeen, - streak, - week, - weekMs: week.reduce((sum, d) => sum + d.ms, 0), - weekSaves: week.reduce((sum, d) => sum + d.saves, 0), - }; - }, - - /** Wipe all tracked stats. */ - reset() { - state = emptyState(); - state.launches = 1; - persist(); - }, -}; - -export default profileStats; diff --git a/src/pages/profile/github.js b/src/pages/profile/github.js new file mode 100644 index 0000000000..6aa063bd01 --- /dev/null +++ b/src/pages/profile/github.js @@ -0,0 +1,172 @@ +/** + * GitHub contribution data for the profile page. + * Data comes from the public github-contributions-api (no token needed) + * and is cached on the device so the graph still shows offline. + */ + +const API = "https://github-contributions-api.jogruber.de/v4"; +const USER_KEY = "acode-profile-github"; +const CACHE_KEY = "acode-profile-github-cache:"; +const CACHE_TTL = 6 * 60 * 60 * 1000; // 6 hours +const NAME_RE = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i; +const MONTHS = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +]; + +function read(key) { + try { + return localStorage.getItem(key); + } catch { + return null; + } +} + +function write(key, value) { + try { + if (value === null || value === "") localStorage.removeItem(key); + else localStorage.setItem(key, value); + } catch {} +} + +/** Accepts "name", "@name" or a github.com URL. Returns "" if invalid. */ +export function cleanUsername(value) { + const name = String(value || "") + .trim() + .replace(/^https?:\/\/(www\.)?github\.com\//i, "") + .replace(/^@/, "") + .split(/[/?#]/)[0]; + return NAME_RE.test(name) ? name : ""; +} + +/** Username the person typed on this device (overrides the account's one). */ +export function getSavedUsername() { + return cleanUsername(read(USER_KEY)); +} + +export function saveUsername(name) { + write(USER_KEY, name || null); +} + +function normalize(json) { + const days = (json?.contributions || []) + .filter((d) => d?.date) + .map((d) => ({ + date: d.date, + count: Number(d.count) || 0, + level: Math.min(4, Math.max(0, Number(d.level) || 0)), + })) + .sort((a, b) => (a.date < b.date ? -1 : 1)); + + if (!days.length) throw new Error("empty"); + + let total = 0; + let longest = 0; + let run = 0; + for (const day of days) { + total += day.count; + if (day.count > 0) { + run++; + longest = Math.max(longest, run); + } else { + run = 0; + } + } + + // Today may not have a contribution yet, don't let that break the streak. + let current = 0; + let i = days.length - 1; + if (days[i].count === 0) i--; + for (; i >= 0 && days[i].count > 0; i--) current++; + + return { days, total, current, longest }; +} + +function readCache(key) { + try { + const raw = read(key); + return raw ? JSON.parse(raw) : null; + } catch { + return null; + } +} + +/** + * @param {string} username + * @param {{force?: boolean}} [options] + * @returns {Promise<{days: Array, total: number, current: number, longest: number, stale?: boolean}>} + */ +export async function fetchContributions(username, { force = false } = {}) { + const key = CACHE_KEY + username.toLowerCase(); + const cached = readCache(key); + + if (cached && !force && Date.now() - cached.at < CACHE_TTL) { + return cached.data; + } + + try { + const res = await fetch(`${API}/${encodeURIComponent(username)}?y=last`); + if (!res.ok) throw new Error(res.status === 404 ? "not-found" : "http"); + const data = normalize(await res.json()); + write(key, JSON.stringify({ at: Date.now(), data })); + return data; + } catch (error) { + if (cached && error.message !== "not-found") { + return { ...cached.data, stale: true }; + } + throw error; + } +} + +/** Groups days into Sunday-first weeks of 7 (null = padding). */ +export function buildWeeks(days) { + const weeks = []; + let week = new Array( + new Date(`${days[0].date}T00:00:00Z`).getUTCDay(), + ).fill(null); + + for (const day of days) { + week.push(day); + if (week.length === 7) { + weeks.push(week); + week = []; + } + } + if (week.length) { + while (week.length < 7) week.push(null); + weeks.push(week); + } + return weeks; +} + +/** Month name for the column where a new month starts, else undefined. */ +export function monthLabels(weeks) { + const starts = []; + let prev = -1; + weeks.forEach((week, i) => { + const day = week.find((d) => d?.date.endsWith("-01")) || week.find(Boolean); + if (!day) return; + const month = Number(day.date.slice(5, 7)) - 1; + if (month !== prev) { + starts.push({ i, month }); + prev = month; + } + }); + + // A tiny first month would collide with the next label, so drop it. + if (starts.length > 1 && starts[1].i - starts[0].i < 3) starts.shift(); + + const labels = {}; + for (const { i, month } of starts) labels[i] = MONTHS[month]; + return labels; +} diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 4164f937de..7154a38418 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -2,27 +2,29 @@ import "./profile.scss"; import fsOperation from "fileSystem"; import Page from "components/page"; import Sidebar from "components/sidebar"; +import toast from "components/toast"; import confirm from "dialogs/confirm"; +import prompt from "dialogs/prompt"; import actionStack from "lib/actionStack"; import config from "lib/config"; import { LOADED_PLUGINS } from "lib/loadPlugins"; import openFile from "lib/openFile"; import openFolder from "lib/openFolder"; -import profileStats from "lib/profileStats"; import recents from "lib/recents"; import helpers from "utils/helpers"; import Uri from "utils/Uri"; import Url from "utils/Url"; +import { + buildWeeks, + cleanUsername, + fetchContributions, + getSavedUsername, + monthLabels, + saveUsername, +} from "./github"; /* Feather-style stroke icons, so the page never depends on the icon font. */ const ICONS = { - clock: - '', - zap: '', - save: '', - activity: '', - layers: - '', package: '', file: '', @@ -41,13 +43,8 @@ const ICONS = { '', user: '', chevron: '', - link: '', verified: '', - calendar: - '', - trash: - '', }; function icon(name, size = 20) { @@ -57,15 +54,6 @@ function icon(name, size = 20) { return el; } -function formatDuration(ms) { - const mins = Math.floor(ms / 60000); - if (mins < 1) return ms >= 1000 ? "<1m" : "0m"; - const h = Math.floor(mins / 60); - const m = mins % 60; - if (h >= 100) return `${h}h`; - return h ? `${h}h ${m}m` : `${m}m`; -} - function formatMonthYear(value) { const date = new Date(value); if (Number.isNaN(date.getTime())) return ""; @@ -75,6 +63,16 @@ function formatMonthYear(value) { }); } +function tipText({ count, date }) { + const when = new Date(`${date}T00:00:00Z`).toLocaleDateString(undefined, { + month: "short", + day: "numeric", + year: "numeric", + timeZone: "UTC", + }); + return `${count} contribution${count === 1 ? "" : "s"} on ${when}`; +} + /** Same path breakdown the "recent" picker uses. */ function pathDetails(url) { url = Url.parse(url).url; @@ -92,24 +90,30 @@ function pathDetails(url) { const openUrl = (url) => () => system.openInBrowser(url); -function section(title, trailing) { +function section(title) { + const $trail = ; const $body =
; - const $head = ( -
-

{title}

-
- ); - if (trailing) $head.append(trailing); const $el = (
- {$head} +
+

{title}

+ {$trail} +
{$body}
); - return { $el, $body }; + return { $el, $body, $trail }; } -function row({ iconName, title, subtitle, onclick, danger = false, end }) { +function row({ + iconName, + title, + subtitle, + value, + onclick, + danger = false, + chevron = true, +}) { const $text = (
{title}
@@ -120,23 +124,21 @@ function row({ iconName, title, subtitle, onclick, danger = false, end }) { } const $row = (
-
{icon(iconName)}
+ {icon(iconName, 20)} {$text}
); - $row.append(end || icon("chevron", 18)); + if (value) $row.append(value); + if (chevron) $row.append(icon("chevron", 18)); return $row; } -function statCard(className, label, iconName) { - return ( -
-
{icon(iconName, 18)}
-
–
-
{label}
-
- ); -} +const metric = (value, label) => ( +
+
{String(value)}
+
{label}
+
+); /** Avatar circle: initial first, swaps to the picture once it has loaded. */ function buildAvatar(user, getAvatarSrc) { @@ -171,7 +173,7 @@ function buildUserHero(user, getAvatarSrc) { ); if (user.verified) { const $v = ; - $v.append(icon("verified", 18)); + $v.append(icon("verified", 16)); $nameRow.append($v); } if (user.acode_pro) { @@ -181,37 +183,30 @@ function buildUserHero(user, getAvatarSrc) { $nameRow.append(ADMIN); } - const $chips =
; + const $meta =
; const since = formatMonthYear(user.created_at); if (since) { - const $c =
; - $c.append(icon("calendar", 14), `Member since ${since}`); - $chips.append($c); - } - if (user.github) { - const $c = ( -
- ); - $c.append(icon("link", 14), `@${user.github}`); - $chips.append($c); + $meta.append({`Member since ${since}`}); } if (user.website) { const site = String(user.website); const url = /^https?:\/\//.test(site) ? site : `https://${site}`; - const $c =
; - $c.append(icon("external", 14), site.replace(/^https?:\/\//, "")); - $chips.append($c); + if (since) $meta.append(·); + $meta.append( + + {site.replace(/^https?:\/\//, "")} + , + ); } return (
{buildAvatar(user, getAvatarSrc)} - {$nameRow} -
{user.email || ""}
- {$chips} +
+ {$nameRow} +
{user.email || ""}
+ {$meta} +
); } @@ -219,8 +214,8 @@ function buildUserHero(user, getAvatarSrc) { /** Header shown when nobody is logged in, with a sign in button. */ function buildGuestHero(onSignIn) { const $label = Sign in; - const $btn = ; - $btn.append(icon("login", 18), $label); + const $btn = ; + $btn.append(icon("login", 16), $label); $btn.onclick = async () => { if ($btn.disabled) return; $btn.disabled = true; @@ -234,14 +229,13 @@ function buildGuestHero(onSignIn) { }; return ( -
-
{icon("user", 40)}
-

Welcome to Acode

-
- Sign in with your Acode account to show your profile here. +
+
{icon("user", 30)}
+
+

Not signed in

+
Sign in with your Acode account.
+ {$btn}
- {$btn} -
Coding stats work without an account.
); } @@ -261,6 +255,7 @@ export default function ProfileInclude({ onLogout, } = {}) { let user = initialUser; + let githubRun = 0; const $page = Page("Profile"); $page.classList.add("profile-page"); @@ -280,10 +275,11 @@ export default function ProfileInclude({ }, 200); }; - /* ---------- account areas (re-rendered on login / logout) ---------- */ const $heroSlot =
; - const $dangerSlot =
; + const $logoutSlot =
; + const github = section("GitHub"); + /* ---------- account ---------- */ async function signIn() { if (!onLogin) return; const next = await onLogin(); @@ -305,16 +301,6 @@ export default function ProfileInclude({ refreshAccount(); } - async function resetStats() { - const ok = await confirm( - "Reset stats", - "This clears your coding time, streak and save counts on this device.", - ); - if (!ok) return; - profileStats.reset(); - fillStats(); - } - function renderHero() { $heroSlot.textContent = ""; $heroSlot.append( @@ -322,59 +308,176 @@ export default function ProfileInclude({ ); } - function renderDanger() { - const $card =
; - if (user) { - $card.append( - row({ - iconName: "logout", - title: strings.logout || "Logout", - danger: true, - end: , - onclick: signOut, - }), - ); - } + function renderLogout() { + $logoutSlot.textContent = ""; + if (!user) return; + const $card =
; $card.append( row({ - iconName: "trash", - title: "Reset coding stats", - subtitle: "Clears the numbers above on this device", + iconName: "logout", + title: strings.logout || "Logout", danger: true, - end: , - onclick: resetStats, + chevron: false, + onclick: signOut, }), ); - $dangerSlot.textContent = ""; - $dangerSlot.append($card); + $logoutSlot.append($card); } function refreshAccount() { renderHero(); - renderDanger(); + renderLogout(); + renderGithub(); } - /* ---------- stats ---------- */ - const $grid = ( -
- {statCard("stat-time", "Coding time", "clock")} - {statCard("stat-streak", "Day streak", "zap")} - {statCard("stat-saves", "Files saved", "save")} - {statCard("stat-launches", "App launches", "activity")} - {statCard("stat-tabs", "Open files", "layers")} - {statCard("stat-plugins", "Plugins", "package")} -
- ); + /* ---------- GitHub ---------- */ + /** Username typed on this device wins, otherwise the one on the account. */ + const githubName = () => getSavedUsername() || cleanUsername(user?.github); + + async function editGithub() { + const input = await prompt("GitHub username", githubName(), "text"); + if (input === null || input === undefined) return; + const raw = String(input).trim(); + if (!raw) { + saveUsername(""); + } else { + const name = cleanUsername(raw); + if (!name) { + toast("That doesn't look like a GitHub username"); + return; + } + saveUsername(name); + } + renderGithub(true); + } + + function githubMessage(text, ...buttons) { + const $actions =
; + for (const [label, handler, ghost] of buttons) { + $actions.append( + , + ); + } + return ( +
+
{text}
+ {$actions} +
+ ); + } - const $chart =
; - const $chartNote =
; - const activity = section("Last 7 days"); - activity.$body.append($chart, $chartNote); + function drawGithub(data) { + const weeks = buildWeeks(data.days); + const labels = monthLabels(weeks); + const $grid =
; + + weeks.forEach((week, i) => { + const $week =
; + $week.append(
{labels[i] || ""}
); + for (const day of week) { + const $cell = ( +
+ ); + if (day) $cell.dataset.tip = tipText(day); + $week.append($cell); + } + $grid.append($week); + }); + + $grid.onclick = (e) => { + const tip = e.target?.dataset?.tip; + if (tip) toast(tip); + }; + + const $scroll =
{$grid}
; + + const $legend =
; + $legend.append(Less); + for (let n = 0; n <= 4; n++) { + $legend.append(); + } + $legend.append(More); + + github.$body.textContent = ""; + github.$body.append( +
+ {metric(data.total.toLocaleString(), "Contributions")} + {metric(`${data.current}d`, "Current streak")} + {metric(`${data.longest}d`, "Longest streak")} +
, + $scroll, +
+ + Change username + + {$legend} +
, + ); + + // Newest weeks are on the right, so start scrolled to the end. + setTimeout(() => { + $scroll.scrollLeft = $scroll.scrollWidth; + }, 50); + } + + async function renderGithub(force = false) { + const run = ++githubRun; + const name = githubName(); + + github.$trail.textContent = ""; + github.$body.textContent = ""; + + if (!name) { + github.$body.append( + githubMessage("Show your GitHub contributions here.", [ + "Add username", + editGithub, + ]), + ); + return; + } + + github.$trail.append( + {`@${name}`}, + ); + github.$body.append(
Loading contributions…
); + + try { + const data = await fetchContributions(name, { force }); + if (run !== githubRun) return; + drawGithub(data); + } catch (error) { + if (run !== githubRun) return; + github.$body.textContent = ""; + const text = + error.message === "not-found" + ? `Couldn't find @${name} on GitHub.` + : "Couldn't load contributions. Check your connection."; + github.$body.append( + githubMessage( + text, + ["Retry", () => renderGithub(true)], + ["Change username", editGithub, true], + ), + ); + } + } /* ---------- recents ---------- */ - const recent = section("Jump back in"); - const recentFiles = recents.files.filter(Boolean).slice(0, 5); - const recentFolders = recents.folders.filter((f) => f?.url).slice(0, 3); + const recent = section("Recent"); + const recentFiles = recents.files.filter(Boolean).slice(0, 4); + const recentFolders = recents.folders.filter((f) => f?.url).slice(0, 2); for (const file of recentFiles) { const { name, location } = pathDetails(file); @@ -383,6 +486,7 @@ export default function ProfileInclude({ iconName: "file", title: name, subtitle: location, + chevron: false, onclick: goto(() => Promise.resolve(openFile(file, { render: true })).catch((err) => helpers.error(err), @@ -398,25 +502,23 @@ export default function ProfileInclude({ iconName: "folder", title: name, subtitle: location, + chevron: false, onclick: goto(() => openFolder(folder.url, folder.opts)), }), ); } - if (!recentFiles.length && !recentFolders.length) { - recent.$body.append( -
- Files and folders you open will show up here. -
, - ); - } - /* ---------- quick actions ---------- */ - const actions = section("Quick actions"); - const actionRows = [ + /* ---------- menu ---------- */ + // Count of plugins downloaded to this device; tapping opens the + // Plugins page, which starts on its "Installed" tab. + const $pluginCount = –; + + const menu = section("More"); + const menuRows = [ { iconName: "package", - title: "Plugins", - subtitle: "Browse and manage extensions", + title: "Downloaded plugins", + value: $pluginCount, onclick: goto(async () => ( await import(/* webpackChunkName: "plugins" */ "pages/plugins") @@ -426,7 +528,6 @@ export default function ProfileInclude({ { iconName: "sliders", title: "Settings", - subtitle: "Editor, app and file preferences", onclick: goto(async () => ( await import( @@ -438,7 +539,6 @@ export default function ProfileInclude({ { iconName: "contrast", title: "App theme", - subtitle: "Switch the look of Acode", onclick: goto(async () => ( await import( @@ -450,70 +550,24 @@ export default function ProfileInclude({ { iconName: "folder", title: "Open folder", - subtitle: "Add a project to the sidebar", onclick: goto(() => acode.exec("open-folder")), }, { iconName: "external", title: "Acode account", - subtitle: String(config.BASE_URL || "").replace(/^https?:\/\//, ""), + value: String(config.BASE_URL || "").replace(/^https?:\/\//, ""), onclick: openUrl(config.BASE_URL), }, { iconName: "info", title: "About", - subtitle: `Version ${window.BuildInfo?.version || ""}`.trim(), + value: window.BuildInfo?.version || "", onclick: goto(async () => (await import(/* webpackChunkName: "about" */ "pages/about")).default(), ), }, ]; - for (const item of actionRows) actions.$body.append(row(item)); - - const $main = ( -
- {$heroSlot} - {$grid} - {activity.$el} - {recent.$el} - {actions.$el} - {$dangerSlot} -
- ); - - /* ---------- data ---------- */ - const setText = (selector, text) => { - const $el = $main.querySelector(selector); - if ($el) $el.textContent = text; - }; - - function fillStats() { - const s = profileStats.getStats(); - setText(".stat-time", formatDuration(s.totalMs)); - setText(".stat-streak", `${s.streak}d`); - setText(".stat-saves", String(s.saves)); - setText(".stat-launches", String(s.launches)); - setText(".stat-tabs", String(window.editorManager?.files?.length ?? 0)); - - const max = Math.max(...s.week.map((d) => d.ms), 1); - $chart.textContent = ""; - for (const day of s.week) { - const pct = day.ms > 0 ? Math.max((day.ms / max) * 100, 8) : 0; - const $bar =
; - $bar.style.height = `${pct}%`; - const $col = ( -
-
{$bar}
-
{day.label}
-
- ); - $chart.append($col); - } - $chartNote.textContent = `${formatDuration(s.weekMs)} coding · ${s.weekSaves} saves this week. Tracked on this device only.`; - } + for (const item of menuRows) menu.$body.append(row(item)); async function fillPlugins() { let total = LOADED_PLUGINS.size; @@ -521,11 +575,16 @@ export default function ProfileInclude({ const list = await fsOperation(PLUGIN_DIR).lsDir(); total = list.length; } catch {} - setText(".stat-plugins", String(total)); + $pluginCount.textContent = String(total); } + /* ---------- assemble ---------- */ + const $main =
; + $main.append($heroSlot, github.$el); + if (recentFiles.length || recentFolders.length) $main.append(recent.$el); + $main.append(menu.$el, $logoutSlot); + refreshAccount(); - fillStats(); fillPlugins(); $page.body = $main; diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 65854c8ee6..86e21f9be2 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -1,19 +1,24 @@ #profile-page { - --pf-accent: var(--active-color, #3b82f6); + --pf-blue: #3b82f6; --pf-muted: color-mix(in srgb, var(--primary-text-color) 60%, transparent); - --pf-card: color-mix(in srgb, var(--popup-background-color) 30%, transparent); - --pf-card-hover: color-mix(in srgb, var(--popup-background-color) 55%, transparent); - --pf-border: var(--border-color, rgba(255, 255, 255, 0.08)); + --pf-border: var(--border-color, rgba(255, 255, 255, 0.1)); --pf-danger: var(--danger-color, #ff5c5c); + /* GitHub graph: one blue, five steps (works on light and dark themes) */ + --pf-lv0: color-mix(in srgb, var(--primary-text-color) 9%, transparent); + --pf-lv1: color-mix(in srgb, var(--pf-blue) 28%, transparent); + --pf-lv2: color-mix(in srgb, var(--pf-blue) 50%, transparent); + --pf-lv3: color-mix(in srgb, var(--pf-blue) 75%, transparent); + --pf-lv4: var(--pf-blue); + box-sizing: border-box; width: 100%; max-width: 560px; margin: 0 auto; - padding: 16px 16px 40px; + padding: 20px 16px 40px; display: flex; flex-direction: column; - gap: 20px; + gap: 24px; overflow-y: auto; color: var(--primary-text-color); @@ -24,42 +29,49 @@ flex-shrink: 0; } - /* ---------- hero ---------- */ - .pf-hero { + .pf-slot { display: flex; flex-direction: column; + } + + .pf-link { + color: var(--pf-blue); + &:active { opacity: 0.6; } + } + + /* ---------- header ---------- */ + .pf-hero { + display: flex; align-items: center; - text-align: center; - gap: 6px; - padding: 28px 16px 20px; - border-radius: 20px; - border: 1px solid var(--pf-border); - background: - radial-gradient(120% 90% at 50% 0%, - color-mix(in srgb, var(--pf-accent) 28%, transparent), - transparent 70%), - var(--pf-card); + gap: 16px; + padding: 0 4px; + } + + .pf-hero-text { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + align-items: flex-start; + gap: 2px; } .pf-avatar { position: relative; - width: 92px; - height: 92px; + flex-shrink: 0; + width: 68px; + height: 68px; border-radius: 50%; - margin-bottom: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; - background: color-mix(in srgb, var(--pf-accent) 35%, var(--popup-background-color)); - box-shadow: - 0 0 0 3px var(--pf-accent), - 0 8px 24px rgba(0, 0, 0, 0.3); + border: 1px solid var(--pf-border); + background: var(--pf-lv0); .pf-avatar-initial { - font-size: 38px; + font-size: 28px; font-weight: 600; - color: var(--popup-text-color, var(--primary-text-color)); } .pf-avatar-img { @@ -76,33 +88,34 @@ .pf-avatar-img { opacity: 1; } .pf-avatar-initial { display: none; } } + + &.guest { color: var(--pf-muted); } } .pf-name-row { display: flex; align-items: center; - justify-content: center; flex-wrap: wrap; gap: 8px; } .pf-name { margin: 0; - font-size: 22px; + font-size: 20px; font-weight: 600; - line-height: 1.2; + line-height: 1.25; word-break: break-word; } .pf-verified { display: inline-flex; - color: var(--pf-accent); + color: var(--pf-blue); } .pf-badge { - padding: 2px 8px; + padding: 1px 7px; border-radius: 999px; - font-size: 11px; + font-size: 10.5px; font-weight: 600; letter-spacing: 0.06em; color: var(--pf-muted); @@ -111,80 +124,26 @@ &.pro { color: #1b1300; border-color: transparent; - background: linear-gradient(135deg, #ffd45e, #ffa63d); + background: #ffc94d; } } .pf-email { - font-size: 14px; + font-size: 13.5px; color: var(--pf-muted); word-break: break-all; } - .pf-chips { + .pf-meta { display: flex; flex-wrap: wrap; - justify-content: center; - gap: 8px; - margin-top: 10px; - } - - .pf-chip { - display: inline-flex; align-items: center; gap: 6px; - padding: 6px 12px; - border-radius: 999px; + margin-top: 2px; font-size: 12.5px; - color: var(--primary-text-color); - background: color-mix(in srgb, var(--primary-text-color) 8%, transparent); - - &.tap:active { - background: color-mix(in srgb, var(--pf-accent) 30%, transparent); - } - } - - /* ---------- stats grid ---------- */ - .pf-grid { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 10px; - } - - .pf-stat { - display: flex; - flex-direction: column; - align-items: flex-start; - gap: 2px; - min-width: 0; - padding: 12px; - border-radius: 14px; - border: 1px solid var(--pf-border); - background: var(--pf-card); - - .pf-stat-icon { - display: inline-flex; - margin-bottom: 6px; - padding: 6px; - border-radius: 10px; - color: var(--pf-accent); - background: color-mix(in srgb, var(--pf-accent) 16%, transparent); - } - - .pf-stat-value { - font-size: 19px; - font-weight: 600; - line-height: 1.2; - max-width: 100%; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - } + color: var(--pf-muted); - .pf-stat-label { - font-size: 11.5px; - color: var(--pf-muted); - } + .pf-link { color: var(--pf-blue); } } /* ---------- sections ---------- */ @@ -199,6 +158,7 @@ align-items: center; justify-content: space-between; padding: 0 4px; + font-size: 13px; } .pf-section-title { @@ -213,86 +173,113 @@ .pf-card { display: flex; flex-direction: column; - border-radius: 16px; + border-radius: 14px; border: 1px solid var(--pf-border); - background: var(--pf-card); overflow: hidden; } - /* ---------- chart ---------- */ - .pf-chart { + /* ---------- GitHub ---------- */ + .pf-metrics { display: flex; - align-items: stretch; - gap: 8px; - height: 120px; - padding: 16px 16px 8px; + padding: 14px 8px 4px; } - .pf-bar-col { + .pf-metric { flex: 1; - display: flex; - flex-direction: column; - align-items: center; - gap: 6px; - min-width: 0; - - .pf-bar-track { - flex: 1; - width: 100%; - max-width: 30px; - display: flex; - align-items: flex-end; - border-radius: 8px; - background: color-mix(in srgb, var(--primary-text-color) 6%, transparent); - } + text-align: center; - .pf-bar { - width: 100%; - border-radius: 8px; - background: color-mix(in srgb, var(--pf-accent) 55%, transparent); - transition: height 0.4s ease; + .pf-metric-value { + font-size: 18px; + font-weight: 600; } - .pf-bar-label { - font-size: 11px; + .pf-metric-label { + margin-top: 2px; + font-size: 11.5px; color: var(--pf-muted); } + } - &.today { - .pf-bar { background: var(--pf-accent); } - .pf-bar-label { color: var(--primary-text-color); font-weight: 600; } - } + .pf-gh-scroll { + overflow-x: auto; + padding: 14px 14px 10px; + scrollbar-width: none; + -webkit-overflow-scrolling: touch; + + &::-webkit-scrollbar { display: none; } + } + + .pf-gh-grid { + display: flex; + gap: 3px; + width: max-content; + } + + .pf-gh-week { + display: flex; + flex-direction: column; + gap: 3px; + } + + .pf-gh-month { + flex: none; + width: 11px; + height: 14px; + line-height: 14px; + font-size: 10.5px; + white-space: nowrap; + overflow: visible; + color: var(--pf-muted); } - .pf-note { - padding: 4px 16px 14px; + .pf-gh-cell { + flex: none; + width: 11px; + height: 11px; + border-radius: 2px; + background: var(--pf-lv0); + + &.lv1 { background: var(--pf-lv1); } + &.lv2 { background: var(--pf-lv2); } + &.lv3 { background: var(--pf-lv3); } + &.lv4 { background: var(--pf-lv4); } + &.none { background: transparent; } + } + + .pf-gh-foot { + display: flex; + align-items: center; + justify-content: space-between; + gap: 12px; + padding: 0 14px 12px; font-size: 12px; color: var(--pf-muted); } + .pf-gh-legend { + display: flex; + align-items: center; + gap: 3px; + + span:first-child { margin-right: 4px; } + span:last-child { margin-left: 4px; } + } + /* ---------- rows ---------- */ .pf-row { display: flex; align-items: center; - gap: 12px; - padding: 12px 14px; + gap: 14px; + padding: 14px; border-bottom: 1px solid var(--pf-border); color: var(--primary-text-color); - transition: background 0.15s ease; &:last-child { border-bottom: none; } - &:active { background: var(--pf-card-hover); } + &:active { background: var(--pf-lv0); } + > .pf-icon { color: var(--pf-muted); } > .pf-icon:last-child { color: var(--pf-muted); } - .pf-row-icon { - display: inline-flex; - padding: 8px; - border-radius: 10px; - color: var(--pf-accent); - background: color-mix(in srgb, var(--pf-accent) 14%, transparent); - } - .pf-row-text { flex: 1; min-width: 0; @@ -307,46 +294,41 @@ .pf-row-sub { margin-top: 2px; - font-size: 12.5px; + font-size: 12px; color: var(--pf-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .pf-row-value { + font-size: 13.5px; + color: var(--pf-muted); + } + &.danger { + > .pf-icon, .pf-row-title { color: var(--pf-danger); } - .pf-row-icon { - color: var(--pf-danger); - background: color-mix(in srgb, var(--pf-danger) 14%, transparent); - } } } + /* ---------- empty / buttons ---------- */ .pf-empty { - padding: 18px 16px; + display: flex; + flex-direction: column; + align-items: center; + gap: 12px; + padding: 22px 16px; font-size: 13.5px; text-align: center; color: var(--pf-muted); } - .pf-slot { + .pf-actions { display: flex; - flex-direction: column; - } - - /* ---------- signed-out state ---------- */ - .pf-hero.guest { - .pf-avatar.guest { - color: var(--pf-muted); - background: color-mix(in srgb, var(--primary-text-color) 10%, transparent); - box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-text-color) 18%, transparent); - } - - .pf-email { - max-width: 280px; - word-break: normal; - } + flex-wrap: wrap; + justify-content: center; + gap: 8px; } .pf-btn { @@ -354,27 +336,25 @@ align-items: center; justify-content: center; gap: 8px; - margin-top: 12px; - padding: 12px 26px; - border: none; - border-radius: 12px; + margin-top: 6px; + padding: 10px 22px; + border: 1px solid transparent; + border-radius: 10px; font-family: inherit; - font-size: 15px; + font-size: 14px; font-weight: 600; color: #fff; - background: var(--pf-accent); + background: var(--pf-blue); + &.small { padding: 7px 16px; font-size: 13px; margin-top: 0; } + &.ghost { + color: var(--primary-text-color); + background: transparent; + border-color: var(--pf-border); + } &:active { filter: brightness(0.9); } &:disabled { opacity: 0.6; } } - .pf-hint { - margin-top: 8px; - font-size: 12px; - color: var(--pf-muted); - } - - @media (max-width: 340px) { - .pf-grid { grid-template-columns: repeat(2, 1fr); } - } + .pf-hero-text .pf-btn { margin-top: 8px; } } From c5d29a64dd2444319059d38aad0d1bed75bfe7de Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 22:41:41 +0530 Subject: [PATCH 018/115] chore(sidebar): remove profileStats import --- src/components/sidebar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index fa53992482..47112ebb8a 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -6,7 +6,6 @@ import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; import auth, { loginEvents } from "lib/auth"; import config from "lib/config"; -import profileStats from "lib/profileStats"; import helpers from "utils/helpers"; import Url from "utils/Url"; From 26a80034ef04eb69e876e38037aac312017c1891 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 22:41:47 +0530 Subject: [PATCH 019/115] chore(sidebar): stop starting the stats tracker --- src/components/sidebar/index.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 47112ebb8a..19114f65b9 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -92,7 +92,6 @@ function create($container, $toggler) { } loginEvents.addListener(updateSidebarAvatar); - profileStats.init(); async function handleUserIconClick() { let user = null; From d895eaa2d4470f8ef0a8da2e053a097488b1ebc7 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sat, 21 Nov 2026 22:45:45 +0530 Subject: [PATCH 020/115] style(profile): fix Biome formatting in github.js --- src/pages/profile/github.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pages/profile/github.js b/src/pages/profile/github.js index 6aa063bd01..3a85af58bd 100644 --- a/src/pages/profile/github.js +++ b/src/pages/profile/github.js @@ -131,9 +131,8 @@ export async function fetchContributions(username, { force = false } = {}) { /** Groups days into Sunday-first weeks of 7 (null = padding). */ export function buildWeeks(days) { const weeks = []; - let week = new Array( - new Date(`${days[0].date}T00:00:00Z`).getUTCDay(), - ).fill(null); + const offset = new Date(`${days[0].date}T00:00:00Z`).getUTCDay(); + let week = new Array(offset).fill(null); for (const day of days) { week.push(day); From 9021ff6c55a9aa16264337884c3a5afb25b36f6e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:08 +0530 Subject: [PATCH 021/115] feat(profile): local activity graph (time, lines, files, streak, top languages) --- src/lib/activity.js | 254 +++++++++++++++++++++++++++++++++ src/pages/profile/github.js | 171 ---------------------- src/pages/profile/heatmap.js | 56 ++++++++ src/pages/profile/profile.js | 214 +++++++++++++-------------- src/pages/profile/profile.scss | 65 ++++++--- 5 files changed, 454 insertions(+), 306 deletions(-) create mode 100644 src/lib/activity.js delete mode 100644 src/pages/profile/github.js create mode 100644 src/pages/profile/heatmap.js diff --git a/src/lib/activity.js b/src/lib/activity.js new file mode 100644 index 0000000000..5bcd1d0891 --- /dev/null +++ b/src/lib/activity.js @@ -0,0 +1,254 @@ +/** + * Local coding activity for the profile page. + * + * Everything is stored on this device only (localStorage), one small record + * per day: time spent coding, lines written, files created and time per + * language. Nothing is sent anywhere. + */ +import { getMode, getModeForPath } from "cm/modelist"; + +const STORAGE_KEY = "acode-activity-v1"; +const KEEP_DAYS = 400; +const TICK_MS = 10 * 1000; +// No touch/key input for this long means the person stepped away. +const IDLE_MS = 2 * 60 * 1000; +const SAVE_DELAY = 3000; +const DAY_MS = 24 * 60 * 60 * 1000; +// Score (about "minutes of coding") needed for each shade 1 to 4. +const LEVELS = [1, 10, 30, 60]; + +let days = {}; +let started = false; +let lastInput = 0; +let lastTick = 0; +let saveTimer = null; + +const pad = (n) => String(n).padStart(2, "0"); + +export function dayKey(date = new Date()) { + const month = pad(date.getMonth() + 1); + return `${date.getFullYear()}-${month}-${pad(date.getDate())}`; +} + +function normalizeDay(day) { + return { + ms: Number(day?.ms) || 0, + lines: Number(day?.lines) || 0, + files: Number(day?.files) || 0, + langs: day?.langs && typeof day.langs === "object" ? day.langs : {}, + }; +} + +function load() { + days = {}; + try { + const parsed = JSON.parse(localStorage.getItem(STORAGE_KEY) || "{}"); + const cutoff = dayKey(new Date(Date.now() - KEEP_DAYS * DAY_MS)); + for (const [key, value] of Object.entries(parsed?.days || {})) { + if (key >= cutoff) days[key] = normalizeDay(value); + } + } catch { + days = {}; + } +} + +function save() { + clearTimeout(saveTimer); + saveTimer = null; + try { + localStorage.setItem(STORAGE_KEY, JSON.stringify({ days })); + } catch {} +} + +function scheduleSave() { + if (!saveTimer) saveTimer = setTimeout(save, SAVE_DELAY); +} + +function today() { + const key = dayKey(); + if (!days[key]) days[key] = normalizeDay(); + return days[key]; +} + +function languageOf(file) { + const mode = + (file.currentMode && getMode(file.currentMode)) || + getModeForPath(file.filename || ""); + if (!mode || mode.name === "text") return ""; + return mode.caption || mode.name; +} + +function activeLanguage() { + const file = window.editorManager?.activeFile; + if (!file || file.type !== "editor") return ""; + return languageOf(file); +} + +function tick() { + const now = Date.now(); + const elapsed = Math.min(now - lastTick, TICK_MS * 2); + lastTick = now; + + if (document.visibilityState !== "visible") return; + if (now - lastInput > IDLE_MS) return; + + const day = today(); + day.ms += elapsed; + const language = activeLanguage(); + if (language) day.langs[language] = (day.langs[language] || 0) + elapsed; + scheduleSave(); +} + +/** Start tracking. Safe to call more than once. */ +function init() { + if (started || typeof document === "undefined") return; + started = true; + load(); + lastTick = Date.now(); + + const markInput = () => { + lastInput = Date.now(); + }; + for (const type of ["touchstart", "pointerdown", "keydown"]) { + document.addEventListener(type, markInput, { + capture: true, + passive: true, + }); + } + + setInterval(tick, TICK_MS); + document.addEventListener("visibilitychange", () => { + if (document.visibilityState === "hidden") save(); + }); + document.addEventListener("pause", save); +} + +/** + * Count lines the person typed. Called from the editor's update listener. + * Pastes, drops, undo/redo and formatters are ignored. + * @param {import("@codemirror/view").ViewUpdate} update + */ +function recordEdit(update) { + if (!started) return; + lastInput = Date.now(); + + let lines = 0; + for (const tr of update.transactions) { + if (!tr.docChanged || !tr.isUserEvent("input")) continue; + if (tr.isUserEvent("input.paste") || tr.isUserEvent("input.drop")) continue; + tr.changes.iterChanges((_fromA, _toA, _fromB, _toB, inserted) => { + lines += Math.max(0, inserted.lines - 1); + }); + } + + if (!lines) return; + today().lines += lines; + scheduleSave(); +} + +/** Count a file the person created (file tree or file browser). */ +function recordFileCreated() { + if (!started) return; + lastInput = Date.now(); + today().files += 1; + scheduleSave(); +} + +/** Wipe everything that was tracked. */ +function reset() { + days = {}; + save(); +} + +/** Roughly "minutes of coding" for one day, used to pick the shade. */ +function scoreOf(day) { + return day.ms / 60000 + day.lines / 4 + day.files * 2; +} + +function levelOf(score) { + let level = 0; + for (const [index, min] of LEVELS.entries()) { + if (score >= min) level = index + 1; + } + return level; +} + +/** + * Everything the profile page needs. + * @returns {{ + * year: Array<{date:string, ms:number, lines:number, files:number, level:number}>, + * totals: {ms:number, lines:number, files:number, activeDays:number}, + * current: number, + * longest: number, + * languages: Array<{name:string, ms:number, share:number}>, + * today: {ms:number, lines:number, files:number}, + * }} + */ +function getSummary() { + if (!started) load(); + + const year = []; + const now = new Date(); + for (let i = 364; i >= 0; i--) { + const date = new Date(now.getFullYear(), now.getMonth(), now.getDate() - i); + const key = dayKey(date); + const day = days[key] || normalizeDay(); + year.push({ + date: key, + ms: day.ms, + lines: day.lines, + files: day.files, + level: levelOf(scoreOf(day)), + }); + } + + const totals = { ms: 0, lines: 0, files: 0, activeDays: 0 }; + const languageMs = {}; + let longest = 0; + let run = 0; + for (const day of year) { + totals.ms += day.ms; + totals.lines += day.lines; + totals.files += day.files; + if (day.level > 0) { + totals.activeDays++; + run++; + longest = Math.max(longest, run); + } else { + run = 0; + } + for (const [name, ms] of Object.entries(days[day.date]?.langs || {})) { + languageMs[name] = (languageMs[name] || 0) + ms; + } + } + + // An unfinished day shouldn't break the streak. + let current = 0; + let i = year.length - 1; + if (year[i].level === 0) i--; + for (; i >= 0 && year[i].level > 0; i--) current++; + + const languageTotal = Object.values(languageMs).reduce((a, b) => a + b, 0); + const languages = Object.entries(languageMs) + .sort((a, b) => b[1] - a[1]) + .slice(0, 5) + .map(([name, ms]) => ({ name, ms, share: ms / languageTotal })); + + const latest = year[year.length - 1]; + return { + year, + totals, + current, + longest, + languages, + today: { ms: latest.ms, lines: latest.lines, files: latest.files }, + }; +} + +export default { + init, + recordEdit, + recordFileCreated, + reset, + getSummary, +}; diff --git a/src/pages/profile/github.js b/src/pages/profile/github.js deleted file mode 100644 index 3a85af58bd..0000000000 --- a/src/pages/profile/github.js +++ /dev/null @@ -1,171 +0,0 @@ -/** - * GitHub contribution data for the profile page. - * Data comes from the public github-contributions-api (no token needed) - * and is cached on the device so the graph still shows offline. - */ - -const API = "https://github-contributions-api.jogruber.de/v4"; -const USER_KEY = "acode-profile-github"; -const CACHE_KEY = "acode-profile-github-cache:"; -const CACHE_TTL = 6 * 60 * 60 * 1000; // 6 hours -const NAME_RE = /^[a-z\d](?:[a-z\d]|-(?=[a-z\d])){0,38}$/i; -const MONTHS = [ - "Jan", - "Feb", - "Mar", - "Apr", - "May", - "Jun", - "Jul", - "Aug", - "Sep", - "Oct", - "Nov", - "Dec", -]; - -function read(key) { - try { - return localStorage.getItem(key); - } catch { - return null; - } -} - -function write(key, value) { - try { - if (value === null || value === "") localStorage.removeItem(key); - else localStorage.setItem(key, value); - } catch {} -} - -/** Accepts "name", "@name" or a github.com URL. Returns "" if invalid. */ -export function cleanUsername(value) { - const name = String(value || "") - .trim() - .replace(/^https?:\/\/(www\.)?github\.com\//i, "") - .replace(/^@/, "") - .split(/[/?#]/)[0]; - return NAME_RE.test(name) ? name : ""; -} - -/** Username the person typed on this device (overrides the account's one). */ -export function getSavedUsername() { - return cleanUsername(read(USER_KEY)); -} - -export function saveUsername(name) { - write(USER_KEY, name || null); -} - -function normalize(json) { - const days = (json?.contributions || []) - .filter((d) => d?.date) - .map((d) => ({ - date: d.date, - count: Number(d.count) || 0, - level: Math.min(4, Math.max(0, Number(d.level) || 0)), - })) - .sort((a, b) => (a.date < b.date ? -1 : 1)); - - if (!days.length) throw new Error("empty"); - - let total = 0; - let longest = 0; - let run = 0; - for (const day of days) { - total += day.count; - if (day.count > 0) { - run++; - longest = Math.max(longest, run); - } else { - run = 0; - } - } - - // Today may not have a contribution yet, don't let that break the streak. - let current = 0; - let i = days.length - 1; - if (days[i].count === 0) i--; - for (; i >= 0 && days[i].count > 0; i--) current++; - - return { days, total, current, longest }; -} - -function readCache(key) { - try { - const raw = read(key); - return raw ? JSON.parse(raw) : null; - } catch { - return null; - } -} - -/** - * @param {string} username - * @param {{force?: boolean}} [options] - * @returns {Promise<{days: Array, total: number, current: number, longest: number, stale?: boolean}>} - */ -export async function fetchContributions(username, { force = false } = {}) { - const key = CACHE_KEY + username.toLowerCase(); - const cached = readCache(key); - - if (cached && !force && Date.now() - cached.at < CACHE_TTL) { - return cached.data; - } - - try { - const res = await fetch(`${API}/${encodeURIComponent(username)}?y=last`); - if (!res.ok) throw new Error(res.status === 404 ? "not-found" : "http"); - const data = normalize(await res.json()); - write(key, JSON.stringify({ at: Date.now(), data })); - return data; - } catch (error) { - if (cached && error.message !== "not-found") { - return { ...cached.data, stale: true }; - } - throw error; - } -} - -/** Groups days into Sunday-first weeks of 7 (null = padding). */ -export function buildWeeks(days) { - const weeks = []; - const offset = new Date(`${days[0].date}T00:00:00Z`).getUTCDay(); - let week = new Array(offset).fill(null); - - for (const day of days) { - week.push(day); - if (week.length === 7) { - weeks.push(week); - week = []; - } - } - if (week.length) { - while (week.length < 7) week.push(null); - weeks.push(week); - } - return weeks; -} - -/** Month name for the column where a new month starts, else undefined. */ -export function monthLabels(weeks) { - const starts = []; - let prev = -1; - weeks.forEach((week, i) => { - const day = week.find((d) => d?.date.endsWith("-01")) || week.find(Boolean); - if (!day) return; - const month = Number(day.date.slice(5, 7)) - 1; - if (month !== prev) { - starts.push({ i, month }); - prev = month; - } - }); - - // A tiny first month would collide with the next label, so drop it. - if (starts.length > 1 && starts[1].i - starts[0].i < 3) starts.shift(); - - const labels = {}; - for (const { i, month } of starts) labels[i] = MONTHS[month]; - return labels; -} diff --git a/src/pages/profile/heatmap.js b/src/pages/profile/heatmap.js new file mode 100644 index 0000000000..4c15e21555 --- /dev/null +++ b/src/pages/profile/heatmap.js @@ -0,0 +1,56 @@ +const MONTHS = [ + "Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec", +]; + +/** Groups days into Sunday-first weeks of 7 (null = padding). */ +export function buildWeeks(days) { + const weeks = []; + const offset = new Date(`${days[0].date}T00:00:00Z`).getUTCDay(); + let week = new Array(offset).fill(null); + + for (const day of days) { + week.push(day); + if (week.length === 7) { + weeks.push(week); + week = []; + } + } + if (week.length) { + while (week.length < 7) week.push(null); + weeks.push(week); + } + return weeks; +} + +/** Month name for the column where a new month starts, else undefined. */ +export function monthLabels(weeks) { + const starts = []; + let prev = -1; + weeks.forEach((week, i) => { + const day = week.find((d) => d?.date.endsWith("-01")) || week.find(Boolean); + if (!day) return; + const month = Number(day.date.slice(5, 7)) - 1; + if (month !== prev) { + starts.push({ i, month }); + prev = month; + } + }); + + // A tiny first month would collide with the next label, so drop it. + if (starts.length > 1 && starts[1].i - starts[0].i < 3) starts.shift(); + + const labels = {}; + for (const { i, month } of starts) labels[i] = MONTHS[month]; + return labels; +} diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 7154a38418..2063b16b7a 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -4,8 +4,8 @@ import Page from "components/page"; import Sidebar from "components/sidebar"; import toast from "components/toast"; import confirm from "dialogs/confirm"; -import prompt from "dialogs/prompt"; import actionStack from "lib/actionStack"; +import tracker from "lib/activity"; import config from "lib/config"; import { LOADED_PLUGINS } from "lib/loadPlugins"; import openFile from "lib/openFile"; @@ -14,14 +14,7 @@ import recents from "lib/recents"; import helpers from "utils/helpers"; import Uri from "utils/Uri"; import Url from "utils/Url"; -import { - buildWeeks, - cleanUsername, - fetchContributions, - getSavedUsername, - monthLabels, - saveUsername, -} from "./github"; +import { buildWeeks, monthLabels } from "./heatmap"; /* Feather-style stroke icons, so the page never depends on the icon font. */ const ICONS = { @@ -41,6 +34,8 @@ const ICONS = { '', login: '', + trash: + '', user: '', chevron: '', verified: @@ -63,14 +58,32 @@ function formatMonthYear(value) { }); } -function tipText({ count, date }) { - const when = new Date(`${date}T00:00:00Z`).toLocaleDateString(undefined, { +function formatDuration(ms) { + const minutes = Math.round(ms / 60000); + if (minutes < 1) return ms > 0 ? "<1m" : "0m"; + if (minutes < 60) return `${minutes}m`; + const hours = Math.floor(minutes / 60); + const rest = minutes % 60; + if (hours >= 100 || !rest) return `${hours}h`; + return `${hours}h ${rest}m`; +} + +const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`; + +function tipText(day) { + const when = new Date(`${day.date}T00:00:00Z`).toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric", timeZone: "UTC", }); - return `${count} contribution${count === 1 ? "" : "s"} on ${when}`; + if (!day.ms && !day.lines && !day.files) return `No activity on ${when}`; + return [ + when, + formatDuration(day.ms), + plural(day.lines, "line"), + plural(day.files, "file"), + ].join(" · "); } /** Same path breakdown the "recent" picker uses. */ @@ -255,7 +268,6 @@ export default function ProfileInclude({ onLogout, } = {}) { let user = initialUser; - let githubRun = 0; const $page = Page("Profile"); $page.classList.add("profile-page"); @@ -276,8 +288,9 @@ export default function ProfileInclude({ }; const $heroSlot =
; - const $logoutSlot =
; - const github = section("GitHub"); + const $footSlot =
; + const activity = section("Activity"); + const languages = section("Top languages"); /* ---------- account ---------- */ async function signIn() { @@ -301,6 +314,18 @@ export default function ProfileInclude({ refreshAccount(); } + async function resetActivity() { + const ok = await confirm( + "Reset activity", + "This clears the time, lines, files and streaks tracked on this device.", + ); + if (!ok) return; + tracker.reset(); + renderActivity(); + renderLanguages(); + toast("Activity reset"); + } + function renderHero() { $heroSlot.textContent = ""; $heroSlot.append( @@ -308,72 +333,42 @@ export default function ProfileInclude({ ); } - function renderLogout() { - $logoutSlot.textContent = ""; - if (!user) return; + function renderFoot() { + $footSlot.textContent = ""; const $card =
; $card.append( row({ - iconName: "logout", - title: strings.logout || "Logout", - danger: true, + iconName: "trash", + title: "Reset activity", chevron: false, - onclick: signOut, + onclick: resetActivity, }), ); - $logoutSlot.append($card); + if (user) { + $card.append( + row({ + iconName: "logout", + title: strings.logout || "Logout", + danger: true, + chevron: false, + onclick: signOut, + }), + ); + } + $footSlot.append($card); } function refreshAccount() { renderHero(); - renderLogout(); - renderGithub(); - } - - /* ---------- GitHub ---------- */ - /** Username typed on this device wins, otherwise the one on the account. */ - const githubName = () => getSavedUsername() || cleanUsername(user?.github); - - async function editGithub() { - const input = await prompt("GitHub username", githubName(), "text"); - if (input === null || input === undefined) return; - const raw = String(input).trim(); - if (!raw) { - saveUsername(""); - } else { - const name = cleanUsername(raw); - if (!name) { - toast("That doesn't look like a GitHub username"); - return; - } - saveUsername(name); - } - renderGithub(true); + renderFoot(); } - function githubMessage(text, ...buttons) { - const $actions =
; - for (const [label, handler, ghost] of buttons) { - $actions.append( - , - ); - } - return ( -
-
{text}
- {$actions} -
- ); - } + /* ---------- activity ---------- */ + activity.$trail.textContent = "Last 12 months"; - function drawGithub(data) { - const weeks = buildWeeks(data.days); + function renderActivity() { + const data = tracker.getSummary(); + const weeks = buildWeeks(data.year); const labels = monthLabels(weeks); const $grid =
; @@ -406,18 +401,22 @@ export default function ProfileInclude({ } $legend.append(More); - github.$body.textContent = ""; - github.$body.append( + const { today, totals } = data; + const todayText = today.ms + ? `Today ${formatDuration(today.ms)} · ${plural(today.lines, "line")}` + : "Nothing yet today"; + + activity.$body.textContent = ""; + activity.$body.append(
- {metric(data.total.toLocaleString(), "Contributions")} - {metric(`${data.current}d`, "Current streak")} - {metric(`${data.longest}d`, "Longest streak")} + {metric(formatDuration(totals.ms), "Coding time")} + {metric(totals.lines.toLocaleString(), "Lines")} + {metric(totals.files.toLocaleString(), "Files")} + {metric(`${data.current}d`, "Streak")}
, $scroll,
- - Change username - + {todayText} {$legend}
, ); @@ -426,50 +425,30 @@ export default function ProfileInclude({ setTimeout(() => { $scroll.scrollLeft = $scroll.scrollWidth; }, 50); - } - async function renderGithub(force = false) { - const run = ++githubRun; - const name = githubName(); - - github.$trail.textContent = ""; - github.$body.textContent = ""; + return data; + } - if (!name) { - github.$body.append( - githubMessage("Show your GitHub contributions here.", [ - "Add username", - editGithub, - ]), + function renderLanguages(list = tracker.getSummary().languages) { + languages.$body.textContent = ""; + if (!list.length) { + languages.$body.append( +
Languages show up here as you code.
, ); return; } - - github.$trail.append( - {`@${name}`}, - ); - github.$body.append(
Loading contributions…
); - - try { - const data = await fetchContributions(name, { force }); - if (run !== githubRun) return; - drawGithub(data); - } catch (error) { - if (run !== githubRun) return; - github.$body.textContent = ""; - const text = - error.message === "not-found" - ? `Couldn't find @${name} on GitHub.` - : "Couldn't load contributions. Check your connection."; - github.$body.append( - githubMessage( - text, - ["Retry", () => renderGithub(true)], - ["Change username", editGithub, true], - ), + for (const lang of list) { + const percent = Math.round(lang.share * 100); + languages.$body.append( +
+
+ {lang.name} + {`${percent}%`} +
+
+ +
+
, ); } } @@ -580,11 +559,12 @@ export default function ProfileInclude({ /* ---------- assemble ---------- */ const $main =
; - $main.append($heroSlot, github.$el); + $main.append($heroSlot, activity.$el, languages.$el); if (recentFiles.length || recentFolders.length) $main.append(recent.$el); - $main.append(menu.$el, $logoutSlot); + $main.append(menu.$el, $footSlot); refreshAccount(); + renderLanguages(renderActivity().languages); fillPlugins(); $page.body = $main; diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 86e21f9be2..03779a34ea 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -4,7 +4,7 @@ --pf-border: var(--border-color, rgba(255, 255, 255, 0.1)); --pf-danger: var(--danger-color, #ff5c5c); - /* GitHub graph: one blue, five steps (works on light and dark themes) */ + /* Activity graph: one blue, five steps (works on light and dark themes) */ --pf-lv0: color-mix(in srgb, var(--primary-text-color) 9%, transparent); --pf-lv1: color-mix(in srgb, var(--pf-blue) 28%, transparent); --pf-lv2: color-mix(in srgb, var(--pf-blue) 50%, transparent); @@ -170,6 +170,11 @@ color: var(--pf-muted); } + .pf-section-trail { + font-size: 12px; + color: var(--pf-muted); + } + .pf-card { display: flex; flex-direction: column; @@ -178,7 +183,7 @@ overflow: hidden; } - /* ---------- GitHub ---------- */ + /* ---------- activity ---------- */ .pf-metrics { display: flex; padding: 14px 8px 4px; @@ -186,17 +191,20 @@ .pf-metric { flex: 1; + min-width: 0; text-align: center; .pf-metric-value { - font-size: 18px; + font-size: 17px; font-weight: 600; + white-space: nowrap; } .pf-metric-label { margin-top: 2px; - font-size: 11.5px; + font-size: 11px; color: var(--pf-muted); + white-space: nowrap; } } @@ -248,9 +256,10 @@ .pf-gh-foot { display: flex; + flex-wrap: wrap; align-items: center; justify-content: space-between; - gap: 12px; + gap: 8px 12px; padding: 0 14px 12px; font-size: 12px; color: var(--pf-muted); @@ -265,6 +274,39 @@ span:last-child { margin-left: 4px; } } + /* ---------- languages ---------- */ + .pf-lang { + display: flex; + flex-direction: column; + gap: 8px; + padding: 12px 14px; + border-bottom: 1px solid var(--pf-border); + + &:last-child { border-bottom: none; } + + .pf-lang-head { + display: flex; + justify-content: space-between; + font-size: 14px; + } + + .pf-lang-percent { color: var(--pf-muted); } + + .pf-lang-bar { + height: 6px; + border-radius: 999px; + overflow: hidden; + background: var(--pf-lv0); + + span { + display: block; + height: 100%; + border-radius: 999px; + background: var(--pf-lv4); + } + } + } + /* ---------- rows ---------- */ .pf-row { display: flex; @@ -278,7 +320,6 @@ &:active { background: var(--pf-lv0); } > .pf-icon { color: var(--pf-muted); } - > .pf-icon:last-child { color: var(--pf-muted); } .pf-row-text { flex: 1; @@ -324,13 +365,6 @@ color: var(--pf-muted); } - .pf-actions { - display: flex; - flex-wrap: wrap; - justify-content: center; - gap: 8px; - } - .pf-btn { display: inline-flex; align-items: center; @@ -347,11 +381,6 @@ background: var(--pf-blue); &.small { padding: 7px 16px; font-size: 13px; margin-top: 0; } - &.ghost { - color: var(--primary-text-color); - background: transparent; - border-color: var(--pf-border); - } &:active { filter: brightness(0.9); } &:disabled { opacity: 0.6; } } From a25d562c71376d6eb9f2d6c3e8e05b20a4cd96a0 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:17 +0530 Subject: [PATCH 022/115] feat(sidebar): import activity tracker --- src/components/sidebar/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 19114f65b9..49c204d09f 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -4,6 +4,7 @@ import toast from "components/toast"; import loader from "dialogs/loader"; import Ref from "html-tag-js/ref"; import actionStack from "lib/actionStack"; +import activity from "lib/activity"; import auth, { loginEvents } from "lib/auth"; import config from "lib/config"; import helpers from "utils/helpers"; From 6e70625fc1ad22cd2ad604b09fa90e981fc5d0e4 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:23 +0530 Subject: [PATCH 023/115] feat(sidebar): start the activity tracker --- src/components/sidebar/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 49c204d09f..0e718bae30 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -93,6 +93,7 @@ function create($container, $toggler) { } loginEvents.addListener(updateSidebarAvatar); + activity.init(); async function handleUserIconClick() { let user = null; From e9cfc36673ac43ba67ead3f4578a8c40893c06cd Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:29 +0530 Subject: [PATCH 024/115] feat(editor): import activity tracker --- src/lib/editorManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/editorManager.js b/src/lib/editorManager.js index ea2b573299..580f1848ac 100644 --- a/src/lib/editorManager.js +++ b/src/lib/editorManager.js @@ -97,6 +97,7 @@ import ScrollBar from "components/scrollbar"; import SideButton, { sideButtonContainer } from "components/sideButton"; import keyboardHandler, { keydownState } from "handlers/keyboard"; import { animate } from "motion"; +import activity from "./activity"; import config from "./config"; import EditorFile, { AUTO_SAVE } from "./editorFile"; import openFile from "./openFile"; From e36b106fdd24124e0e8593145358ed67d27ae2ff Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:35 +0530 Subject: [PATCH 025/115] feat(editor): count typed lines for the activity graph --- src/lib/editorManager.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/editorManager.js b/src/lib/editorManager.js index 580f1848ac..c8af98b7b3 100644 --- a/src/lib/editorManager.js +++ b/src/lib/editorManager.js @@ -3679,6 +3679,7 @@ async function EditorManager($header, $body) { } file.markEdited(); + activity.recordEdit(update); // Debounced change handling (unsaved flag, cache, autosave) const timers = getDocSyncTimers(file); From 900a1e9757c3d821a4bc95a8a31acda1cf49e173 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:42 +0530 Subject: [PATCH 026/115] feat(helpers): import activity tracker --- src/utils/helpers.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/utils/helpers.js b/src/utils/helpers.js index e48e94bea0..095eb1af87 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -1,6 +1,7 @@ import fsOperation from "fileSystem"; import alert from "dialogs/alert"; import escapeStringRegexp from "escape-string-regexp"; +import activity from "lib/activity"; import adRewards from "lib/adRewards"; import config from "lib/config"; import fileIcons from "lib/fileIcons"; From 7064fa6f0f3d31f939383444e40be0176ae6b5c2 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 06:27:48 +0530 Subject: [PATCH 027/115] feat(helpers): count created files for the activity graph --- src/utils/helpers.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utils/helpers.js b/src/utils/helpers.js index 095eb1af87..7fdf99ccdd 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -425,6 +425,8 @@ export default { ? await fsOperation(baseUri).createFile(name) : await fsOperation(baseUri).createDirectory(name); + if (expectedType === "file") activity.recordFileCreated(); + return { url: createdUrl || targetUri, created: true, From 91cdec9f33bd88c1b9085616ceb13259b2026b8a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:03:38 +0530 Subject: [PATCH 028/115] fix(activity): credit languages only while typing; lines/files only affect colour --- src/lib/activity.js | 45 ++++++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/src/lib/activity.js b/src/lib/activity.js index 5bcd1d0891..ca9502ea7f 100644 --- a/src/lib/activity.js +++ b/src/lib/activity.js @@ -2,8 +2,9 @@ * Local coding activity for the profile page. * * Everything is stored on this device only (localStorage), one small record - * per day: time spent coding, lines written, files created and time per - * language. Nothing is sent anywhere. + * per day: time spent coding, lines written, files created and time spent + * typing in each language. Lines and files only influence how bright a day + * looks. Nothing is sent anywhere. */ import { getMode, getModeForPath } from "cm/modelist"; @@ -21,6 +22,8 @@ let days = {}; let started = false; let lastInput = 0; let lastTick = 0; +let lastEditAt = 0; +let lastEditLanguage = ""; let saveTimer = null; const pad = (n) => String(n).padStart(2, "0"); @@ -35,7 +38,7 @@ function normalizeDay(day) { ms: Number(day?.ms) || 0, lines: Number(day?.lines) || 0, files: Number(day?.files) || 0, - langs: day?.langs && typeof day.langs === "object" ? day.langs : {}, + code: day?.code && typeof day.code === "object" ? day.code : {}, }; } @@ -78,12 +81,6 @@ function languageOf(file) { return mode.caption || mode.name; } -function activeLanguage() { - const file = window.editorManager?.activeFile; - if (!file || file.type !== "editor") return ""; - return languageOf(file); -} - function tick() { const now = Date.now(); const elapsed = Math.min(now - lastTick, TICK_MS * 2); @@ -94,8 +91,11 @@ function tick() { const day = today(); day.ms += elapsed; - const language = activeLanguage(); - if (language) day.langs[language] = (day.langs[language] || 0) + elapsed; + // A language only gets credit while you are typing in it, so opening or + // scrolling a file doesn't count. + if (lastEditLanguage && now - lastEditAt <= IDLE_MS) { + day.code[lastEditLanguage] = (day.code[lastEditLanguage] || 0) + elapsed; + } scheduleSave(); } @@ -124,23 +124,34 @@ function init() { } /** - * Count lines the person typed. Called from the editor's update listener. - * Pastes, drops, undo/redo and formatters are ignored. + * Called from the editor's update listener. Typing and deleting credit the + * file's language; typed lines add to the day's score. Pastes, drops, + * undo/redo and formatters never count as lines. * @param {import("@codemirror/view").ViewUpdate} update + * @param {object} [file] the EditorFile being edited */ -function recordEdit(update) { +function recordEdit(update, file) { if (!started) return; - lastInput = Date.now(); + const now = Date.now(); + lastInput = now; let lines = 0; + let typed = false; for (const tr of update.transactions) { - if (!tr.docChanged || !tr.isUserEvent("input")) continue; + if (!tr.docChanged) continue; + if (!tr.isUserEvent("input") && !tr.isUserEvent("delete")) continue; + typed = true; if (tr.isUserEvent("input.paste") || tr.isUserEvent("input.drop")) continue; tr.changes.iterChanges((_fromA, _toA, _fromB, _toB, inserted) => { lines += Math.max(0, inserted.lines - 1); }); } + if (typed) { + lastEditAt = now; + lastEditLanguage = file ? languageOf(file) : ""; + } + if (!lines) return; today().lines += lines; scheduleSave(); @@ -217,7 +228,7 @@ function getSummary() { } else { run = 0; } - for (const [name, ms] of Object.entries(days[day.date]?.langs || {})) { + for (const [name, ms] of Object.entries(days[day.date]?.code || {})) { languageMs[name] = (languageMs[name] || 0) + ms; } } From 16e0e820782d38f35dde160b189f04616b344c38 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:03:45 +0530 Subject: [PATCH 029/115] fix(editor): tell the tracker which file is being edited --- src/lib/editorManager.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/editorManager.js b/src/lib/editorManager.js index c8af98b7b3..9e7e095cac 100644 --- a/src/lib/editorManager.js +++ b/src/lib/editorManager.js @@ -3679,7 +3679,7 @@ async function EditorManager($header, $body) { } file.markEdited(); - activity.recordEdit(update); + activity.recordEdit(update, file); // Debounced change handling (unsaved flag, cache, autosave) const timers = getDocSyncTimers(file); From 32b1cf7136966d0c644b7c78e03e7e98ac76af8f Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:03:51 +0530 Subject: [PATCH 030/115] refactor(profile): drop unused plural helper --- src/pages/profile/profile.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 2063b16b7a..5caa763537 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -68,8 +68,6 @@ function formatDuration(ms) { return `${hours}h ${rest}m`; } -const plural = (count, word) => `${count} ${word}${count === 1 ? "" : "s"}`; - function tipText(day) { const when = new Date(`${day.date}T00:00:00Z`).toLocaleDateString(undefined, { month: "short", From 3c278e501fd93385667f694d810dfd035f2afc9f Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:03:57 +0530 Subject: [PATCH 031/115] refactor(profile): tooltip shows only date and time --- src/pages/profile/profile.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 5caa763537..9e53881e19 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -75,13 +75,8 @@ function tipText(day) { year: "numeric", timeZone: "UTC", }); - if (!day.ms && !day.lines && !day.files) return `No activity on ${when}`; - return [ - when, - formatDuration(day.ms), - plural(day.lines, "line"), - plural(day.files, "file"), - ].join(" · "); + if (!day.level) return `No activity on ${when}`; + return `${when} · ${formatDuration(day.ms)}`; } /** Same path breakdown the "recent" picker uses. */ From 1d1086aeac7c8b9136c48d5281dc1bb64a9da37e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:04:03 +0530 Subject: [PATCH 032/115] refactor(profile): today summary shows only time --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 9e53881e19..5757a85ce5 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -396,7 +396,7 @@ export default function ProfileInclude({ const { today, totals } = data; const todayText = today.ms - ? `Today ${formatDuration(today.ms)} · ${plural(today.lines, "line")}` + ? `Today ${formatDuration(today.ms)}` : "Nothing yet today"; activity.$body.textContent = ""; From ebde5043e36edc13c43d3b590f890df07485811c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:04:10 +0530 Subject: [PATCH 033/115] refactor(profile): show only time, streak and active days --- src/pages/profile/profile.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 5757a85ce5..75aa789dc1 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -403,9 +403,8 @@ export default function ProfileInclude({ activity.$body.append(
{metric(formatDuration(totals.ms), "Coding time")} - {metric(totals.lines.toLocaleString(), "Lines")} - {metric(totals.files.toLocaleString(), "Files")} {metric(`${data.current}d`, "Streak")} + {metric(String(totals.activeDays), "Active days")}
, $scroll,
From 9321b03e1fc12ca6b723dbd9fbb63122ef562ef1 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:57:52 +0530 Subject: [PATCH 034/115] i18n(profile): add strings for the profile page --- src/lang/en-us.json | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 2869c6c2c2..23b1e76d32 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -887,5 +887,24 @@ "plugin-review:error-max-length": "Review must be {max} characters or less.", "plugin-review:error-downvote-comment": "Tell the developer what could be improved.", "plugin-review:error-empty": "Add a comment or choose thumbs up.", - "plugin-review:unrated": "Unrated" + "plugin-review:unrated": "Unrated", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?" } From 5ed375ac1304d01ace18b003803d4d1eeba9a0a6 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:58:01 +0530 Subject: [PATCH 035/115] chore(sidebar): remove unused user-menu styles --- src/components/sidebar/style.scss | 77 ------------------------------- 1 file changed, 77 deletions(-) diff --git a/src/components/sidebar/style.scss b/src/components/sidebar/style.scss index 8927015a24..9954c645d0 100644 --- a/src/components/sidebar/style.scss +++ b/src/components/sidebar/style.scss @@ -412,80 +412,3 @@ body.no-animation { transform: scale(0.94); } } - -.user-menu { - position: absolute; - bottom: 55px; - left: 30px; - width: 200px; - background-color: var(--popup-background-color); - border: 1px solid var(--border-color); - border-radius: 6px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); - display: none; - z-index: 1000; - overflow: hidden; - - &.active { - display: block; - } - - .user-menu-header { - padding: 12px; - border-bottom: 1px solid var(--border-color); - - .user-menu-name { - font-weight: 500; - margin-bottom: 4px; - - .badge { - display: inline-flex; - align-items: center; - background-color: var(--popup-background-color); - background-color: color-mix(in srgb, - var(--error-text-color) 20%, - transparent); - color: var(--error-text-color); - padding: 2px 6px; - border-radius: 4px; - font-size: 12px; - font-weight: 500; - margin-left: 4px; - - &.verified { - color: var(--active-color); - background-color: transparent; - padding: 0; - } - } - } - - .user-menu-email { - font-size: 12px; - color: var(--popup-text-color); - color: color-mix(in srgb, var(--popup-text-color) 70%, transparent); - } - } - - .user-menu-item { - padding: 10px 12px; - cursor: pointer; - display: flex; - align-items: center; - gap: 8px; - - &:hover { - background-color: var(--active-icon-color); - } - } - - .user-menu-separator { - height: 1px; - background-color: var(--border-color); - margin: 4px 0; - } -} - -@supports not (gap: 1px) { - .user-menu-item > * + * { margin-left: 8px; } -} From f6a06b6998b213c89f9d91f196629ab476b75f62 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:58:10 +0530 Subject: [PATCH 036/115] fix(sidebar): ignore repeat avatar taps and show a loader on slow account checks --- src/components/sidebar/index.js | 41 +++++++++++++++++++++++++++------ 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/src/components/sidebar/index.js b/src/components/sidebar/index.js index 0e718bae30..b5ec00847c 100644 --- a/src/components/sidebar/index.js +++ b/src/components/sidebar/index.js @@ -95,16 +95,40 @@ function create($container, $toggler) { loginEvents.addListener(updateSidebarAvatar); activity.init(); + let openingProfile = false; + async function handleUserIconClick() { - let user = null; - try { - user = await auth.getLoggedInUser(); - } catch (error) { - // offline or server error: still open the page as signed out - console.error("Error checking login status:", error); - } + // A second tap while the profile is still opening would stack two pages. + if (openingProfile) return; + openingProfile = true; + + // Cached users resolve instantly, so only show a loader if the + // account check is actually slow. + let loaderShown = false; + const loaderTimer = setTimeout(() => { + loaderShown = true; + loader.create(strings["login"], strings["loading..."]); + loader.show(); + }, 250); + + const stopLoader = () => { + clearTimeout(loaderTimer); + if (loaderShown) { + loaderShown = false; + loader.destroy(); + } + }; try { + let user = null; + try { + user = await auth.getLoggedInUser(); + } catch (error) { + // offline or server error: still open the page as signed out + console.error("Error checking login status:", error); + } + stopLoader(); + const { default: openProfile } = await import( /* webpackChunkName: "profile" */ "pages/profile" ); @@ -116,6 +140,9 @@ function create($container, $toggler) { }); } catch (error) { console.error("Error opening profile:", error); + } finally { + stopLoader(); + openingProfile = false; } } From 4f0b844eccc6b290d60336e30e4600fa0418c805 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:59:20 +0530 Subject: [PATCH 037/115] fix(profile): translatable strings and consistent row value styling - route every user-facing string through strings[] with an English fallback - reuse existing keys where they exist (login, logout, settings, about, ...) - wrap plain-string row values in .pf-row-value so they are muted like the plugin count - drop the hardcoded 'Verified' title attribute --- src/pages/profile/profile.js | 111 +++++++++++++++++++++++------------ 1 file changed, 75 insertions(+), 36 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 75aa789dc1..2b4480186a 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -42,6 +42,22 @@ const ICONS = { '', }; +/** + * Translated string with an English fallback, so a key that has not been + * added to a language file yet still shows readable text. + * `{name}` placeholders are filled from `vars`. + * @param {string} key + * @param {string} fallback + * @param {Record} [vars] + */ +function t(key, fallback, vars = {}) { + let text = strings[key] || fallback; + for (const [name, value] of Object.entries(vars)) { + text = text.replaceAll(`{${name}}`, String(value)); + } + return text; +} + function icon(name, size = 20) { const el = document.createElement("span"); el.className = "pf-icon"; @@ -75,7 +91,9 @@ function tipText(day) { year: "numeric", timeZone: "UTC", }); - if (!day.level) return `No activity on ${when}`; + if (!day.level) { + return t("no activity on", "No activity on {date}", { date: when }); + } return `${when} · ${formatDuration(day.ms)}`; } @@ -134,7 +152,16 @@ function row({ {$text}
); - if (value) $row.append(value); + if (value) { + // Plain strings get the same muted style as element values. + $row.append( + typeof value === "string" ? ( + {value} + ) : ( + value + ), + ); + } if (chevron) $row.append(icon("chevron", 18)); return $row; } @@ -178,7 +205,7 @@ function buildUserHero(user, getAvatarSrc) {
); if (user.verified) { - const $v = ; + const $v = ; $v.append(icon("verified", 16)); $nameRow.append($v); } @@ -192,7 +219,9 @@ function buildUserHero(user, getAvatarSrc) { const $meta =
; const since = formatMonthYear(user.created_at); if (since) { - $meta.append({`Member since ${since}`}); + $meta.append( + {t("member since", "Member since {date}", { date: since })}, + ); } if (user.website) { const site = String(user.website); @@ -219,18 +248,19 @@ function buildUserHero(user, getAvatarSrc) { /** Header shown when nobody is logged in, with a sign in button. */ function buildGuestHero(onSignIn) { - const $label = Sign in; + const signInText = t("login", "Login"); + const $label = {signInText}; const $btn = ; $btn.append(icon("login", 16), $label); $btn.onclick = async () => { if ($btn.disabled) return; $btn.disabled = true; - $label.textContent = "Waiting for sign in…"; + $label.textContent = t("loading...", "Loading..."); try { await onSignIn(); } finally { $btn.disabled = false; - $label.textContent = "Sign in"; + $label.textContent = signInText; } }; @@ -238,8 +268,12 @@ function buildGuestHero(onSignIn) {
{icon("user", 30)}
-

Not signed in

-
Sign in with your Acode account.
+

+ {t("profile not signed in", "Not signed in")} +

+
+ {t("profile sign in prompt", "Sign in with your Acode account.")} +
{$btn}
@@ -262,7 +296,7 @@ export default function ProfileInclude({ } = {}) { let user = initialUser; - const $page = Page("Profile"); + const $page = Page(t("my profile", "My profile")); $page.classList.add("profile-page"); const close = () => { @@ -282,8 +316,8 @@ export default function ProfileInclude({ const $heroSlot =
; const $footSlot =
; - const activity = section("Activity"); - const languages = section("Top languages"); + const activity = section(t("activity", "Activity")); + const languages = section(t("top languages", "Top languages")); /* ---------- account ---------- */ async function signIn() { @@ -297,8 +331,8 @@ export default function ProfileInclude({ async function signOut() { const ok = await confirm( - strings.logout || "Logout", - "Are you sure you want to log out of your Acode account?", + t("logout", "Logout"), + t("logout confirm", "Are you sure you want to log out of your Acode account?"), ); if (!ok) return; const success = onLogout ? await onLogout() : true; @@ -309,14 +343,17 @@ export default function ProfileInclude({ async function resetActivity() { const ok = await confirm( - "Reset activity", - "This clears the time, lines, files and streaks tracked on this device.", + t("reset activity", "Reset activity"), + t( + "reset activity warning", + "This clears the time, lines, files and streaks tracked on this device.", + ), ); if (!ok) return; tracker.reset(); renderActivity(); renderLanguages(); - toast("Activity reset"); + toast(t("activity reset", "Activity reset")); } function renderHero() { @@ -332,7 +369,7 @@ export default function ProfileInclude({ $card.append( row({ iconName: "trash", - title: "Reset activity", + title: t("reset activity", "Reset activity"), chevron: false, onclick: resetActivity, }), @@ -341,7 +378,7 @@ export default function ProfileInclude({ $card.append( row({ iconName: "logout", - title: strings.logout || "Logout", + title: t("logout", "Logout"), danger: true, chevron: false, onclick: signOut, @@ -357,7 +394,7 @@ export default function ProfileInclude({ } /* ---------- activity ---------- */ - activity.$trail.textContent = "Last 12 months"; + activity.$trail.textContent = t("last 12 months", "Last 12 months"); function renderActivity() { const data = tracker.getSummary(); @@ -388,23 +425,23 @@ export default function ProfileInclude({ const $scroll =
{$grid}
; const $legend =
; - $legend.append(Less); + $legend.append({t("less", "Less")}); for (let n = 0; n <= 4; n++) { $legend.append(); } - $legend.append(More); + $legend.append({t("more", "More")}); const { today, totals } = data; const todayText = today.ms - ? `Today ${formatDuration(today.ms)}` - : "Nothing yet today"; + ? t("today time", "Today {time}", { time: formatDuration(today.ms) }) + : t("nothing yet today", "Nothing yet today"); activity.$body.textContent = ""; activity.$body.append(
- {metric(formatDuration(totals.ms), "Coding time")} - {metric(`${data.current}d`, "Streak")} - {metric(String(totals.activeDays), "Active days")} + {metric(formatDuration(totals.ms), t("coding time", "Coding time"))} + {metric(`${data.current}d`, t("streak", "Streak"))} + {metric(String(totals.activeDays), t("active days", "Active days"))}
, $scroll,
@@ -425,7 +462,9 @@ export default function ProfileInclude({ languages.$body.textContent = ""; if (!list.length) { languages.$body.append( -
Languages show up here as you code.
, +
+ {t("languages empty", "Languages show up here as you code.")} +
, ); return; } @@ -446,7 +485,7 @@ export default function ProfileInclude({ } /* ---------- recents ---------- */ - const recent = section("Recent"); + const recent = section(t("recently used", "Recently used")); const recentFiles = recents.files.filter(Boolean).slice(0, 4); const recentFolders = recents.folders.filter((f) => f?.url).slice(0, 2); @@ -484,11 +523,11 @@ export default function ProfileInclude({ // Plugins page, which starts on its "Installed" tab. const $pluginCount = –; - const menu = section("More"); + const menu = section(t("more", "More")); const menuRows = [ { iconName: "package", - title: "Downloaded plugins", + title: t("plugins", "Plugins"), value: $pluginCount, onclick: goto(async () => ( @@ -498,7 +537,7 @@ export default function ProfileInclude({ }, { iconName: "sliders", - title: "Settings", + title: t("settings", "Settings"), onclick: goto(async () => ( await import( @@ -509,7 +548,7 @@ export default function ProfileInclude({ }, { iconName: "contrast", - title: "App theme", + title: t("app theme", "App theme"), onclick: goto(async () => ( await import( @@ -520,18 +559,18 @@ export default function ProfileInclude({ }, { iconName: "folder", - title: "Open folder", + title: t("open folder", "Open folder"), onclick: goto(() => acode.exec("open-folder")), }, { iconName: "external", - title: "Acode account", + title: t("acode account", "Acode account"), value: String(config.BASE_URL || "").replace(/^https?:\/\//, ""), onclick: openUrl(config.BASE_URL), }, { iconName: "info", - title: "About", + title: t("about", "About"), value: window.BuildInfo?.version || "", onclick: goto(async () => (await import(/* webpackChunkName: "about" */ "pages/about")).default(), From 8553ee57345074b0a6b8abada63fe96229711085 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 07:59:37 +0530 Subject: [PATCH 038/115] style(profile): fix Biome formatting in signOut --- src/pages/profile/profile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 2b4480186a..0946c487ca 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -332,7 +332,10 @@ export default function ProfileInclude({ async function signOut() { const ok = await confirm( t("logout", "Logout"), - t("logout confirm", "Are you sure you want to log out of your Acode account?"), + t( + "logout confirm", + "Are you sure you want to log out of your Acode account?", + ), ); if (!ok) return; const success = onLogout ? await onLogout() : true; From 56ec551eb2aca62c1a0751d8d8a46c4a6d39a588 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:05:41 +0530 Subject: [PATCH 039/115] i18n(profile): add best streak string --- src/lang/en-us.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index 23b1e76d32..b898891776 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -906,5 +906,6 @@ "reset activity": "Reset activity", "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", "activity reset": "Activity reset", - "logout confirm": "Are you sure you want to log out of your Acode account?" + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak" } From ee7faf3a85f81818f1f6df516e8312a211153a8e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:05:49 +0530 Subject: [PATCH 040/115] feat(profile): language colors helper --- src/pages/profile/profile.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 0946c487ca..f912f9d190 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -58,6 +58,40 @@ function t(key, fallback, vars = {}) { return text; } +/* Familiar colors for common languages; anything else gets a stable hue. */ +const LANG_COLORS = { + javascript: "#f1e05a", + jsx: "#f1e05a", + typescript: "#3178c6", + tsx: "#3178c6", + html: "#e34c26", + css: "#7b5bb6", + scss: "#c6538c", + json: "#8f9aa5", + markdown: "#519aba", + python: "#3572a5", + java: "#b07219", + kotlin: "#a97bff", + php: "#4f5d95", + go: "#00add8", + rust: "#dea584", + ruby: "#cc342d", + yaml: "#cb171e", + xml: "#0060ac", + sql: "#e38c00", + dart: "#00b4ab", + swift: "#f05138", + lua: "#4a5bd1", +}; + +function langColor(name) { + const key = String(name).toLowerCase(); + if (LANG_COLORS[key]) return LANG_COLORS[key]; + let hue = 0; + for (const ch of key) hue = (hue * 31 + ch.charCodeAt(0)) % 360; + return `hsl(${hue} 55% 55%)`; +} + function icon(name, size = 20) { const el = document.createElement("span"); el.className = "pf-icon"; From f4e15544c74def670471ecfd92f422429d90fe0b Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:05:56 +0530 Subject: [PATCH 041/115] feat(profile): show best streak --- src/pages/profile/profile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index f912f9d190..08f7010064 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -478,6 +478,7 @@ export default function ProfileInclude({
{metric(formatDuration(totals.ms), t("coding time", "Coding time"))} {metric(`${data.current}d`, t("streak", "Streak"))} + {metric(`${data.longest}d`, t("best streak", "Best streak"))} {metric(String(totals.activeDays), t("active days", "Active days"))}
, $scroll, From cba25ea5f8e65a02ffdb8fe5751c0a2aff94cff4 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:04 +0530 Subject: [PATCH 042/115] feat(profile): stacked language strip with per-language colors --- src/pages/profile/profile.js | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 08f7010064..41626a0e0d 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -506,17 +506,31 @@ export default function ProfileInclude({ ); return; } + const $strip =
; for (const lang of list) { - const percent = Math.round(lang.share * 100); + $strip.append( + , + ); + } + languages.$body.append($strip); + + for (const lang of list) { + const percent = lang.share * 100; + const label = percent < 1 ? "<1%" : `${Math.round(percent)}%`; languages.$body.append(
-
- {lang.name} - {`${percent}%`} -
-
- -
+ + {lang.name} + {label}
, ); } From 2054b552bf6701357f9a66e20e5d217d84eebcc7 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:11 +0530 Subject: [PATCH 043/115] style(profile): follow the theme's accent color --- src/pages/profile/profile.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 03779a34ea..dd4e70270d 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -1,5 +1,7 @@ #profile-page { --pf-blue: #3b82f6; + /* Follows the active theme; the button keeps a fixed blue for contrast. */ + --pf-accent: var(--active-color, var(--pf-blue)); --pf-muted: color-mix(in srgb, var(--primary-text-color) 60%, transparent); --pf-border: var(--border-color, rgba(255, 255, 255, 0.1)); --pf-danger: var(--danger-color, #ff5c5c); From bfbaf8a5194dbbf488eee03c6c85fffe2c41497b Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:18 +0530 Subject: [PATCH 044/115] style(profile): heatmap shades use the accent color --- src/pages/profile/profile.scss | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index dd4e70270d..6797bf7ec6 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -8,10 +8,10 @@ /* Activity graph: one blue, five steps (works on light and dark themes) */ --pf-lv0: color-mix(in srgb, var(--primary-text-color) 9%, transparent); - --pf-lv1: color-mix(in srgb, var(--pf-blue) 28%, transparent); - --pf-lv2: color-mix(in srgb, var(--pf-blue) 50%, transparent); - --pf-lv3: color-mix(in srgb, var(--pf-blue) 75%, transparent); - --pf-lv4: var(--pf-blue); + --pf-lv1: color-mix(in srgb, var(--pf-accent) 28%, transparent); + --pf-lv2: color-mix(in srgb, var(--pf-accent) 50%, transparent); + --pf-lv3: color-mix(in srgb, var(--pf-accent) 75%, transparent); + --pf-lv4: var(--pf-accent); box-sizing: border-box; width: 100%; From 47f5ebe91d5d71571522580c633197cf71158228 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:24 +0530 Subject: [PATCH 045/115] style(profile): links use the accent color --- src/pages/profile/profile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 6797bf7ec6..d4561d9be0 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -37,7 +37,7 @@ } .pf-link { - color: var(--pf-blue); + color: var(--pf-accent); &:active { opacity: 0.6; } } From c3c8a1f08423857cd0c866adc6c62e49c3294b2e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:31 +0530 Subject: [PATCH 046/115] style(profile): verified tick uses the accent color --- src/pages/profile/profile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index d4561d9be0..6a1e9e4802 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -111,7 +111,7 @@ .pf-verified { display: inline-flex; - color: var(--pf-blue); + color: var(--pf-accent); } .pf-badge { From 107f6bbc97cc8fa046305332c5d9c4d7888a406b Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:37 +0530 Subject: [PATCH 047/115] style(profile): meta link uses the accent color --- src/pages/profile/profile.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 6a1e9e4802..076c467746 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -145,7 +145,7 @@ font-size: 12.5px; color: var(--pf-muted); - .pf-link { color: var(--pf-blue); } + .pf-link { color: var(--pf-accent); } } /* ---------- sections ---------- */ From 3a5fad0fcee93fa3b16c81b756ff10d94df4897d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:06:45 +0530 Subject: [PATCH 048/115] feat(profile): stacked language strip styles --- src/pages/profile/profile.scss | 50 ++++++++++++++++++++-------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 076c467746..b4fb9f9509 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -277,36 +277,46 @@ } /* ---------- languages ---------- */ + .pf-lang-strip { + display: flex; + gap: 2px; + height: 8px; + margin: 14px 14px 6px; + border-radius: 999px; + overflow: hidden; + + .pf-lang-seg { + flex: 1 1 0; + min-width: 4px; + } + } + .pf-lang { display: flex; - flex-direction: column; - gap: 8px; - padding: 12px 14px; + align-items: center; + gap: 10px; + padding: 10px 14px; border-bottom: 1px solid var(--pf-border); + font-size: 14px; &:last-child { border-bottom: none; } - .pf-lang-head { - display: flex; - justify-content: space-between; - font-size: 14px; + .pf-lang-dot { + flex-shrink: 0; + width: 10px; + height: 10px; + border-radius: 50%; } - .pf-lang-percent { color: var(--pf-muted); } - - .pf-lang-bar { - height: 6px; - border-radius: 999px; + .pf-lang-name { + flex: 1; + min-width: 0; overflow: hidden; - background: var(--pf-lv0); - - span { - display: block; - height: 100%; - border-radius: 999px; - background: var(--pf-lv4); - } + text-overflow: ellipsis; + white-space: nowrap; } + + .pf-lang-percent { color: var(--pf-muted); } } /* ---------- rows ---------- */ From 6538bd7abbbb7d1679b2e6513efe3ea63ccb86a2 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:09:35 +0530 Subject: [PATCH 049/115] i18n(profile): add this week string --- src/lang/en-us.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lang/en-us.json b/src/lang/en-us.json index b898891776..7d638e3ea9 100644 --- a/src/lang/en-us.json +++ b/src/lang/en-us.json @@ -907,5 +907,6 @@ "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", "activity reset": "Activity reset", "logout confirm": "Are you sure you want to log out of your Acode account?", - "best streak": "Best streak" + "best streak": "Best streak", + "this week": "This week" } From 7dbfe3647ea178a1dccbf129edbd0c5b782a0630 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:09:46 +0530 Subject: [PATCH 050/115] feat(profile): heatmap weekday labels, today ring and tap highlight --- src/pages/profile/profile.js | 43 ++++++++++++++++++++++++++++++------ 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 41626a0e0d..3875623d26 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -437,30 +437,59 @@ export default function ProfileInclude({ const data = tracker.getSummary(); const weeks = buildWeeks(data.year); const labels = monthLabels(weeks); + const todayKey = data.year[data.year.length - 1].date; const $grid =
; weeks.forEach((week, i) => { const $week =
; $week.append(
{labels[i] || ""}
); for (const day of week) { - const $cell = ( -
- ); + let cellClass = "pf-gh-cell none"; + if (day) { + cellClass = `pf-gh-cell lv${day.level}`; + if (day.date === todayKey) cellClass += " today"; + } + const $cell =
; if (day) $cell.dataset.tip = tipText(day); $week.append($cell); } $grid.append($week); }); + // Tapping a day highlights it and shows its details. + let $selected = null; $grid.onclick = (e) => { - const tip = e.target?.dataset?.tip; - if (tip) toast(tip); + const $cell = e.target; + const tip = $cell?.dataset?.tip; + if (!tip) return; + $selected?.classList.remove("selected"); + $selected = $cell; + $cell.classList.add("selected"); + toast(tip); }; const $scroll =
{$grid}
; + // Weekday labels (Mon/Wed/Fri) stay put while the grid scrolls. + const $days =
; + $days.append(
); + for (let row = 0; row < 7; row++) { + // 2024-01-07 was a Sunday, matching the Sunday-first grid. + const name = + row % 2 === 1 + ? new Date(2024, 0, 7 + row).toLocaleDateString(undefined, { + weekday: "short", + }) + : ""; + $days.append(
{name}
); + } + const $heat = ( +
+ {$days} + {$scroll} +
+ ); + const $legend =
; $legend.append({t("less", "Less")}); for (let n = 0; n <= 4; n++) { From 7b065b3e0acb56829745e02947a3337f8b1f4fef Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:09:52 +0530 Subject: [PATCH 051/115] feat(profile): render heatmap with its weekday labels --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 3875623d26..189a84a85f 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -510,7 +510,7 @@ export default function ProfileInclude({ {metric(`${data.longest}d`, t("best streak", "Best streak"))} {metric(String(totals.activeDays), t("active days", "Active days"))}
, - $scroll, + $heat,
{todayText} {$legend} From 53c1f7b5aeef7e3cca77b3a661d882801c2e2738 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:01 +0530 Subject: [PATCH 052/115] feat(profile): this week bar chart --- src/pages/profile/profile.js | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 189a84a85f..94804eb984 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -522,9 +522,45 @@ export default function ProfileInclude({ $scroll.scrollLeft = $scroll.scrollWidth; }, 50); + renderWeek(data); return data; } + /* ---------- this week (last 7 days) ---------- */ + const thisWeek = section(t("this week", "This week")); + + function renderWeek(data) { + const days = data.year.slice(-7); + const max = Math.max(...days.map((day) => day.ms), 1); + const total = days.reduce((sum, day) => sum + day.ms, 0); + thisWeek.$trail.textContent = total ? formatDuration(total) : ""; + + const $chart =
; + days.forEach((day, i) => { + const isToday = i === days.length - 1; + const percent = day.ms + ? Math.max(8, Math.round((day.ms / max) * 100)) + : 0; + const barClass = ["pf-week-bar", !day.ms && "empty", isToday && "today"] + .filter(Boolean) + .join(" "); + const name = new Date(`${day.date}T00:00:00Z`).toLocaleDateString( + undefined, + { weekday: "short", timeZone: "UTC" }, + ); + $chart.append( +
toast(tipText(day))}> +
+ +
+ {name} +
, + ); + }); + thisWeek.$body.textContent = ""; + thisWeek.$body.append($chart); + } + function renderLanguages(list = tracker.getSummary().languages) { languages.$body.textContent = ""; if (!list.length) { From 2ac7f085b99c16d22d67075b2bd6cd53fa8015ac Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:07 +0530 Subject: [PATCH 053/115] feat(profile): add this week section to the page --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 94804eb984..4e0d8b355c 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -707,7 +707,7 @@ export default function ProfileInclude({ /* ---------- assemble ---------- */ const $main =
; - $main.append($heroSlot, activity.$el, languages.$el); + $main.append($heroSlot, activity.$el, thisWeek.$el, languages.$el); if (recentFiles.length || recentFolders.length) $main.append(recent.$el); $main.append(menu.$el, $footSlot); From b654c692ff7ef8e5a1c5e14ead4705b0ea8b64e5 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:14 +0530 Subject: [PATCH 054/115] style(profile): heatmap scroll area sits beside the weekday labels --- src/pages/profile/profile.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index b4fb9f9509..5d1e7bce7d 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -211,8 +211,10 @@ } .pf-gh-scroll { + flex: 1; + min-width: 0; overflow-x: auto; - padding: 14px 14px 10px; + padding: 14px 14px 10px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; From 92e389bfa69b668efecaab147cd16359ea055a1a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:20 +0530 Subject: [PATCH 055/115] style(profile): today ring and selected-cell highlight --- src/pages/profile/profile.scss | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 5d1e7bce7d..255d50e50c 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -256,6 +256,8 @@ &.lv3 { background: var(--pf-lv3); } &.lv4 { background: var(--pf-lv4); } &.none { background: transparent; } + &.today { box-shadow: 0 0 0 1.5px var(--pf-muted); } + &.selected { box-shadow: 0 0 0 1.5px var(--primary-text-color); } } .pf-gh-foot { From bd9b976cebfcb1f40aab9b19de701166d307c614 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:27 +0530 Subject: [PATCH 056/115] style(profile): weekday label column for the heatmap --- src/pages/profile/profile.scss | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 255d50e50c..5a64c63ed8 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -260,6 +260,30 @@ &.selected { box-shadow: 0 0 0 1.5px var(--primary-text-color); } } + .pf-gh-wrap { + display: flex; + align-items: flex-start; + } + + /* Rows line up with the grid: spacer = month label row, then 7 days. */ + .pf-gh-days { + flex: none; + display: flex; + flex-direction: column; + gap: 3px; + padding: 14px 0 10px 14px; + + .pf-gh-spacer { height: 14px; } + + .pf-gh-daylabel { + height: 11px; + line-height: 11px; + font-size: 9.5px; + white-space: nowrap; + color: var(--pf-muted); + } + } + .pf-gh-foot { display: flex; flex-wrap: wrap; From d331a205e308af06d283ea7458efa8f22db41bde Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 08:10:35 +0530 Subject: [PATCH 057/115] style(profile): this week bar chart --- src/pages/profile/profile.scss | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 5a64c63ed8..c4777c2bd1 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -304,6 +304,54 @@ span:last-child { margin-left: 4px; } } + /* ---------- this week ---------- */ + .pf-week { + display: flex; + gap: 8px; + padding: 16px 14px 12px; + } + + .pf-week-col { + flex: 1; + min-width: 0; + display: flex; + flex-direction: column; + align-items: center; + gap: 8px; + + &:active { opacity: 0.7; } + } + + .pf-week-area { + display: flex; + align-items: flex-end; + justify-content: center; + width: 100%; + height: 64px; + } + + .pf-week-bar { + display: block; + width: 100%; + max-width: 26px; + min-height: 3px; + border-radius: 5px; + background: color-mix(in srgb, var(--pf-accent) 55%, transparent); + + &.empty { background: var(--pf-lv0); } + &.today { background: var(--pf-accent); } + } + + .pf-week-day { + font-size: 11px; + color: var(--pf-muted); + + &.today { + color: var(--primary-text-color); + font-weight: 600; + } + } + /* ---------- languages ---------- */ .pf-lang-strip { display: flex; From 5edc2fc2cc24f0969d33142c97a6d267afea77c9 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:03:27 +0530 Subject: [PATCH 058/115] style(profile): fix Biome formatting in week chart --- src/pages/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 4e0d8b355c..32743ae107 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -553,7 +553,9 @@ export default function ProfileInclude({
- {name} + + {name} +
, ); }); From 665d2b2c7c1513703a7c95bea60e39c0ef15af17 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:03:44 +0530 Subject: [PATCH 059/115] i18n(ar-ye): add profile page strings --- src/lang/ar-ye.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ar-ye.json b/src/lang/ar-ye.json index 67b21b3d7c..f05022a7cc 100644 --- a/src/lang/ar-ye.json +++ b/src/lang/ar-ye.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "يجب ألا يتجاوز التقييم {max} حرفًا.", "plugin-review:error-downvote-comment": "أخبر المطوّر بما يمكن تحسينه.", "plugin-review:error-empty": "أضف تعليقًا أو اختر «أعجبني».", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "غير مقيّم", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From bea47b617533566765eaa2c4bf3067e2757a0757 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:03:52 +0530 Subject: [PATCH 060/115] i18n(az-az): add profile page strings --- src/lang/az-az.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/az-az.json b/src/lang/az-az.json index 6285bb588a..c398d6f4a4 100644 --- a/src/lang/az-az.json +++ b/src/lang/az-az.json @@ -887,5 +887,26 @@ "plugin-review:error-max-length": "Rəy ən çox {max} simvoldan ibarət olmalıdır.", "plugin-review:error-downvote-comment": "Nəyin yaxşılaşdırıla biləcəyini tərtibatçıya bildir.", "plugin-review:error-empty": "Şərh əlavə et və ya «Bəyən» seçimini et.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Qiymətləndirilməyib" } From a32861047ba84c11d302af3288de7cc7ec07196d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:03:59 +0530 Subject: [PATCH 061/115] i18n(be-by): add profile page strings --- src/lang/be-by.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/be-by.json b/src/lang/be-by.json index 98601603c2..52ee81de3f 100644 --- a/src/lang/be-by.json +++ b/src/lang/be-by.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Водгук павінен змяшчаць не больш за {max} сімвалаў.", "plugin-review:error-downvote-comment": "Раскажыце распрацоўшчыку, што можна палепшыць.", "plugin-review:error-empty": "Дадайце каментарый або выберыце «Падабаецца».", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Без ацэнкі", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 32ce36e736152ce77e79532f678d7366f937d99c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:08 +0530 Subject: [PATCH 062/115] i18n(bn-bd): add profile page strings --- src/lang/bn-bd.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/bn-bd.json b/src/lang/bn-bd.json index c439ccecdc..1a74549ee5 100644 --- a/src/lang/bn-bd.json +++ b/src/lang/bn-bd.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "পর্যালোচনা {max} অক্ষর বা তার কম হতে হবে।", "plugin-review:error-downvote-comment": "কী উন্নত করা যায় তা ডেভেলপারকে জানান।", "plugin-review:error-empty": "একটি মন্তব্য যোগ করুন বা পছন্দ নির্বাচন করুন।", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "এখনও মূল্যায়ন নেই", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From c0e4c744a9530c6eea1e8407fe924ce36039db9e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:15 +0530 Subject: [PATCH 063/115] i18n(cs-cz): add profile page strings --- src/lang/cs-cz.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/cs-cz.json b/src/lang/cs-cz.json index f33b46844d..33ec372828 100644 --- a/src/lang/cs-cz.json +++ b/src/lang/cs-cz.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Recenze může mít nejvýše {max} znaků.", "plugin-review:error-downvote-comment": "Sdělte vývojáři, co by se dalo zlepšit.", "plugin-review:error-empty": "Přidejte komentář nebo zvolte Líbí se mi.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Nehodnoceno", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 595ca7ea2c2131b71181279d680b5c3031864e6e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:22 +0530 Subject: [PATCH 064/115] i18n(de-de): add profile page strings --- src/lang/de-de.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/de-de.json b/src/lang/de-de.json index c19f4e6f56..38077a3804 100644 --- a/src/lang/de-de.json +++ b/src/lang/de-de.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Die Bewertung darf höchstens {max} Zeichen lang sein.", "plugin-review:error-downvote-comment": "Sage dem Entwickler, was verbessert werden könnte.", "plugin-review:error-empty": "Füge einen Kommentar hinzu oder wähle „Gefällt mir“.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Nicht bewertet", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 73129c8089aad28cb0e42666de4a2ad4c5f1b711 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:30 +0530 Subject: [PATCH 065/115] i18n(es-sv): add profile page strings --- src/lang/es-sv.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/es-sv.json b/src/lang/es-sv.json index ad78d40c95..3672e8573a 100644 --- a/src/lang/es-sv.json +++ b/src/lang/es-sv.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "La reseña debe tener {max} caracteres o menos.", "plugin-review:error-downvote-comment": "Dile al desarrollador qué podría mejorar.", "plugin-review:error-empty": "Agrega un comentario o elige Me gusta.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Sin calificar", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From cc91c6c7ae3dc9e124b8e5c546b421c82fc70d9a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:37 +0530 Subject: [PATCH 066/115] i18n(fr-fr): add profile page strings --- src/lang/fr-fr.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/fr-fr.json b/src/lang/fr-fr.json index 5fc53c6f1d..8f7894ec3d 100644 --- a/src/lang/fr-fr.json +++ b/src/lang/fr-fr.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "L’avis doit contenir au maximum {max} caractères.", "plugin-review:error-downvote-comment": "Indiquez au développeur ce qui pourrait être amélioré.", "plugin-review:error-empty": "Ajoutez un commentaire ou choisissez J’aime.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Non évalué", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 6cc76c08130ea05c6ab0822fc9098a153ae31bba Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:44 +0530 Subject: [PATCH 067/115] i18n(he-il): add profile page strings --- src/lang/he-il.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/he-il.json b/src/lang/he-il.json index 358b04abc6..34d0a524d4 100644 --- a/src/lang/he-il.json +++ b/src/lang/he-il.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "הביקורת צריכה להכיל עד {max} תווים.", "plugin-review:error-downvote-comment": "ספר למפתח מה אפשר לשפר.", "plugin-review:error-empty": "הוסף תגובה או בחר באהבתי.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "ללא דירוג", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 4c50c1da777fbd4d8de7671a60a158cb741c5851 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:51 +0530 Subject: [PATCH 068/115] i18n(hi-in): add profile page strings --- src/lang/hi-in.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/hi-in.json b/src/lang/hi-in.json index 6aa97f71a1..1a11e6bdd9 100644 --- a/src/lang/hi-in.json +++ b/src/lang/hi-in.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "समीक्षा {max} वर्णों या उससे कम की होनी चाहिए।", "plugin-review:error-downvote-comment": "डेवलपर को बताएँ कि क्या बेहतर किया जा सकता है।", "plugin-review:error-empty": "टिप्पणी जोड़ें या पसंद चुनें।", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "अभी रेटिंग नहीं", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 748274b5f01a3c992ffe6ccb13f52289a5b5f204 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:04:59 +0530 Subject: [PATCH 069/115] i18n(hu-hu): add profile page strings --- src/lang/hu-hu.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/hu-hu.json b/src/lang/hu-hu.json index f2865688a2..4859d03791 100644 --- a/src/lang/hu-hu.json +++ b/src/lang/hu-hu.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "A megjegyzés szövege legfeljebb {max} karakter lehet.", "plugin-review:error-downvote-comment": "Írja meg a fejlesztőknek, hogy min lehetne javítani.", "plugin-review:error-empty": "Adjon hozzá megjegyzést vagy válassza a „Tetszik” lehetőséget.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Még nem értékelte senki", "wrapped line indent": "Tördelt sorok behúzása", "wrap-indent-same": "Azonos", From 7a231327b05166a0458ec5705b6044d57d352fcd Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:06 +0530 Subject: [PATCH 070/115] i18n(id-id): add profile page strings --- src/lang/id-id.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/id-id.json b/src/lang/id-id.json index e21a315901..dcc8146f31 100644 --- a/src/lang/id-id.json +++ b/src/lang/id-id.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Ulasan harus terdiri dari {max} karakter atau kurang.", "plugin-review:error-downvote-comment": "Beri tahu developer apa yang dapat ditingkatkan.", "plugin-review:error-empty": "Tambahkan komentar atau pilih Suka.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Belum dinilai", "wrapped line indent": "Indentasi baris terbungkus", "wrap-indent-same": "Sama", From b8ff5fd8d8399b63319d876258895b7a9ca01020 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:13 +0530 Subject: [PATCH 071/115] i18n(ir-fa): add profile page strings --- src/lang/ir-fa.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ir-fa.json b/src/lang/ir-fa.json index 07f6c056bc..8ba8556342 100644 --- a/src/lang/ir-fa.json +++ b/src/lang/ir-fa.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "نظر باید حداکثر {max} نویسه باشد.", "plugin-review:error-downvote-comment": "به توسعه‌دهنده بگویید چه چیزی می‌تواند بهتر شود.", "plugin-review:error-empty": "یک دیدگاه بنویسید یا «پسندیدم» را انتخاب کنید.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "بدون امتیاز", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From ad0a6cbfc50901f9379c5c073cd7dbd01f3edd01 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:21 +0530 Subject: [PATCH 072/115] i18n(it-it): add profile page strings --- src/lang/it-it.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/it-it.json b/src/lang/it-it.json index efe7c90e32..b7283d714b 100644 --- a/src/lang/it-it.json +++ b/src/lang/it-it.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "La recensione deve contenere al massimo {max} caratteri.", "plugin-review:error-downvote-comment": "Spiega allo sviluppatore cosa potrebbe essere migliorato.", "plugin-review:error-empty": "Aggiungi un commento o scegli Mi piace.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Non valutato", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 216d641a99da42a9dffec5e2944b0000e2c9bf52 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:28 +0530 Subject: [PATCH 073/115] i18n(ja-jp): add profile page strings --- src/lang/ja-jp.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ja-jp.json b/src/lang/ja-jp.json index 27fd7b6033..97c4a7b717 100644 --- a/src/lang/ja-jp.json +++ b/src/lang/ja-jp.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "レビューは {max} 文字以内で入力してください。", "plugin-review:error-downvote-comment": "改善してほしい点を開発者に伝えてください。", "plugin-review:error-empty": "コメントを追加するか、高評価を選んでください。", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "未評価", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 3d29f760489d8357d0e076d0432e96eabec51f1f Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:35 +0530 Subject: [PATCH 074/115] i18n(ko-kr): add profile page strings --- src/lang/ko-kr.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ko-kr.json b/src/lang/ko-kr.json index f331beb331..b68285c9c2 100644 --- a/src/lang/ko-kr.json +++ b/src/lang/ko-kr.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "리뷰는 {max}자 이하여야 합니다.", "plugin-review:error-downvote-comment": "개발자에게 개선할 점을 알려 주세요.", "plugin-review:error-empty": "댓글을 추가하거나 좋아요를 선택하세요.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "평가 없음", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 60736121a16b4f4829ddc575e3330d4e0df13343 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:43 +0530 Subject: [PATCH 075/115] i18n(ln-ln): add profile page strings --- src/lang/ln-ln.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ln-ln.json b/src/lang/ln-ln.json index 63d4e9ce7e..ffec7dd072 100644 --- a/src/lang/ln-ln.json +++ b/src/lang/ln-ln.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Review must be {max} characters or less.", "plugin-review:error-downvote-comment": "Tell the developer what could be improved.", "plugin-review:error-empty": "Add a comment or choose thumbs up.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Unrated", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 2faa6f5f90fadf8eeccd882eb731a4d300059e8a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:50 +0530 Subject: [PATCH 076/115] i18n(ml-in): add profile page strings --- src/lang/ml-in.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ml-in.json b/src/lang/ml-in.json index 04db791635..4dd1f65b7a 100644 --- a/src/lang/ml-in.json +++ b/src/lang/ml-in.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "അവലോകനം {max} അക്ഷരങ്ങളോ അതിൽ കുറവോ ആയിരിക്കണം.", "plugin-review:error-downvote-comment": "എന്താണ് മെച്ചപ്പെടുത്താനാകുന്നതെന്ന് ഡെവലപ്പറോട് പറയുക.", "plugin-review:error-empty": "ഒരു അഭിപ്രായം ചേർക്കുക അല്ലെങ്കിൽ ഇഷ്ടപ്പെട്ടു തിരഞ്ഞെടുക്കുക.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "വിലയിരുത്തിയിട്ടില്ല", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 319baa09f1055198673c34b4652ee8bcf2d2bd6d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:05:58 +0530 Subject: [PATCH 077/115] i18n(mm-unicode): add profile page strings --- src/lang/mm-unicode.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/mm-unicode.json b/src/lang/mm-unicode.json index 6411d5b9b1..6b7bfb3be2 100644 --- a/src/lang/mm-unicode.json +++ b/src/lang/mm-unicode.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "သုံးသပ်ချက်သည် စာလုံးရေ {max} လုံး သို့မဟုတ် ထိုထက်နည်းရမည်။", "plugin-review:error-downvote-comment": "မည်သည့်အရာကို ပိုကောင်းအောင်လုပ်နိုင်ကြောင်း developer ကို ပြောပါ။", "plugin-review:error-empty": "မှတ်ချက်ထည့်ပါ သို့မဟုတ် ကြိုက်သည်ကို ရွေးပါ။", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "အဆင့်မသတ်မှတ်ရသေးပါ", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 329a1ce9e361d5922b493edfd56be826bd39ff00 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:05 +0530 Subject: [PATCH 078/115] i18n(mm-zawgyi): add profile page strings --- src/lang/mm-zawgyi.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/mm-zawgyi.json b/src/lang/mm-zawgyi.json index dd8f456bf2..76ec0ffb93 100644 --- a/src/lang/mm-zawgyi.json +++ b/src/lang/mm-zawgyi.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "သုံးသပ္ခ်က္သည္ စာလုံးေရ {max} လုံး သို႔မဟုတ္ ထိုထက္နည္းရမည္။", "plugin-review:error-downvote-comment": "မည္သည့္အရာကို ပိုေကာင္းေအာင္လုပ္ႏိုင္ေၾကာင္း developer ကို ေျပာပါ။", "plugin-review:error-empty": "မွတ္ခ်က္ထည့္ပါ သို႔မဟုတ္ ႀကိဳက္သည္ကို ေ႐ြးပါ။", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "အဆင့္မသတ္မွတ္ရေသးပါ", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 28ab6d9a721ae8caf690e959387414e721908a23 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:12 +0530 Subject: [PATCH 079/115] i18n(pl-pl): add profile page strings --- src/lang/pl-pl.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/pl-pl.json b/src/lang/pl-pl.json index d5b418a9e0..3a447fc1dd 100644 --- a/src/lang/pl-pl.json +++ b/src/lang/pl-pl.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Opinia może mieć maksymalnie {max} znaków.", "plugin-review:error-downvote-comment": "Powiedz deweloperowi, co można poprawić.", "plugin-review:error-empty": "Dodaj komentarz lub wybierz „Lubię”.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Bez oceny", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 60d74fdd54b6c3ca20247b0968d402bbff70b9ea Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:20 +0530 Subject: [PATCH 080/115] i18n(pt-br): add profile page strings --- src/lang/pt-br.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/pt-br.json b/src/lang/pt-br.json index aa6de4b0e2..884c7df87d 100644 --- a/src/lang/pt-br.json +++ b/src/lang/pt-br.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "A avaliação deve ter no máximo {max} caracteres.", "plugin-review:error-downvote-comment": "Diga ao desenvolvedor o que pode ser melhorado.", "plugin-review:error-empty": "Adicione um comentário ou escolha Gostei.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Sem avaliação", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 294899768cc6f37e97dca9df89a37b2979de6c68 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:27 +0530 Subject: [PATCH 081/115] i18n(pu-in): add profile page strings --- src/lang/pu-in.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/pu-in.json b/src/lang/pu-in.json index 05b389b8c7..05bce62f11 100644 --- a/src/lang/pu-in.json +++ b/src/lang/pu-in.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "ਸਮੀਖਿਆ {max} ਅੱਖਰਾਂ ਜਾਂ ਇਸ ਤੋਂ ਘੱਟ ਦੀ ਹੋਣੀ ਚਾਹੀਦੀ ਹੈ।", "plugin-review:error-downvote-comment": "ਡਿਵੈਲਪਰ ਨੂੰ ਦੱਸੋ ਕਿ ਕੀ ਸੁਧਾਰਿਆ ਜਾ ਸਕਦਾ ਹੈ।", "plugin-review:error-empty": "ਟਿੱਪਣੀ ਸ਼ਾਮਲ ਕਰੋ ਜਾਂ ਪਸੰਦ ਚੁਣੋ।", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "ਹਾਲੇ ਮੁਲਾਂਕਣ ਨਹੀਂ", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 410346689f6f702f1132f96b038d8cd2ad5dd495 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:34 +0530 Subject: [PATCH 082/115] i18n(ru-ru): add profile page strings --- src/lang/ru-ru.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/ru-ru.json b/src/lang/ru-ru.json index 79e83dddba..6a3e5a0216 100644 --- a/src/lang/ru-ru.json +++ b/src/lang/ru-ru.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Отзыв должен содержать не более {max} символов.", "plugin-review:error-downvote-comment": "Расскажите разработчику, что можно улучшить.", "plugin-review:error-empty": "Добавьте комментарий или выберите «Нравится».", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Нет оценок", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 69411a3021318f885e1b906a03df0c1f08245f95 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:42 +0530 Subject: [PATCH 083/115] i18n(tl-ph): add profile page strings --- src/lang/tl-ph.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/tl-ph.json b/src/lang/tl-ph.json index b5a5424fca..194b38c71e 100644 --- a/src/lang/tl-ph.json +++ b/src/lang/tl-ph.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Dapat {max} character o mas kaunti ang review.", "plugin-review:error-downvote-comment": "Sabihin sa developer kung ano ang maaaring mapabuti.", "plugin-review:error-empty": "Magdagdag ng komento o piliin ang Gusto.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Walang rating", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From cceb4fd3d6920771c09da90760a24dfdb4014950 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:49 +0530 Subject: [PATCH 084/115] i18n(tr-tr): add profile page strings --- src/lang/tr-tr.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/tr-tr.json b/src/lang/tr-tr.json index 0d723b7ffd..943e0fe2f2 100644 --- a/src/lang/tr-tr.json +++ b/src/lang/tr-tr.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Değerlendirme en fazla {max} karakter olmalıdır.", "plugin-review:error-downvote-comment": "Geliştiriciye nelerin iyileştirilebileceğini söyleyin.", "plugin-review:error-empty": "Yorum ekleyin veya Beğendim’i seçin.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Değerlendirilmedi", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 0081a02622ba16d27d30546c4042a1fd262d8c7c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:06:56 +0530 Subject: [PATCH 085/115] i18n(uk-ua): add profile page strings --- src/lang/uk-ua.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/uk-ua.json b/src/lang/uk-ua.json index ab5da72106..ee1c587143 100644 --- a/src/lang/uk-ua.json +++ b/src/lang/uk-ua.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Відгук має містити не більше {max} символів.", "plugin-review:error-downvote-comment": "Розкажіть розробнику, що можна покращити.", "plugin-review:error-empty": "Додайте коментар або виберіть «Подобається».", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Без оцінки", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 00a0c083f5d2904eccf23a916ecb21b6029def93 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:07:04 +0530 Subject: [PATCH 086/115] i18n(uz-uz): add profile page strings --- src/lang/uz-uz.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/uz-uz.json b/src/lang/uz-uz.json index 986916b7e8..446f5b92e2 100644 --- a/src/lang/uz-uz.json +++ b/src/lang/uz-uz.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Sharh {max} ta yoki undan kam belgidan iborat bo‘lishi kerak.", "plugin-review:error-downvote-comment": "Dasturchiga nimani yaxshilash mumkinligini ayting.", "plugin-review:error-empty": "Izoh qo‘shing yoki “Yoqdi”ni tanlang.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Baholanmagan", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From 5a3b6067667d6596216c94943599f695c44b578e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:07:11 +0530 Subject: [PATCH 087/115] i18n(vi-vn): add profile page strings --- src/lang/vi-vn.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/vi-vn.json b/src/lang/vi-vn.json index 64441eb461..0831cf9e9e 100644 --- a/src/lang/vi-vn.json +++ b/src/lang/vi-vn.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "Đánh giá phải có tối đa {max} ký tự.", "plugin-review:error-downvote-comment": "Hãy cho nhà phát triển biết điều gì có thể được cải thiện.", "plugin-review:error-empty": "Thêm bình luận hoặc chọn Thích.", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "Chưa đánh giá", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From ab981e364e0ed64cb1160a01d55a48a42d1c7f70 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:07:18 +0530 Subject: [PATCH 088/115] i18n(zh-cn): add profile page strings --- src/lang/zh-cn.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/zh-cn.json b/src/lang/zh-cn.json index d6c1737b6d..0f7003e517 100644 --- a/src/lang/zh-cn.json +++ b/src/lang/zh-cn.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "评价不能超过 {max} 个字符。", "plugin-review:error-downvote-comment": "告诉开发者哪些地方可以改进。", "plugin-review:error-empty": "添加评论或选择“赞”。", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "暂无评分", "wrapped line indent": "折行缩进", "wrap-indent-same": "与首行对齐", From 78626d1354cc603dc9d47f0b8b76a6efed942124 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:07:26 +0530 Subject: [PATCH 089/115] i18n(zh-hant): add profile page strings --- src/lang/zh-hant.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/zh-hant.json b/src/lang/zh-hant.json index 6ad71367e6..fbb9081763 100644 --- a/src/lang/zh-hant.json +++ b/src/lang/zh-hant.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "評論不得超過 {max} 個字元。", "plugin-review:error-downvote-comment": "告訴開發者哪些地方可以改進。", "plugin-review:error-empty": "新增留言或選擇「讚」。", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "尚未評分", "wrapped line indent": "換行縮排", "wrap-indent-same": "與首行對齊", From 7b9e1204e4b93c188567d20f3e30dd6de221bb98 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:07:33 +0530 Subject: [PATCH 090/115] i18n(zh-tw): add profile page strings --- src/lang/zh-tw.json | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/lang/zh-tw.json b/src/lang/zh-tw.json index c814718a27..725a747cab 100644 --- a/src/lang/zh-tw.json +++ b/src/lang/zh-tw.json @@ -879,6 +879,27 @@ "plugin-review:error-max-length": "評論不得超過 {max} 個字元。", "plugin-review:error-downvote-comment": "告訴開發者哪些地方可以改進。", "plugin-review:error-empty": "新增留言或選擇「讚」。", + "profile not signed in": "Not signed in", + "profile sign in prompt": "Sign in with your Acode account.", + "acode account": "Acode account", + "member since": "Member since {date}", + "activity": "Activity", + "top languages": "Top languages", + "last 12 months": "Last 12 months", + "coding time": "Coding time", + "streak": "Streak", + "active days": "Active days", + "less": "Less", + "today time": "Today {time}", + "nothing yet today": "Nothing yet today", + "no activity on": "No activity on {date}", + "languages empty": "Languages show up here as you code.", + "reset activity": "Reset activity", + "reset activity warning": "This clears the time, lines, files and streaks tracked on this device.", + "activity reset": "Activity reset", + "logout confirm": "Are you sure you want to log out of your Acode account?", + "best streak": "Best streak", + "this week": "This week", "plugin-review:unrated": "尚未評分", "wrapped line indent": "Word wrap indentation", "wrap-indent-same": "Same", From eacf696644223f1837aecd7edc62759efc21847d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:17:43 +0530 Subject: [PATCH 091/115] feat(profile): sample heatmap for signed-out users with no activity --- src/pages/profile/profile.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 32743ae107..e9dab2e763 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -118,6 +118,26 @@ function formatDuration(ms) { return `${hours}h ${rest}m`; } +/** + * Deterministic sample activity shaped like a real year (quieter weekends, + * a few busy streaks). Only used as a faded preview, never as real data. + */ +function samplePattern(year) { + return year.map((day, i) => { + const weekday = new Date(`${day.date}T00:00:00Z`).getUTCDay(); + const wave = (Math.sin(i / 9) + Math.sin(i / 23 + 1) + 2) / 4; + const noise = ((i * 7919) % 13) / 13; + const score = + wave + noise * 0.5 - (weekday === 0 || weekday === 6 ? 0.35 : 0); + let level = 4; + if (score < 0.45) level = 0; + else if (score < 0.7) level = 1; + else if (score < 0.9) level = 2; + else if (score < 1.05) level = 3; + return { date: day.date, ms: 0, level }; + }); +} + function tipText(day) { const when = new Date(`${day.date}T00:00:00Z`).toLocaleDateString(undefined, { month: "short", From cae0de79f9bed0c5d48005428577bce3d9ce649c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:17:49 +0530 Subject: [PATCH 092/115] feat(profile): use sample data for the guest heatmap --- src/pages/profile/profile.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index e9dab2e763..5da6805c5c 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -455,7 +455,12 @@ export default function ProfileInclude({ function renderActivity() { const data = tracker.getSummary(); - const weeks = buildWeeks(data.year); + // Signed out with nothing tracked yet: show a faded sample instead of + // a blank grid. + const isPlaceholder = !user && !data.totals.activeDays; + const weeks = buildWeeks( + isPlaceholder ? samplePattern(data.year) : data.year, + ); const labels = monthLabels(weeks); const todayKey = data.year[data.year.length - 1].date; const $grid =
; From caf0e93ab879123495e1ec58c405654b9fd4e8fd Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:17:55 +0530 Subject: [PATCH 093/115] feat(profile): no today marker on the sample heatmap --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 5da6805c5c..e9be8c6336 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -472,7 +472,7 @@ export default function ProfileInclude({ let cellClass = "pf-gh-cell none"; if (day) { cellClass = `pf-gh-cell lv${day.level}`; - if (day.date === todayKey) cellClass += " today"; + if (day.date === todayKey && !isPlaceholder) cellClass += " today"; } const $cell =
; if (day) $cell.dataset.tip = tipText(day); From 058d3cc0c328ee8ce6f10143e0e4b36607ef0d5c Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:00 +0530 Subject: [PATCH 094/115] feat(profile): sample cells have no tooltip --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index e9be8c6336..fa7c729136 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -475,7 +475,7 @@ export default function ProfileInclude({ if (day.date === todayKey && !isPlaceholder) cellClass += " today"; } const $cell =
; - if (day) $cell.dataset.tip = tipText(day); + if (day && !isPlaceholder) $cell.dataset.tip = tipText(day); $week.append($cell); } $grid.append($week); From 278ec6c25951a8c80c8850a1c344de0e54fff309 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:06 +0530 Subject: [PATCH 095/115] feat(profile): fade the sample heatmap --- src/pages/profile/profile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index fa7c729136..94b6634bd3 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -509,7 +509,9 @@ export default function ProfileInclude({ $days.append(
{name}
); } const $heat = ( -
+
{$days} {$scroll}
From 1cb7ee37844b686e9f90d8459aa5497838e59771 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:12 +0530 Subject: [PATCH 096/115] feat(profile): hint text under the sample heatmap --- src/pages/profile/profile.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 94b6634bd3..0bf8079903 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -539,7 +539,14 @@ export default function ProfileInclude({
, $heat,
- {todayText} + + {isPlaceholder + ? t( + "activity placeholder hint", + "Sign in and start coding to fill this in", + ) + : todayText} + {$legend}
, ); From d3e172652266343ea2be7d47269fe310e4e3508a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:18 +0530 Subject: [PATCH 097/115] feat(profile): refresh heatmap when signing in or out --- src/pages/profile/profile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 0bf8079903..7c4709622f 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -446,6 +446,8 @@ export default function ProfileInclude({ } function refreshAccount() { + // After the first render, sign in/out also swaps the sample heatmap. + if (activity.$body.firstChild) renderActivity(); renderHero(); renderFoot(); } From 805111d32d40746e4d6e826e28f959a601beb416 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:23 +0530 Subject: [PATCH 098/115] feat(profile): mark Pro avatars for the gold ring --- src/pages/profile/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 7c4709622f..3b28bc8402 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -235,7 +235,7 @@ function buildAvatar(user, getAvatarSrc) { .toUpperCase(); const $img = ; const $avatar = ( -
+
{initial} {$img}
From dae37a7537bb4ba52f52b74aa95a30b0160b136d Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:29 +0530 Subject: [PATCH 099/115] feat(profile): stagger section entrance animation --- src/pages/profile/profile.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 3b28bc8402..59c1b0cde2 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -753,6 +753,9 @@ export default function ProfileInclude({ renderLanguages(renderActivity().languages); fillPlugins(); + // Index per section drives the staggered entrance (see profile.scss). + [...$main.children].forEach(($el, i) => $el.style.setProperty("--pf-i", i)); + $page.body = $main; actionStack.push({ From 98ee0d213a74d06d872b3de7f409efbf704e01d7 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:35 +0530 Subject: [PATCH 100/115] feat(profile): entrance animation keyframes --- src/pages/profile/profile.scss | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index c4777c2bd1..b89a29499e 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -1,3 +1,14 @@ +@keyframes pf-rise { + from { + opacity: 0; + transform: translateY(12px); + } + to { + opacity: 1; + transform: none; + } +} + #profile-page { --pf-blue: #3b82f6; /* Follows the active theme; the button keeps a fixed blue for contrast. */ From 7e7233e40bddee4f9eade3124da878d8f73967e8 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:42 +0530 Subject: [PATCH 101/115] feat(profile): entrance animation and sample heatmap styles --- src/pages/profile/profile.scss | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index b89a29499e..8e9266d1ad 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -42,6 +42,24 @@ flex-shrink: 0; } + /* Sections fade up one after another (--pf-i is set in profile.js). */ + > .pf-slot, + > .pf-section { + animation: pf-rise 0.4s ease-out both; + animation-delay: calc(var(--pf-i, 0) * 60ms); + } + + @media (prefers-reduced-motion: reduce) { + > .pf-slot, + > .pf-section { animation: none; } + } + + /* Faded sample graph for signed-out users with no activity yet. */ + .pf-gh-wrap.placeholder { + opacity: 0.35; + pointer-events: none; + } + .pf-slot { display: flex; flex-direction: column; From f177efb033152845ccab37df3fdc76ea696eb479 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:48 +0530 Subject: [PATCH 102/115] feat(profile): subtle gold ring on Pro avatars --- src/pages/profile/profile.scss | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 8e9266d1ad..41453e9dff 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -121,6 +121,14 @@ } &.guest { color: var(--pf-muted); } + + /* Pro: subtle gold ring */ + &.pro { + border-color: transparent; + box-shadow: + 0 0 0 2px #ffc94d, + 0 0 14px rgba(255, 201, 77, 0.3); + } } .pf-name-row { From 640cbae924e5ad605e64f12eb9ffeb29c8d5f33e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:18:54 +0530 Subject: [PATCH 103/115] feat(profile): press feedback transition on rows --- src/pages/profile/profile.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 41453e9dff..5be8f87a63 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -437,6 +437,9 @@ display: flex; align-items: center; gap: 14px; + transition: + transform 0.12s ease, + background 0.12s ease; padding: 14px; border-bottom: 1px solid var(--pf-border); color: var(--primary-text-color); From b2c99983d7327723f495e87b378c2526b45d7807 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:19:00 +0530 Subject: [PATCH 104/115] feat(profile): scale-down on pressed rows --- src/pages/profile/profile.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 5be8f87a63..0ac0311e58 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -445,7 +445,10 @@ color: var(--primary-text-color); &:last-child { border-bottom: none; } - &:active { background: var(--pf-lv0); } + &:active { + background: var(--pf-lv0); + transform: scale(0.98); + } > .pf-icon { color: var(--pf-muted); } From 6793ef9953c8f0499d21000d461256cf3c3d01af Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:19:05 +0530 Subject: [PATCH 105/115] feat(profile): press feedback transition on buttons --- src/pages/profile/profile.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 0ac0311e58..cf2927e7a3 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -510,6 +510,9 @@ font-weight: 600; color: #fff; background: var(--pf-blue); + transition: + transform 0.12s ease, + filter 0.12s ease; &.small { padding: 7px 16px; font-size: 13px; margin-top: 0; } &:active { filter: brightness(0.9); } From e9666a6c58e468bd168cf3bc3bfdec295329e031 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:19:11 +0530 Subject: [PATCH 106/115] feat(profile): scale-down on pressed buttons --- src/pages/profile/profile.scss | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index cf2927e7a3..63f953ebca 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -515,7 +515,10 @@ filter 0.12s ease; &.small { padding: 7px 16px; font-size: 13px; margin-top: 0; } - &:active { filter: brightness(0.9); } + &:active { + filter: brightness(0.9); + transform: scale(0.97); + } &:disabled { opacity: 0.6; } } From 2fa6ec039e0d35bc5a0d2c4d25678d5b21edfba0 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:20:59 +0530 Subject: [PATCH 107/115] style(profile): match Biome formatting for heatmap wrapper --- src/pages/profile/profile.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 59c1b0cde2..839b75c938 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -511,9 +511,7 @@ export default function ProfileInclude({ $days.append(
{name}
); } const $heat = ( -
+
{$days} {$scroll}
From a13a7c70d3d50bef003ef9b570bfc1fe7aa21bdb Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:19 +0530 Subject: [PATCH 108/115] feat(profile): render the activity card to an image for sharing --- src/pages/profile/shareCard.js | 149 +++++++++++++++++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 src/pages/profile/shareCard.js diff --git a/src/pages/profile/shareCard.js b/src/pages/profile/shareCard.js new file mode 100644 index 0000000000..76ddc58809 --- /dev/null +++ b/src/pages/profile/shareCard.js @@ -0,0 +1,149 @@ +import { buildWeeks, monthLabels } from "./heatmap"; + +const WIDTH = 1200; +const PAD = 72; +const GAP = 5; +const FONT = "sans-serif"; + +/** Resolves any CSS color (var(), color-mix()...) to a value canvas can paint. */ +function resolveColor($ref, value) { + const $probe = document.createElement("i"); + $probe.style.position = "absolute"; + $probe.style.visibility = "hidden"; + $probe.style.background = value; + $ref.append($probe); + const color = getComputedStyle($probe).backgroundColor; + $probe.remove(); + return color; +} + +function roundRect(ctx, x, y, w, h, r) { + ctx.beginPath(); + ctx.moveTo(x + r, y); + ctx.arcTo(x + w, y, x + w, y + h, r); + ctx.arcTo(x + w, y + h, x, y + h, r); + ctx.arcTo(x, y + h, x, y, r); + ctx.arcTo(x, y, x + w, y, r); + ctx.closePath(); +} + +/** + * Draws the activity card (stats + heatmap) to a PNG using the current theme. + * @param {HTMLElement} $ref element inside the profile page, used to read the + * theme colors + * @param {object} options + * @param {string} options.name title shown at the top + * @param {object} options.data summary from the activity tracker + * @param {(ms:number) => string} options.formatDuration + * @param {(key:string, fallback:string) => string} options.label + * @returns {Promise} + */ +export default function renderShareCard($ref, options) { + const { name, data, formatDuration, label } = options; + const paint = (value) => resolveColor($ref, value); + const colors = { + bg: paint("var(--primary-color, #1e1e1e)"), + text: paint("var(--primary-text-color, #ffffff)"), + muted: paint("var(--pf-muted)"), + accent: paint("var(--pf-accent)"), + levels: [0, 1, 2, 3, 4].map((n) => paint(`var(--pf-lv${n})`)), + }; + + const weeks = buildWeeks(data.year); + const months = monthLabels(weeks); + const cols = weeks.length; + const cell = Math.floor((WIDTH - PAD * 2 - GAP * (cols - 1)) / cols); + const gridH = cell * 7 + GAP * 6; + + const metricsTop = PAD + 130; + const monthBase = metricsTop + 170; + const gridTop = monthBase + 18; + const legendBase = gridTop + gridH + 72; + const height = legendBase + PAD; + + const canvas = document.createElement("canvas"); + canvas.width = WIDTH; + canvas.height = height; + const ctx = canvas.getContext("2d"); + + ctx.fillStyle = colors.bg; + ctx.fillRect(0, 0, WIDTH, height); + ctx.textAlign = "left"; + ctx.textBaseline = "alphabetic"; + + // Title + ctx.fillStyle = colors.text; + ctx.font = `700 54px ${FONT}`; + ctx.fillText(name, PAD, PAD + 50, WIDTH - PAD * 2); + ctx.fillStyle = colors.muted; + ctx.font = `400 28px ${FONT}`; + ctx.fillText(label("last 12 months", "Last 12 months"), PAD, PAD + 96); + + // Stats + const { totals } = data; + const metrics = [ + [formatDuration(totals.ms), label("coding time", "Coding time")], + [`${data.current}d`, label("streak", "Streak")], + [`${data.longest}d`, label("best streak", "Best streak")], + [String(totals.activeDays), label("active days", "Active days")], + ]; + const colW = (WIDTH - PAD * 2) / metrics.length; + metrics.forEach(([value, caption], i) => { + const left = PAD + colW * i; + ctx.fillStyle = colors.text; + ctx.font = `700 56px ${FONT}`; + ctx.fillText(value, left, metricsTop + 60, colW - 16); + ctx.fillStyle = colors.muted; + ctx.font = `400 26px ${FONT}`; + ctx.fillText(caption, left, metricsTop + 104, colW - 16); + }); + + // Heatmap + ctx.font = `400 22px ${FONT}`; + weeks.forEach((week, i) => { + const left = PAD + i * (cell + GAP); + if (months[i]) { + ctx.fillStyle = colors.muted; + ctx.fillText(months[i], left, monthBase); + } + week.forEach((day, row) => { + if (!day) return; + ctx.fillStyle = colors.levels[day.level] || colors.levels[0]; + roundRect(ctx, left, gridTop + row * (cell + GAP), cell, cell, 3); + ctx.fill(); + }); + }); + + // Legend and brand + ctx.font = `400 24px ${FONT}`; + const less = label("less", "Less"); + const more = label("more", "More"); + const swatch = 22; + const swatchGap = 6; + const lessW = ctx.measureText(less).width; + const moreW = ctx.measureText(more).width; + const swatchesW = swatch * 5 + swatchGap * 4; + let lx = WIDTH - PAD - (lessW + moreW + swatchesW + 32); + ctx.fillStyle = colors.muted; + ctx.fillText(less, lx, legendBase); + lx += lessW + 16; + for (const level of colors.levels) { + ctx.fillStyle = level; + roundRect(ctx, lx, legendBase - swatch + 3, swatch, swatch, 4); + ctx.fill(); + lx += swatch + swatchGap; + } + ctx.fillStyle = colors.muted; + ctx.fillText(more, lx + 10, legendBase); + + ctx.fillStyle = colors.accent; + ctx.font = `700 30px ${FONT}`; + ctx.fillText("Acode", PAD, legendBase); + + return new Promise((resolve, reject) => { + canvas.toBlob((blob) => { + if (blob) resolve(blob); + else reject(new Error("Unable to render the activity card")); + }, "image/png"); + }); +} From a879d25e423dcf1c347dc47f7f8c5041e1c20364 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:25 +0530 Subject: [PATCH 109/115] feat(profile): import share card renderer --- src/pages/profile/profile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 839b75c938..d3ef04046d 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -15,6 +15,7 @@ import helpers from "utils/helpers"; import Uri from "utils/Uri"; import Url from "utils/Url"; import { buildWeeks, monthLabels } from "./heatmap"; +import renderShareCard from "./shareCard"; /* Feather-style stroke icons, so the page never depends on the icon font. */ const ICONS = { From ad35cde5e2c3224343f60edcb79f793f2000d07e Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:32 +0530 Subject: [PATCH 110/115] feat(profile): share icon --- src/pages/profile/profile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index d3ef04046d..2a767092e5 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -39,6 +39,8 @@ const ICONS = { '', user: '', chevron: '', + share: + '', verified: '', }; From 93b32d97eb93321e73427a4c56d568e8081d7eb7 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:39 +0530 Subject: [PATCH 111/115] feat(profile): helper to share an image through the system share sheet --- src/pages/profile/profile.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 2a767092e5..3fb291ca77 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -171,6 +171,17 @@ function pathDetails(url) { const openUrl = (url) => () => system.openInBrowser(url); +/** Saves the image to the cache folder and opens the system share sheet. */ +async function shareImage(blob, name) { + const buffer = await blob.arrayBuffer(); + const url = Url.join(CACHE_STORAGE, name); + if (await fsOperation(url).exists()) await fsOperation(url).delete(); + await fsOperation(CACHE_STORAGE).createFile(name, buffer); + const { url: shareUrl } = await fsOperation(url).stat(); + const onFail = () => toast(strings["no app found to handle this file"]); + system.fileAction(shareUrl, name, "SEND", "image/png", onFail); +} + function section(title) { const $trail = ; const $body =
; From 2de7f628b7b131f3751a286f61afdd0b926606ed Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:46 +0530 Subject: [PATCH 112/115] feat(profile): share button on the activity card --- src/pages/profile/profile.js | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 3fb291ca77..857428ac43 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -467,7 +467,33 @@ export default function ProfileInclude({ } /* ---------- activity ---------- */ - activity.$trail.textContent = t("last 12 months", "Last 12 months"); + const $share = ; + $share.setAttribute("aria-label", t("share", "Share")); + $share.append(icon("share", 16)); + activity.$trail.append( + {t("last 12 months", "Last 12 months")}, + $share, + ); + + let sharing = false; + $share.onclick = async () => { + if (sharing) return; + sharing = true; + try { + const blob = await renderShareCard($share, { + name: user?.name || t("activity", "Activity"), + data: tracker.getSummary(), + formatDuration, + label: t, + }); + await shareImage(blob, "acode-activity.png"); + } catch (error) { + console.error(error); + toast(t("share failed", "Could not share your activity")); + } finally { + sharing = false; + } + }; function renderActivity() { const data = tracker.getSummary(); From 046673ef650484c76d498dfcee50013ddec47a3a Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:52 +0530 Subject: [PATCH 113/115] feat(profile): hide share button until there is activity --- src/pages/profile/profile.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pages/profile/profile.js b/src/pages/profile/profile.js index 857428ac43..29a87d15c8 100644 --- a/src/pages/profile/profile.js +++ b/src/pages/profile/profile.js @@ -500,6 +500,7 @@ export default function ProfileInclude({ // Signed out with nothing tracked yet: show a faded sample instead of // a blank grid. const isPlaceholder = !user && !data.totals.activeDays; + $share.style.display = data.totals.activeDays ? "" : "none"; const weeks = buildWeeks( isPlaceholder ? samplePattern(data.year) : data.year, ); From 19f8f81a56102753e255a3b5a9ee4da5694fe54f Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:42:58 +0530 Subject: [PATCH 114/115] feat(profile): lay out the section trail with the share button --- src/pages/profile/profile.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 63f953ebca..8b0db5c3d5 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -210,6 +210,9 @@ } .pf-section-trail { + display: flex; + align-items: center; + gap: 10px; font-size: 12px; color: var(--pf-muted); } From ce9f089768d590371ad076eba845804615b23151 Mon Sep 17 00:00:00 2001 From: Aadin Date: Sun, 22 Nov 2026 13:43:05 +0530 Subject: [PATCH 115/115] feat(profile): share button styles --- src/pages/profile/profile.scss | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/pages/profile/profile.scss b/src/pages/profile/profile.scss index 8b0db5c3d5..879f627a12 100644 --- a/src/pages/profile/profile.scss +++ b/src/pages/profile/profile.scss @@ -217,6 +217,28 @@ color: var(--pf-muted); } + .pf-share { + display: inline-flex; + align-items: center; + justify-content: center; + width: 28px; + height: 28px; + margin: -6px -6px -6px 0; + padding: 0; + border: none; + border-radius: 50%; + background: transparent; + color: var(--pf-muted); + transition: + transform 0.12s ease, + background 0.12s ease; + + &:active { + background: var(--pf-lv0); + transform: scale(0.9); + } + } + .pf-card { display: flex; flex-direction: column;