Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add notifications UI #1

Open
wants to merge 102 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
3b8b932
chore: delete wrangler
zugdev Dec 4, 2024
f5e4bb7
chore: add esbuild-server
zugdev Dec 4, 2024
86017e6
chore: rename package and run yarn
zugdev Dec 4, 2024
fc3987a
chore: remove pwa for now
zugdev Dec 4, 2024
384f9e4
feat: remove referral code
zugdev Dec 4, 2024
a114168
feat: remove referral tracking from home
zugdev Dec 4, 2024
96a8ef5
feat: request notifications scope with supabase auth
zugdev Dec 4, 2024
fde134f
feat: remove org member code
zugdev Dec 4, 2024
d0e6ed2
feat: HUGE refac (wip)
zugdev Dec 5, 2024
0544b6b
feat: aggregate notification PR and Issue data
zugdev Dec 5, 2024
300ef55
feat: cleanup
zugdev Dec 5, 2024
5c5c5f7
chore: lint
zugdev Dec 5, 2024
4ee571a
feat: prefilter on reasons
zugdev Dec 5, 2024
af9c62b
chore: prettier
zugdev Dec 5, 2024
e5b8de8
feat: fetchIssueNotifications
zugdev Dec 5, 2024
85045d7
feat: unify notifications fetch
zugdev Dec 5, 2024
5f53c87
feat: add fetchAllNotifications
zugdev Dec 7, 2024
dcf8b61
feat: basic html changes
zugdev Dec 7, 2024
875ab2a
feat: render empty inbox
zugdev Dec 7, 2024
2fedc76
feat: render notifications
zugdev Dec 7, 2024
f0ea7d8
feat: fetch avatars
zugdev Dec 7, 2024
88497d7
feat: apply avatars
zugdev Dec 8, 2024
c0195e0
feat: allow closed issues and PRs for QA
zugdev Dec 8, 2024
71e7917
chore: micro lint
zugdev Dec 8, 2024
6d4b076
feat: proper issue from pull fetch
zugdev Dec 8, 2024
f55ab79
feat: only show priority label
zugdev Dec 8, 2024
34cdc0f
feat: timestamp and reason as labels
zugdev Dec 8, 2024
c303d49
feat: format reason label
zugdev Dec 8, 2024
98f1463
feat: timestamp as time ago
zugdev Dec 8, 2024
898a618
feat: proper redirect URL
zugdev Dec 8, 2024
29031dd
feat: add GitHub notification icon
zugdev Dec 8, 2024
a397f85
feat: proper label width
zugdev Dec 8, 2024
0089cde
feat: more precise linking
zugdev Dec 9, 2024
580c34d
chore: uncomment
zugdev Dec 9, 2024
a33a8d4
feat: await rendering to apply avatars
zugdev Dec 9, 2024
e6d2b36
feat: match more Resolves patterns
zugdev Dec 9, 2024
863e155
chore: rename and clear files
zugdev Dec 9, 2024
92260fb
feat: make notifications global and start sorting
zugdev Dec 9, 2024
a9bf8d3
feat: sorting
zugdev Dec 10, 2024
d56b165
feat: add author to allowed notification reason
zugdev Dec 10, 2024
68c143f
feat: gray scale gh icons
zugdev Dec 10, 2024
4b7b7a8
chore: cleanup search
zugdev Dec 10, 2024
7580e14
feat: same width for labels
zugdev Dec 10, 2024
eebbc46
chore: redundant css
zugdev Dec 10, 2024
916dc75
feat: reset container on empty rendering
zugdev Dec 10, 2024
131e0c0
chore: lint
zugdev Dec 10, 2024
97f4fdc
feat: fix sorting
zugdev Dec 12, 2024
61baec6
chore: lint
zugdev Dec 12, 2024
55d0b9e
feat: fetch all from devpool.directory
zugdev Dec 17, 2024
720c3d3
chore: lint
zugdev Dec 17, 2024
fdd4119
chore: oldest -> activity
zugdev Dec 17, 2024
b43a1d2
feat: clone in render for performance
zugdev Dec 17, 2024
b36a851
chore: lint
zugdev Dec 17, 2024
157f989
feat: optimize fetching and add testdata
zugdev Dec 17, 2024
85d3cb6
chore: lint
zugdev Dec 17, 2024
cf3485b
feat: add backlink counting
zugdev Dec 17, 2024
2d691dd
chore: lint
zugdev Dec 17, 2024
945d027
feat: sort by backlinks
zugdev Dec 17, 2024
a311f57
chore: micro lint
zugdev Dec 17, 2024
7d02b1e
feat: default sort by backlinks in second
zugdev Dec 17, 2024
25f3bd7
chore: remove logs
zugdev Dec 17, 2024
b0b8f7f
feat: fix auth in latest comment fetch
zugdev Dec 17, 2024
06b07f9
chore: lint
zugdev Dec 17, 2024
50b06b1
feat: share notification fetching
zugdev Dec 17, 2024
bef6ae4
chore: lint
zugdev Dec 17, 2024
94f86cd
feat: update test data
zugdev Dec 17, 2024
f286fdc
feat: update naming and concurrency
zugdev Dec 17, 2024
7357355
chore: micro lint
zugdev Dec 17, 2024
ccf39dc
feat: fix renderNotifications performance
zugdev Dec 17, 2024
4332c55
chore: lint
zugdev Dec 17, 2024
e1a7f27
feat: quit testData
zugdev Dec 17, 2024
8b815f2
chore: microscopic lint
zugdev Dec 17, 2024
a2b1be9
feat: add working search text filter
zugdev Dec 17, 2024
bd9dbfb
chore: lint
zugdev Dec 17, 2024
c1020a3
feat: filter by devpoolRepos
zugdev Dec 17, 2024
d1f30f7
chore: lint
zugdev Dec 17, 2024
1d3f0d2
chore: fix style
zugdev Dec 17, 2024
9ea36aa
feat: add issue number and format
zugdev Dec 17, 2024
f4c5f17
feat: add a latest comment preview
zugdev Dec 17, 2024
ac6cc43
chore: lint
zugdev Dec 17, 2024
fc1ab6b
feat: disable view toggle for now
zugdev Jan 6, 2025
a83f772
feat: filter bot notifs
zugdev Jan 6, 2025
3e94fb3
feat: add bot toggle
zugdev Jan 6, 2025
2cc1a89
feat: mark as read on click
zugdev Jan 6, 2025
3faa39d
feat: done
zugdev Jan 6, 2025
a2bf783
feat: add await to delete handler
zugdev Jan 6, 2025
1ae553d
feat: patch too
zugdev Jan 6, 2025
238a12b
feat: fix no comment
zugdev Jan 7, 2025
29e4cd4
feat: dont write data to console
zugdev Jan 7, 2025
9520dfc
feat: fix hidden bot comments
zugdev Jan 7, 2025
5c95353
feat: filter prio levels
zugdev Jan 8, 2025
e8abe66
feat: hide no comment notifs
zugdev Jan 8, 2025
db48656
feat: wrap style
zugdev Jan 8, 2025
ef6fa49
feat: big refac to not stagger comments
zugdev Jan 8, 2025
dfb1aa0
feat: padding
zugdev Jan 8, 2025
4ba40f3
feat: fix
zugdev Jan 9, 2025
a81ac5b
chore: remove leftover code
zugdev Jan 9, 2025
a2f5596
feat: change app
zugdev Jan 9, 2025
0732505
feat: render empty
zugdev Jan 9, 2025
9db3801
feat: add more precise logger
zugdev Jan 9, 2025
e6b34bb
feat: better loggin
zugdev Jan 10, 2025
01b6c74
feat: even better logs
zugdev Jan 10, 2025
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
16 changes: 16 additions & 0 deletions build/esbuild-server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import esbuild from "esbuild";
import { esBuildContext } from "./esbuild-build";
(async () => {
await server();
})().catch((error) => {
console.error("Unhandled error:", error);
process.exit(1);
});
export async function server() {
const _context = await esbuild.context(esBuildContext);
const { port } = await _context.serve({
servedir: "static",
port: 8080,
});
console.log(`http://localhost:${port}`);
}
11 changes: 0 additions & 11 deletions build/esbuild-watch.ts

