From 7e89e6dda2b3557aae5ec38603c9cca77df594c1 Mon Sep 17 00:00:00 2001 From: Michael Freno Date: Sun, 4 Jan 2026 11:14:54 -0500 Subject: [PATCH] removed excess comments --- src/app.tsx | 9 - src/components/ActivityHeatmap.tsx | 8 +- src/components/Bars.tsx | 34 +-- src/components/Btop.tsx | 17 -- src/components/CountdownCircleTimer.tsx | 4 - src/components/CustomScrollbar.tsx | 9 - src/components/DeletionForm.tsx | 3 - src/components/ErrorBoundaryFallback.tsx | 2 - src/components/PasswordStrengthMeter.tsx | 1 - src/components/SimpleParallax.tsx | 1 - src/components/TerminalErrorPage.tsx | 1 - src/components/Typewriter.tsx | 13 +- src/components/blog/CommentBlock.tsx | 8 - src/components/blog/CommentInputBlock.tsx | 1 - src/components/blog/CommentSorting.tsx | 3 - src/components/blog/CommentSortingSelect.tsx | 1 - src/components/blog/DeletePostButton.tsx | 1 - src/components/blog/MermaidRenderer.tsx | 2 - src/components/blog/PostBodyClient.tsx | 33 --- src/components/blog/PostSorting.tsx | 17 +- src/components/blog/PostSortingSelect.tsx | 2 - src/components/blog/TagSelector.tsx | 15 -- src/components/blog/TextEditor.tsx | 222 ++---------------- src/components/blog/extensions/Mermaid.ts | 14 -- src/config.ts | 13 +- src/context/darkMode.tsx | 9 - src/env/client.ts | 4 - src/env/server.ts | 4 - src/lib/api.ts | 4 - src/lib/client-utils.ts | 22 +- src/lib/comment-utils.ts | 75 +----- src/lib/resize-utils.ts | 5 - src/lib/s3upload.ts | 17 +- src/lib/terminal-commands.ts | 3 - src/lib/validation.ts | 11 +- src/routes/account.tsx | 13 - src/routes/api/auth/callback/github.ts | 2 - src/routes/api/auth/callback/google.ts | 2 - src/routes/api/auth/signout.ts | 7 +- src/routes/api/trpc/[trpc].ts | 7 +- src/routes/blog/[title]/index.tsx | 32 +-- src/routes/blog/index.tsx | 1 - src/routes/contact.tsx | 11 +- src/routes/error-test.tsx | 1 - src/routes/login/index.tsx | 39 +-- src/routes/login/password-reset.tsx | 11 - src/routes/login/request-password-reset.tsx | 12 +- src/routes/resume.tsx | 1 - src/routes/test-utils.tsx | 5 - src/routes/test.tsx | 28 --- src/server/api/routers/blog.ts | 4 - src/server/api/routers/database.ts | 12 - src/server/api/routers/git-activity.ts | 2 - src/server/api/routers/infill.ts | 3 - src/server/api/routers/lineage.ts | 10 +- src/server/api/routers/lineage/database.ts | 2 - .../api/routers/lineage/json-service.ts | 19 +- src/server/api/routers/misc.ts | 33 +-- src/server/api/routers/post-history.ts | 23 +- src/server/api/routers/user.ts | 2 - src/server/api/utils.ts | 6 +- src/server/audit.ts | 20 -- src/server/feature-flags.ts | 1 - src/server/init-audit-table.ts | 12 - src/server/password.ts | 8 - src/server/security.ts | 70 +----- src/types/comment.ts | 25 -- src/types/user.ts | 1 - 68 files changed, 72 insertions(+), 941 deletions(-) diff --git a/src/app.tsx b/src/app.tsx index b31be89..74ccf5c 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -27,21 +27,18 @@ function AppLayout(props: { children: any }) { let lastScrollY = 0; - // Use onMount to avoid hydration issues - window operations are client-only onMount(() => { const windowWidth = createWindowWidth(); createEffect(() => { const currentIsMobile = isMobile(windowWidth()); - // Show bars when switching to desktop if (!currentIsMobile) { setLeftBarVisible(true); setRightBarVisible(true); } }); - // Hide leftbar on mobile after 500ms with translation animation const currentIsMobile = isMobile(windowWidth()); if (currentIsMobile) { setTimeout(() => { @@ -50,7 +47,6 @@ function AppLayout(props: { children: any }) { } }); - // Auto-hide on scroll (mobile only) onMount(() => { const windowWidth = createWindowWidth(); @@ -59,7 +55,6 @@ function AppLayout(props: { children: any }) { const currentIsMobile = isMobile(windowWidth()); if (currentIsMobile && currentScrollY > MOBILE_CONFIG.SCROLL_THRESHOLD) { - // Scrolling down past threshold - hide left bar on mobile if (currentScrollY > lastScrollY) { setLeftBarVisible(false); } @@ -75,7 +70,6 @@ function AppLayout(props: { children: any }) { }); }); - // ESC key to close sidebars on mobile onMount(() => { const windowWidth = createWindowWidth(); @@ -99,7 +93,6 @@ function AppLayout(props: { children: any }) { }); }); - // Global swipe gestures to reveal/hide bars onMount(() => { const windowWidth = createWindowWidth(); let touchStartX = 0; @@ -117,7 +110,6 @@ function AppLayout(props: { children: any }) { const deltaY = touchEndY - touchStartY; const currentIsMobile = isMobile(windowWidth()); - // Only trigger if horizontal swipe is dominant if (currentIsMobile && Math.abs(deltaX) > Math.abs(deltaY)) { if (deltaX > MOBILE_CONFIG.SWIPE_THRESHOLD) { setLeftBarVisible(true); @@ -140,7 +132,6 @@ function AppLayout(props: { children: any }) { if (typeof window === "undefined") return; const currentIsMobile = isMobile(window.innerWidth); - // Only hide left bar on mobile when it's visible if (currentIsMobile && leftBarVisible()) { const target = e.target as HTMLElement; const isInteractive = target.closest( diff --git a/src/components/ActivityHeatmap.tsx b/src/components/ActivityHeatmap.tsx index 1666e8b..36b3a77 100644 --- a/src/components/ActivityHeatmap.tsx +++ b/src/components/ActivityHeatmap.tsx @@ -10,22 +10,18 @@ export const ActivityHeatmap: Component<{ contributions: ContributionDay[] | undefined; title: string; }> = (props) => { - // Generate last 12 weeks of days const weeks = createMemo(() => { const today = new Date(); const weeksData: { date: string; count: number }[][] = []; - // Start from 12 weeks ago const startDate = new Date(today); - startDate.setDate(startDate.getDate() - 84); // 12 weeks + startDate.setDate(startDate.getDate() - 84); - // Create a map for quick lookup const contributionMap = new Map(); props.contributions?.forEach((c) => { contributionMap.set(c.date, c.count); }); - // Generate weeks for (let week = 0; week < 12; week++) { const weekData: { date: string; count: number }[] = []; @@ -68,7 +64,6 @@ export const ActivityHeatmap: Component<{ when={props.contributions && props.contributions.length > 0} fallback={
- {/* Skeleton grid matching heatmap dimensions */}
{() => ( @@ -80,7 +75,6 @@ export const ActivityHeatmap: Component<{ )}
- {/* Centered spinner overlay */}
diff --git a/src/components/Bars.tsx b/src/components/Bars.tsx index 02e01aa..5e1ac2a 100644 --- a/src/components/Bars.tsx +++ b/src/components/Bars.tsx @@ -26,20 +26,14 @@ function formatDomainName(url: string): string { return withoutWww.charAt(0).toUpperCase() + withoutWww.slice(1); } -/** - * Converts a banner photo URL to its thumbnail version - * Replaces the filename with -small variant (e.g., image.jpg -> image-small.jpg) - */ function getThumbnailUrl(bannerPhoto: string | null): string { if (!bannerPhoto) return "/blueprint.jpg"; - // Check if URL contains a file extension const match = bannerPhoto.match(/^(.+)(\.[^.]+)$/); if (match) { return `${match[1]}-small${match[2]}`; } - // Fallback to original if no extension found return bannerPhoto; } @@ -77,7 +71,6 @@ export function RightBarContent() { }; onMount(() => { - // Fetch all data client-side only to avoid hydration mismatch const fetchData = async () => { try { const [ghCommits, gtCommits, ghActivity, gtActivity] = @@ -101,7 +94,6 @@ export function RightBarContent() { } }; - // Defer API calls to next tick to allow initial render to complete first setTimeout(() => { fetchData(); }, 0); @@ -168,7 +160,6 @@ export function RightBarContent() { - {/* Git Activity Section */}
{ setIsMounted(true); - // Set up window resize listener for reactive styling const handleResize = () => { setWindowWidth(window.innerWidth); }; window.addEventListener("resize", handleResize); - // Terminal-style appearance animation for "Get Lost" button const glitchChars = "!@#$%^&*()_+-=[]{}|;':\",./<>?~`"; const originalText = "What's this?"; let glitchInterval: NodeJS.Timeout; - // Delay appearance to match terminal vibe setTimeout(() => { - // Make visible immediately so typing animation is visible setGetLostVisible(true); - // Type-in animation with random characters resolving let currentIndex = 0; const typeInterval = setInterval(() => { if (currentIndex <= originalText.length) { let displayText = originalText.substring(0, currentIndex); - // Add random trailing characters if (currentIndex < originalText.length) { const remaining = originalText.length - currentIndex; for (let i = 0; i < remaining; i++) { @@ -301,14 +286,11 @@ export function LeftBar() { clearInterval(typeInterval); setGetLostText(originalText); - // Start regular glitch effect after typing completes glitchInterval = setInterval(() => { if (Math.random() > 0.9) { - // 10% chance to glitch let glitched = ""; for (let i = 0; i < originalText.length; i++) { if (Math.random() > 0.7) { - // 30% chance each character glitches glitched += glitchChars[Math.floor(Math.random() * glitchChars.length)]; } else { @@ -323,11 +305,10 @@ export function LeftBar() { } }, 150); } - }, 140); // Type speed (higher is slower) - }, 500); // Initial delay before appearing + }, 140); + }, 500); if (ref) { - // Focus trap for accessibility on mobile const handleKeyDown = (e: KeyboardEvent) => { const isMobile = window.innerWidth < BREAKPOINTS.MOBILE; @@ -346,13 +327,11 @@ export function LeftBar() { ] as HTMLElement; if (e.shiftKey) { - // Shift+Tab - going backwards if (document.activeElement === firstElement) { e.preventDefault(); lastElement.focus(); } } else { - // Tab - going forwards if (document.activeElement === lastElement) { e.preventDefault(); firstElement.focus(); @@ -392,12 +371,9 @@ export function LeftBar() { }, 0); }); - // Refetch user info whenever location changes createEffect(() => { - // Track location changes location.pathname; - // Only refetch if component is mounted if (isMounted()) { fetchUserInfo(); } @@ -433,7 +409,6 @@ export function LeftBar() { }} style={getMainNavStyles()} > - {/* Hamburger menu button - positioned at right edge of navbar */}
- {/* Navigation Links */}
    @@ -591,7 +564,6 @@ export function LeftBar() {
- {/* Get Lost button - outside Typewriter to allow glitch effect */}
  • { - // Check if mobile if (typeof window !== "undefined") { setIsMobile(window.innerWidth < BREAKPOINTS.MOBILE); @@ -49,7 +48,6 @@ export function Btop(props: BtopProps) { onCleanup(() => window.removeEventListener("resize", handleResize)); } - // Animate CPU usage const cpuInterval = setInterval(() => { setCpuUsage((prev) => { const change = (Math.random() - 0.5) * 10; @@ -58,7 +56,6 @@ export function Btop(props: BtopProps) { }); }, 1000); - // Animate memory usage const memInterval = setInterval(() => { setMemUsage((prev) => { const change = (Math.random() - 0.5) * 5; @@ -67,13 +64,11 @@ export function Btop(props: BtopProps) { }); }, 1500); - // Animate network const netInterval = setInterval(() => { setNetDown(Math.floor(Math.random() * 1000)); setNetUp(Math.floor(Math.random() * 100)); }, 800); - // Animate processes const procInterval = setInterval(() => { setProcesses((prev) => prev.map((proc) => ({ @@ -90,12 +85,10 @@ export function Btop(props: BtopProps) { ); }, 2000); - // Keyboard handler for :q const handleKeyPress = (e: KeyboardEvent) => { if (!isMobile() && e.key === "q" && e.shiftKey && e.key === ":") { props.onClose(); } - // Simple 'q' press to quit if (!isMobile() && e.key === "q") { props.onClose(); } @@ -120,9 +113,7 @@ export function Btop(props: BtopProps) { return (
    - {/* Main btop container */}
    - {/* Header */}
    @@ -145,13 +136,10 @@ export function Btop(props: BtopProps) {
    - {/* Content */}
    - {/* System Stats */}
    System Resources
    - {/* CPU */}
    CPU [{createBar(cpuUsage())}] @@ -159,7 +147,6 @@ export function Btop(props: BtopProps) { 2.4 GHz
    - {/* Memory */}
    MEM [{createBar(memUsage())}] @@ -169,7 +156,6 @@ export function Btop(props: BtopProps) {
    - {/* Network */}
    NET ↓ {netDown()} KB/s @@ -178,7 +164,6 @@ export function Btop(props: BtopProps) {
    - {/* Process List */}
    Processes @@ -224,7 +209,6 @@ export function Btop(props: BtopProps) {
    - {/* Footer info */}
    - {/* Overlay background */}
    = (props) => { props.initialRemainingTime ?? props.duration ); - // Calculate progress (0 to 1) const progress = () => remainingTime() / props.duration; const strokeDashoffset = () => circumference * (1 - progress()); @@ -62,7 +61,6 @@ const CountdownCircleTimer: Component = (props) => { height={props.size} style={{ transform: "rotate(-90deg)" }} > - {/* Background circle */} = (props) => { stroke="#e5e7eb" stroke-width={props.strokeWidth} /> - {/* Progress circle */} = (props) => { stroke-linecap="round" /> - {/* Timer text in center */}
    0 ? (scrollTop / maxScroll) * 100 : 0; setScrollPercentage(percentage); - // Show scrollbar on scroll if autoHide enabled if (props.autoHide) { setIsVisible(true); clearTimeout(hideTimeout); @@ -106,10 +103,8 @@ export default function CustomScrollbar(props: CustomScrollbarProps) { onMount(() => { if (!containerRef) return; - // Initial update updateScrollbar(); - // Update after delays to catch dynamically loaded content setTimeout(() => updateScrollbar(), 100); setTimeout(() => updateScrollbar(), 500); @@ -118,7 +113,6 @@ export default function CustomScrollbar(props: CustomScrollbarProps) { updateScrollbar(); }; - // Debounced mutation observer let mutationTimeout: NodeJS.Timeout; const observer = new MutationObserver(() => { clearTimeout(mutationTimeout); @@ -132,7 +126,6 @@ export default function CustomScrollbar(props: CustomScrollbarProps) { subtree: true }); - // Use passive scroll listener for better performance containerRef.addEventListener("scroll", updateScrollbar, { passive: true }); window.addEventListener("resize", handleResize); @@ -159,7 +152,6 @@ export default function CustomScrollbar(props: CustomScrollbarProps) { "-ms-overflow-style": "none" }} > - {/* Hide default scrollbar */}