Skip to content

Dev - #477

Merged
aamoghS merged 7 commits into
mainfrom
dev
Oct 5, 2026
Merged

Dev#477
aamoghS merged 7 commits into
mainfrom
dev

Conversation

@aamoghS

@aamoghS aamoghS commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

Note

Low Risk
Mostly UI, CSS, and static hosting/service-worker caching; no auth or data-model changes, with intentional tradeoff of more network use for HTML on return visits.

Overview
Hacklytics 2027 adds a light/dark “greenhouse” theme: CSS tokens for data-theme and system preference, a pre-paint localStorage script to avoid flash, navbar ThemeToggle, and theme-aware viewport colors and neon glow variables.

Caching/deploy freshness is tightened for the event site: Firebase headers long-cache only /_next/static/**, revalidate HTML on every load, and fonts/images use shorter SWR; the service worker bumps to v4 and serves HTML network-first (offline cache fallback only) so repeat visitors see new deploys instead of stale pages.

Portal /hacklytics is restyled to match hacklytics.io via .hl-theme tokens and Hacklytics fonts, updates masthead/linking to hacklytics.io, adds a decorative pixel flower bed, and softens “premier” wording in metadata.

Reviewed by Cursor Bugbot for commit 6b96cc9. Bugbot is set up for automated code reviews on this repo. Configure here.

aamoghS and others added 7 commits October 5, 2026 12:05
/hacklytics is where people land from hacklytics.io, but it rendered in
the portal's newsletter style with the "Query." wordmark. It now wears
the event site's look, scoped to the route:

- .hl-theme overrides the portal tokens on the page wrapper (dark grey
  ground, bloom pink accent, Silkscreen headings, Instrument Sans text),
  so the shared primitives and the interest form follow unchanged
- fonts loaded with next/font in the route layout
- masthead is the Hacklytics wordmark linking to hacklytics.io
- a still flower bed from the event site's sprites, a few in bloom
- metadata no longer calls it "premier"
Visitors from before the 2027 redesign kept getting the old site: the
service worker served pages stale-while-revalidate from a cache that
outlived deploys, and sw.js itself matched the **/*.js rule and was
served "immutable" for a year.

- public/sw.js is now a kill switch: browsers with the old worker pick
  it up on their next update check, delete every cache, unregister and
  reload open tabs from the network. Keep it deployed for a season
- the site no longer registers a service worker
  (ServiceWorkerRegistrar removed)
