hackatime/app/javascript/pages/Home/SignedIn.svelte
Mahad Kalam ef3f36c829
Inertia migration/UI3 (#911)
* Inertia p1?

* Inertia'fied signed out homepage?

* Split up signed in page

* WIP signed in v2?

* Better signed in?

* Clean up extensions page!

* Fix currently hacking

* Better docs page?

* Docs update 2

* Clean up "What is Hackatime?" + get rid of that godawful green dev mode

* Better nav?

* Cleaner settings?

* Fix commit times

* Fix flashes + OS improv

* Setup v2

* Readd some of the syncers?

* Remove stray emdash

* Clean up Step 3

* Oops, remove .vite

* bye bye, /inertia-example

* bin/rubocop -A

* Fix docs vuln
2026-02-09 11:26:30 +00:00

125 lines
3.3 KiB
Svelte

<script lang="ts">
import type {
ActivityGraphData,
} from "../../types/index";
import BanNotice from "./signedIn/BanNotice.svelte";
import GitHubLinkBanner from "./signedIn/GitHubLinkBanner.svelte";
import SetupNotice from "./signedIn/SetupNotice.svelte";
import TodaySentence from "./signedIn/TodaySentence.svelte";
import Dashboard from "./signedIn/Dashboard.svelte";
import ActivityGraph from "./signedIn/ActivityGraph.svelte";
type SocialProofUser = { display_name: string; avatar_url: string };
type FilterableDashboardData = {
total_time: number;
total_heartbeats: number;
top_project: string | null;
top_language: string | null;
top_editor: string | null;
top_operating_system: string | null;
project_durations: Record<string, number>;
language_stats: Record<string, number>;
editor_stats: Record<string, number>;
operating_system_stats: Record<string, number>;
category_stats: Record<string, number>;
weekly_project_stats: Record<string, Record<string, number>>;
project: string[];
language: string[];
editor: string[];
operating_system: string[];
category: string[];
selected_interval: string;
selected_from: string;
selected_to: string;
selected_project: string[];
selected_language: string[];
selected_editor: string[];
selected_operating_system: string[];
selected_category: string[];
};
let {
flavor_text,
trust_level_red,
show_wakatime_setup_notice,
ssp_message,
ssp_users_recent,
ssp_users_size,
github_uid_blank,
github_auth_path,
wakatime_setup_path,
show_logged_time_sentence,
todays_duration_display,
todays_languages,
todays_editors,
filterable_dashboard_data,
activity_graph,
}: {
flavor_text: string;
trust_level_red: boolean;
show_wakatime_setup_notice: boolean;
ssp_message?: string | null;
ssp_users_recent: SocialProofUser[];
ssp_users_size: number;
github_uid_blank: boolean;
github_auth_path: string;
wakatime_setup_path: string;
show_logged_time_sentence: boolean;
todays_duration_display: string;
todays_languages: string[];
todays_editors: string[];
filterable_dashboard_data: FilterableDashboardData;
activity_graph: ActivityGraphData;
} = $props();
</script>
<div>
<!-- Header Section -->
<div class="mb-8">
<div class="flex items-center space-x-2">
<p class="italic text-gray-400 m-0">
{@html flavor_text}
</p>
</div>
<h1 class="font-bold mt-2 mb-4 text-3xl md:text-4xl">
Keep Track of <span class="text-primary">Your</span> Coding Time
</h1>
</div>
{#if trust_level_red}
<BanNotice />
{/if}
{#if show_wakatime_setup_notice}
<SetupNotice
{wakatime_setup_path}
{ssp_message}
{ssp_users_recent}
{ssp_users_size}
/>
{/if}
{#if github_uid_blank}
<GitHubLinkBanner {github_auth_path} />
{/if}
<div class="flex flex-col gap-8">
<!-- Today Stats & Leaderboard -->
<div>
<TodaySentence
{show_logged_time_sentence}
{todays_duration_display}
{todays_languages}
{todays_editors}
/>
</div>
<!-- Main Dashboard -->
<Dashboard data={filterable_dashboard_data} />
<!-- Activity Graph -->
<ActivityGraph data={activity_graph} />
</div>
</div>