This file was deleted.

106 changes: 0 additions & 106 deletions functions/referral-manager.ts

This file was deleted.

18 changes: 0 additions & 18 deletions functions/types.ts

This file was deleted.

23 changes: 0 additions & 23 deletions functions/validators.ts

This file was deleted.

8 changes: 3 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,15 @@
{
"name": "@ubiquity/work.ubq.fi",
"name": "@ubiquity/nofications.ubq.fi",
"version": "1.0.0",
"description": "The DevPool Directory for UbiquityOS.",
"description": "The GitHub notifications viewer for UbiquityOS.",
"main": "build/index.ts",
"author": "Ubiquity DAO",
"license": "MIT",
"engines": {
"node": ">=20.10.0"
},
"scripts": {
"start": "run-p start-wrangler watch",
"start-wrangler": "npx wrangler pages dev static --port 8080",
"watch": "tsx build/esbuild-watch.ts",
"start": "tsx build/esbuild-server.ts",
"build": "tsx build/esbuild-build.ts",
"format": "run-s format:lint format:prettier format:cspell",
"format:lint": "eslint --fix .",
Expand Down
2 changes: 0 additions & 2 deletions src/home/authentication.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { getGitHubAccessToken } from "./getters/get-github-access-token";
import { getGitHubUser } from "./getters/get-github-user";
import { GitHubUser } from "./github-types";
import { trackReferralCode } from "./register-referral";
import { displayGitHubUserInformation } from "./rendering/display-github-user-information";
import { renderGitHubLoginButton } from "./rendering/render-github-login-button";

Expand All @@ -18,7 +17,6 @@ export async function authentication() {

const gitHubUser: null | GitHubUser = await getGitHubUser();
if (gitHubUser) {
await trackReferralCode();
await displayGitHubUserInformation(gitHubUser);
}
}
12 changes: 0 additions & 12 deletions src/home/fetch-github/cache-integrity.ts

This file was deleted.

106 changes: 0 additions & 106 deletions src/home/fetch-github/fetch-and-display-previews.ts

This file was deleted.

13 changes: 5 additions & 8 deletions src/home/fetch-github/fetch-avatar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ import { Octokit } from "@octokit/rest";
import { getGitHubAccessToken } from "../getters/get-github-access-token";
import { getImageFromCache, saveImageToCache } from "../getters/get-indexed-db";
import { renderErrorInModal } from "../rendering/display-popup-modal";
import { organizationImageCache } from "./fetch-issues-full";
import { GitHubIssue } from "../github-types";
import { taskManager } from "../home";
import { organizationImageCache } from "./fetch-data";
import { GitHubAggregated, GitHubNotification, GitHubNotifications } from "../github-types";

// Map to track ongoing avatar fetches
const pendingFetches: Map<string, Promise<Blob | void>> = new Map();
Expand Down Expand Up @@ -100,12 +99,10 @@ export async function fetchAvatar(orgName: string): Promise<Blob | void> {
}

// fetches avatars for all tasks (issues) cached. it will fetch only once per organization, remaining are returned from cache
export async function fetchAvatars() {
const cachedTasks = taskManager.getTasks();

export async function fetchAvatars(notifications: GitHubAggregated[]) {
// fetches avatar for each organization for each task, but fetchAvatar() will only fetch once per organization, remaining are returned from cache
const avatarPromises = cachedTasks.map(async (task: GitHubIssue) => {
const [orgName] = task.repository_url.split("/").slice(-2);
const avatarPromises = notifications.map(async (task: GitHubAggregated) => {
const [orgName] = task.notification.repository.url.split("/").slice(-2);
if (orgName) {
return fetchAvatar(orgName);
}
Expand Down
Loading
Loading