- firebase.json (hacklytics): only fingerprinted /_next/static/** is
  immutable; unhashed public fonts join images at 1 day + SWR; HTML is
  max-age=0, must-revalidate; /sw.js now only matches its no-store rule
Revises the previous commit: caching stays, only stale pages go.

- restore the service worker and its registration
- pages are network-first: every visit gets the latest deploy, and
  the cache is the offline fallback ("/" stands in for an uncached
  page). They used to be stale-while-revalidate, which showed the
  previous deploy first
- CACHE_VERSION hacklytics-v4: activation deletes every older cache,
  including pages cached before the greenhouse redesign
- fingerprinted /_next/static stays cache-first; public images and
  fonts stay stale-while-revalidate
- the firebase.json header changes from the previous commit stand
  (sw.js never cached, HTML revalidates, only hashed files immutable)
The dark greenhouse stays the default for anyone whose system is dark;
visitors can now switch to a light "day" version.

- light tokens: cool sage ground (not cream), near-black ink, and a
  deeper pink (#c2185b) so the accent still passes contrast as text
  on a pale ground; the bloom glow softens to match
- used when the visitor picks light, or has no saved choice and their
  system is light (prefers-color-scheme)
- pixel sun/moon toggle in the navbar; the choice is saved in
  localStorage and applied by a tiny pre-paint script, so there is no
  flash of the other theme
- the last hardcoded colours (button hover, outline border, neon
  halo) move into tokens; theme-color follows the system setting
Give /hacklytics the Hacklytics site's look
Hacklytics: keep caching, always show the latest deploy
@aamoghS
aamoghS merged commit 2455470 into main Oct 5, 2026
5 of 10 checks passed
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 6b96cc9):

https://hacklytics2027--pr-477-476wltfn.web.app

(expires Mon, 12 Oct 2026 19:56:43 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: c48ba34db61581e25fe2978355160b5eefe0e83f

@greptile-apps

greptile-apps Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

RetriggerConfidence Score: 4/5

[Medium risk] Adds dark mode toggle and redesigns the Hacklytics event page.

The PR appears safe to merge, with three non-blocking theme issues worth fixing.

Findings

  1. P2 Pressed button text fades ▶
  2. P2 Browser color ignores theme choice ▶
  3. P2 Open tabs keep old theme ▶
Summary

This PR adds a light-theme switch to the Hacklytics site, refreshes the public portal page’s look, and changes hosting and service-worker caching so returning visitors can see new pages sooner.

  • The light theme has a hard-to-read pressed button state.
  • An explicit theme choice does not update the mobile browser color or other open tabs.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Visitor opens Hacklytics] --> B{Saved theme?}
  B -->|Yes| C[Use saved light or dark choice]
  B -->|No| D[Use device setting]
  C --> E[Show page and theme toggle]
  D --> E
  E --> F[Visitor switches theme]
  F --> G[Update this page and save choice]
Loading

Reviews (1) · Last reviewed commit: "Merge pull request #476 from DataScience..."


--bloom: #c2185b;
--bloom-hover: #a8134d;
--bloom-deep: #8e0f41;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Pressed button text fades

In light mode, pressing a btn-bloom button puts near-black text on a dark pink background. The “Notify me” label becomes hard to read while pressed. Keep the pressed text light in this theme.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

Comment on lines +25 to +27
themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#eef1ec" },
{ media: "(prefers-color-scheme: dark)", color: "#131715" },

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Browser color ignores theme choice

The new browser colors follow the device setting, but ThemeToggle lets visitors choose the opposite theme. On a mobile browser, the page changes color while the browser’s top bar keeps the device’s color. Update that color when the visitor switches themes.

Comment on lines +10 to +20
const subscribe = (onChange: () => void) => {
const media = window.matchMedia("(prefers-color-scheme: light)");
const observer = new MutationObserver(onChange);
observer.observe(document.documentElement, {
attributes: true,
attributeFilter: ["data-theme"],
});
media.addEventListener("change", onChange);
return () => {
observer.disconnect();
media.removeEventListener("change", onChange);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Open tabs keep old theme

ThemeToggle watches the device setting and this tab’s data-theme, but not choices saved by another tab. If someone switches themes in one tab, another open tab keeps its old theme until it reloads. Listen for changes to the saved choice and apply them to open tabs.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6b96cc9. Configure here.

headers: { "Content-Type": "text/plain" },
});
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Preload failure serves stale pages

Medium Severity

pageNetworkFirst treats a rejected preloadResponse as a total network failure and returns the cached page (or /) without trying fetch. The previous handler caught that rejection and still went to the network. Returning visitors can keep seeing the last deploy even while they are online.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b96cc9. Configure here.

themeColor: [
{ media: "(prefers-color-scheme: light)", color: "#eef1ec" },
{ media: "(prefers-color-scheme: dark)", color: "#131715" },
],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theme color ignores saved choice

Low Severity

themeColor still follows prefers-color-scheme only. A saved hl-theme can paint the page #eef1ec or #131715 while the browser chrome stays on the other ground, so the status bar no longer matches the page.

Additional Locations (1)
Fix in Cursor Fix in Web

Triggered by learned rule: Hacklytics greenhouse-at-night look; PixelBed not PixelGarden

Reviewed by Cursor Bugbot for commit 6b96cc9. Configure here.

--bloom: #c2185b;
--bloom-hover: #a8134d;
--bloom-deep: #8e0f41;
--on-bloom: #ffffff;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Light theme active button contrast

Low Severity

Light theme sets --ink to near-black while .btn-bloom:active still paints that ink on --bloom-deep. Pressing Notify me (and other bloom buttons) briefly shows dark text on dark pink. --on-bloom is already white in this theme and is unused here.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6b96cc9. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant