Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
5af136b
feat(profile): add local coding stats tracker and profile page
heyitsaadin Nov 21, 2026
8d88d1b
Import profileStats so the sidebar can start tracking on app launch
heyitsaadin Nov 21, 2026
b461d18
Drop the old user context menu ref
heyitsaadin Nov 21, 2026
a5da65d
Remove the small popup markup, replaced by the profile page
heyitsaadin Nov 21, 2026
d206b9e
Open the new profile page on avatar tap; make logout reusable from th…
heyitsaadin Nov 21, 2026
5819845
Start the on-device coding stats tracker when the sidebar is created
heyitsaadin Nov 21, 2026
c9ec8b7
Biome formatting: wrap long Date constructor (week loop)
heyitsaadin Nov 21, 2026
bab31bb
Biome formatting: wrap long Date constructor (streak loop)
heyitsaadin Nov 21, 2026
1382058
Biome formatting: wrap toLocaleDateString options
heyitsaadin Nov 21, 2026
bd1a7d4
Biome formatting: break the initial chain
heyitsaadin Nov 21, 2026
25276e3
Biome formatting: wrap empty-state JSX
heyitsaadin Nov 21, 2026
e85a6c0
Biome formatting: wrap plugins dynamic import
heyitsaadin Nov 21, 2026
ff5342a
feat(profile): work logged out, add Sign in button on the page
heyitsaadin Nov 21, 2026
2e21f3a
Styles for the signed-out hero and Sign in button
heyitsaadin Nov 21, 2026
568a727
Avatar tap always opens the profile page; login now starts from the page
heyitsaadin Nov 21, 2026
cc86edf
Remove unused confirm import
heyitsaadin Nov 21, 2026
150035a
refactor(profile): minimal redesign with GitHub contribution graph, d…
heyitsaadin Nov 21, 2026
c5d29a6
chore(sidebar): remove profileStats import
heyitsaadin Nov 21, 2026
26a8003
chore(sidebar): stop starting the stats tracker
heyitsaadin Nov 21, 2026
d895eaa
style(profile): fix Biome formatting in github.js
heyitsaadin Nov 21, 2026
9021ff6
feat(profile): local activity graph (time, lines, files, streak, top …
heyitsaadin Nov 22, 2026
a25d562
feat(sidebar): import activity tracker
heyitsaadin Nov 22, 2026
6e70625
feat(sidebar): start the activity tracker
heyitsaadin Nov 22, 2026
e9cfc36
feat(editor): import activity tracker
heyitsaadin Nov 22, 2026
e36b106
feat(editor): count typed lines for the activity graph
heyitsaadin Nov 22, 2026
900a1e9
feat(helpers): import activity tracker
heyitsaadin Nov 22, 2026
7064fa6
feat(helpers): count created files for the activity graph
heyitsaadin Nov 22, 2026
91cdec9
fix(activity): credit languages only while typing; lines/files only a…
heyitsaadin Nov 22, 2026
16e0e82
fix(editor): tell the tracker which file is being edited
heyitsaadin Nov 22, 2026
32b1cf7
refactor(profile): drop unused plural helper
heyitsaadin Nov 22, 2026
3c278e5
refactor(profile): tooltip shows only date and time
heyitsaadin Nov 22, 2026
1d1086a
refactor(profile): today summary shows only time
heyitsaadin Nov 22, 2026
ebde504
refactor(profile): show only time, streak and active days
heyitsaadin Nov 22, 2026
9321b03
i18n(profile): add strings for the profile page
heyitsaadin Nov 22, 2026
5ed375a
chore(sidebar): remove unused user-menu styles
heyitsaadin Nov 22, 2026
f6a06b6
fix(sidebar): ignore repeat avatar taps and show a loader on slow acc…
heyitsaadin Nov 22, 2026
4f0b844
fix(profile): translatable strings and consistent row value styling
heyitsaadin Nov 22, 2026
8553ee5
style(profile): fix Biome formatting in signOut
heyitsaadin Nov 22, 2026
56ec551
i18n(profile): add best streak string
heyitsaadin Nov 22, 2026
ee7faf3
feat(profile): language colors helper
heyitsaadin Nov 22, 2026
f4e1554
feat(profile): show best streak
heyitsaadin Nov 22, 2026
cba25ea
feat(profile): stacked language strip with per-language colors
heyitsaadin Nov 22, 2026
2054b55
style(profile): follow the theme's accent color
heyitsaadin Nov 22, 2026
bfbaf8a
style(profile): heatmap shades use the accent color
heyitsaadin Nov 22, 2026
47f5ebe
style(profile): links use the accent color
heyitsaadin Nov 22, 2026
c3c8a1f
style(profile): verified tick uses the accent color
heyitsaadin Nov 22, 2026
107f6bb
style(profile): meta link uses the accent color
heyitsaadin Nov 22, 2026
3a5fad0
feat(profile): stacked language strip styles
heyitsaadin Nov 22, 2026
6538bd7
i18n(profile): add this week string
heyitsaadin Nov 22, 2026
7dbfe36
feat(profile): heatmap weekday labels, today ring and tap highlight
heyitsaadin Nov 22, 2026
7b065b3
feat(profile): render heatmap with its weekday labels
heyitsaadin Nov 22, 2026
53c1f7b
feat(profile): this week bar chart
heyitsaadin Nov 22, 2026
2ac7f08
feat(profile): add this week section to the page
heyitsaadin Nov 22, 2026
b654c69
style(profile): heatmap scroll area sits beside the weekday labels
heyitsaadin Nov 22, 2026
92e389b
style(profile): today ring and selected-cell highlight
heyitsaadin Nov 22, 2026
bd9b976
style(profile): weekday label column for the heatmap
heyitsaadin Nov 22, 2026
d331a20
style(profile): this week bar chart
heyitsaadin Nov 22, 2026
5edc2fc
style(profile): fix Biome formatting in week chart
heyitsaadin Nov 22, 2026
665d2b2
i18n(ar-ye): add profile page strings
heyitsaadin Nov 22, 2026
bea47b6
i18n(az-az): add profile page strings
heyitsaadin Nov 22, 2026
a328610
i18n(be-by): add profile page strings
heyitsaadin Nov 22, 2026
32ce36e
i18n(bn-bd): add profile page strings
heyitsaadin Nov 22, 2026
c0e4c74
i18n(cs-cz): add profile page strings
heyitsaadin Nov 22, 2026
595ca7e
i18n(de-de): add profile page strings
heyitsaadin Nov 22, 2026
73129c8
i18n(es-sv): add profile page strings
heyitsaadin Nov 22, 2026
cc91c6c
i18n(fr-fr): add profile page strings
heyitsaadin Nov 22, 2026
6cc76c0
i18n(he-il): add profile page strings
heyitsaadin Nov 22, 2026
4c50c1d
i18n(hi-in): add profile page strings
heyitsaadin Nov 22, 2026
748274b
i18n(hu-hu): add profile page strings
heyitsaadin Nov 22, 2026
7a23132
i18n(id-id): add profile page strings
heyitsaadin Nov 22, 2026
b8ff5fd
i18n(ir-fa): add profile page strings
heyitsaadin Nov 22, 2026
ad0a6cb
i18n(it-it): add profile page strings
heyitsaadin Nov 22, 2026
216d641
i18n(ja-jp): add profile page strings
heyitsaadin Nov 22, 2026
3d29f76
i18n(ko-kr): add profile page strings
heyitsaadin Nov 22, 2026
6073612
i18n(ln-ln): add profile page strings
heyitsaadin Nov 22, 2026
2faa6f5
i18n(ml-in): add profile page strings
heyitsaadin Nov 22, 2026
319baa0
i18n(mm-unicode): add profile page strings
heyitsaadin Nov 22, 2026
329a1ce
i18n(mm-zawgyi): add profile page strings
heyitsaadin Nov 22, 2026
28ab6d9
i18n(pl-pl): add profile page strings
heyitsaadin Nov 22, 2026
60d74fd
i18n(pt-br): add profile page strings
heyitsaadin Nov 22, 2026
2948997
i18n(pu-in): add profile page strings
heyitsaadin Nov 22, 2026
4103466
i18n(ru-ru): add profile page strings
heyitsaadin Nov 22, 2026
69411a3
i18n(tl-ph): add profile page strings
heyitsaadin Nov 22, 2026
cceb4fd
i18n(tr-tr): add profile page strings
heyitsaadin Nov 22, 2026
0081a02
i18n(uk-ua): add profile page strings
heyitsaadin Nov 22, 2026
00a0c08
i18n(uz-uz): add profile page strings
heyitsaadin Nov 22, 2026
5a3b606
i18n(vi-vn): add profile page strings
heyitsaadin Nov 22, 2026
ab981e3
i18n(zh-cn): add profile page strings
heyitsaadin Nov 22, 2026
78626d1
i18n(zh-hant): add profile page strings
heyitsaadin Nov 22, 2026
7b9e120
i18n(zh-tw): add profile page strings
heyitsaadin Nov 22, 2026
73b237c
Merge pull request #5 from heyitsaadin/main
heyitsaadin Nov 22, 2026
eacf696
feat(profile): sample heatmap for signed-out users with no activity
heyitsaadin Nov 22, 2026
cae0de7
feat(profile): use sample data for the guest heatmap
heyitsaadin Nov 22, 2026
caf0e93
feat(profile): no today marker on the sample heatmap
heyitsaadin Nov 22, 2026
058d3cc
feat(profile): sample cells have no tooltip
heyitsaadin Nov 22, 2026
278ec6c
feat(profile): fade the sample heatmap
heyitsaadin Nov 22, 2026
1cb7ee3
feat(profile): hint text under the sample heatmap
heyitsaadin Nov 22, 2026
d3e1726
feat(profile): refresh heatmap when signing in or out
heyitsaadin Nov 22, 2026
805111d
feat(profile): mark Pro avatars for the gold ring
heyitsaadin Nov 22, 2026
dae37a7
feat(profile): stagger section entrance animation
heyitsaadin Nov 22, 2026
98ee0d2
feat(profile): entrance animation keyframes
heyitsaadin Nov 22, 2026
7e7233e
feat(profile): entrance animation and sample heatmap styles
heyitsaadin Nov 22, 2026
f177efb
feat(profile): subtle gold ring on Pro avatars
heyitsaadin Nov 22, 2026
640cbae
feat(profile): press feedback transition on rows
heyitsaadin Nov 22, 2026
b2c9998
feat(profile): scale-down on pressed rows
heyitsaadin Nov 22, 2026
6793ef9
feat(profile): press feedback transition on buttons
heyitsaadin Nov 22, 2026
e9666a6
feat(profile): scale-down on pressed buttons
heyitsaadin Nov 22, 2026
2fa6ec0
style(profile): match Biome formatting for heatmap wrapper
heyitsaadin Nov 22, 2026
a13a7c7
feat(profile): render the activity card to an image for sharing
heyitsaadin Nov 22, 2026
a879d25
feat(profile): import share card renderer
heyitsaadin Nov 22, 2026
ad35cde
feat(profile): share icon
heyitsaadin Nov 22, 2026
93b32d9
feat(profile): helper to share an image through the system share sheet
heyitsaadin Nov 22, 2026
2de7f62
feat(profile): share button on the activity card
heyitsaadin Nov 22, 2026
046673e
feat(profile): hide share button until there is activity
heyitsaadin Nov 22, 2026
19f8f81
feat(profile): lay out the section trail with the share button
heyitsaadin Nov 22, 2026
ce9f089
feat(profile): share button styles
heyitsaadin Nov 22, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
143 changes: 68 additions & 75 deletions src/components/sidebar/index.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
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";
import activity from "lib/activity";
import auth, { loginEvents } from "lib/auth";
import config from "lib/config";
import helpers from "utils/helpers";
Expand Down Expand Up @@ -42,7 +42,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";
Expand All @@ -67,18 +66,6 @@ function create($container, $toggler) {
onmousedown={onresize}
ontouchstart={onresize}
></div>

<div ref={userContextMenu} className="user-menu">
<div className="user-menu-header">
<div className="user-menu-name"></div>
<div className="user-menu-email"></div>
</div>
{/* <div className="user-menu-separator"></div> */}
<div className="user-menu-item" onclick={handleLogout}>
<span className="icon logout"></span>
{strings.logout}
</div>
</div>
</div>
);
const mask = <span className="mask" onclick={hide}></span>;
Expand Down Expand Up @@ -106,87 +93,91 @@ function create($container, $toggler) {
}

loginEvents.addListener(updateSidebarAvatar);
activity.init();

async function handleUserIconClick(e) {
try {
loader.create(strings["login"], strings["loading..."]);
let user = await auth.getLoggedInUser();

if (!user) {
const confirmation = await confirm(
strings.confirm,
strings["confirm-login"],
);
let openingProfile = false;

if (!confirmation) {
return;
}
async function handleUserIconClick() {
// A second tap while the profile is still opening would stack two pages.
if (openingProfile) return;
openingProfile = true;

loader.show();
// 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();
}
};

await auth.login();
try {
let user = null;
try {
user = await auth.getLoggedInUser();
if (!user) {
return;
}
} catch (error) {
// offline or server error: still open the page as signed out
console.error("Error checking login status:", error);
}
stopLoader();

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 = (
<div style={{ display: "flex" }}>
{user.name}
{Boolean(user.verified) && (
<span className="icon verified badge"></span>
)}
{Boolean(user.acode_pro) && <span className="badge">Pro</span>}
</div>
);
}

if (menuEmail) {
menuEmail.textContent = user.email || "";
}

setTimeout(() => {
document.addEventListener("click", handleClickOutside);
}, 10);
} else {
document.removeEventListener("click", handleClickOutside);
}
const { default: openProfile } = await import(
/* webpackChunkName: "profile" */ "pages/profile"
);
await openProfile({
user,
getAvatarSrc,
onLogin: handleLogin,
onLogout: handleLogout,
});
} catch (error) {
console.error("Error checking login status:", error);
console.error("Error opening profile:", error);
} finally {
loader.destroy();
stopLoader();
openingProfile = false;
}
}

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);
/**
* Starts the Acode login flow. Used by the profile page.
* @returns {Promise<object|null>} 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;
}
}

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<boolean>}
*/
async function handleLogout() {
loader.create(strings["logout"], strings["loading..."]);
loader.show();
try {
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");

Expand All @@ -196,11 +187,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();
}
Expand Down
77 changes: 0 additions & 77 deletions src/components/sidebar/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
}
21 changes: 21 additions & 0 deletions src/lang/ar-ye.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions src/lang/az-az.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
21 changes: 21 additions & 0 deletions src/lang/be-by.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
21 changes: 21 additions & 0 deletions src/lang/bn-bd.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading
Loading