Skip to content

fix: address production audit findings#6147

Open
samigulec wants to merge 11 commits into
slymnoyann:mainfrom
samigulec:claude/review-explanations-3W9Ra
Open

fix: address production audit findings#6147
samigulec wants to merge 11 commits into
slymnoyann:mainfrom
samigulec:claude/review-explanations-3W9Ra

Conversation

@samigulec
Copy link
Copy Markdown

  • Move hardcoded Alchemy RPC key to VITE_ALCHEMY_LENS_RPC env var
  • Add vercel.json SPA rewrite so nested routes don't 404
  • Use import.meta.env.DEV instead of process.env.NODE_ENV in logger
  • Guard null post.slug before navigating from Comment action
  • Add setPostContent to NewPost effect deps to avoid stale closure
  • Validate video.duration before computing thumbnail step
  • Track mounted state in ChooseThumbnail to skip post-unmount updates
  • Suppress TS deprecation errors via ignoreDeprecations: "5.0"

claude added 11 commits May 18, 2026 14:29
- Move hardcoded Alchemy RPC key to VITE_ALCHEMY_LENS_RPC env var
- Add vercel.json SPA rewrite so nested routes don't 404
- Use import.meta.env.DEV instead of process.env.NODE_ENV in logger
- Guard null post.slug before navigating from Comment action
- Add setPostContent to NewPost effect deps to avoid stale closure
- Validate video.duration before computing thumbnail step
- Track mounted state in ChooseThumbnail to skip post-unmount updates
- Suppress TS deprecation errors via ignoreDeprecations: "5.0"
Wires a "Create post" trigger into the desktop sidebar (below the
avatar) and the mobile bottom navigation so a post can be opened from
any route. Both buttons toggle the existing useNewPostModalStore, which
already renders NewPublication inside GlobalModals.
Drops the modal from md (768px) to sm (512px) so the composer feels less
sprawling on desktop.
Adds a sparkles icon to the title, hover highlight per recommended row,
and a full-width 'Show more' affordance with a top divider. Card padding
is tightened and rows now have rounded hover backgrounds.
Replaces the unconditional scrollTo(0,0) on route change with logic that
saves scroll position per pathname and restores it when the user
navigates back via browser history (POP). Forward navigation (PUSH/
REPLACE) still scrolls to top. Disables the browser's native scroll
restoration to avoid fighting our manual restore.
Previous attempt saved scroll position inside the route-change effect,
but by that time the Suspense fallback had already shrunk the document
and window.scrollY was 0 — so we saved the wrong value. Switch to a
permanent scroll listener that records the live scrollY against the
current pathname (via a ref). On POP, retry scrollTo up to 3s while
content streams in, clamping to the document's reachable max each frame
so we don't keep firing scrollTo against a too-short page.
The previous attempt was wiped out by the browser's auto-scroll when the
document shrinks during a route transition: the scroll listener fired
right after navigation with scrollY=0 and stored 0 for the path we were
about to restore. Three layered defenses:

- Ignore scroll saves for 500ms after a route change so transitional
  zero-Y events do not overwrite real positions.
- Persist positions to sessionStorage so reloads (and Vercel preview
  hops) keep the history.
- Watch document mutations and retry scrollTo for up to 4s so the
  position is reached as virtualized lists stream items in.
Drops a fixed, blurred-orb backdrop behind the app that hints at the
logo's brand-500/600 colors. Three radial orbs float slowly with a
faint dot-noise overlay; opacities are tuned separately for light and
dark mode so it feels warm in light and glowing in dark. Respects
prefers-reduced-motion.
Builds the ambient background up to a five-layer composition:

- conic-gradient aurora rotating over 90s, blurred 90px, for slow
  color drift
- a hero glow at the top-center that breathes 12s, mirroring the logo
  glow tone
- the existing three drifting orbs
- a cursor-tracked radial spotlight in brand-500 (smoothly lerped with
  rAF, disabled for coarse pointers and reduced-motion users)
- an SVG fractal-noise filter overlay for cinematic grain, blended
  with overlay (light) and soft-light (dark)

Dark mode uses screen/soft-light blends and higher opacities for a
neon feel; light mode uses lower opacities with overlay/multiply so it
reads as warm and airy.
…st, audio)

Layers four interactions onto the ambient backdrop:

- Scroll parallax: orbs ride three speeds (-0.12 / -0.22 / -0.35) via
  --scroll-y so the depth field shifts as you scroll.
- Context-aware spotlight tint: hovering /posts/* links shifts the
  cursor spotlight to green, /account/* and /u/* to blue, /g/* to
  purple, and reverts to brand pink elsewhere. The RGB channels are
  lerped per frame so the color drifts smoothly.
- Like burst: liking a post dispatches a 'hey:like' CustomEvent with
  the button's screen coordinates; the backdrop spawns a brand-tinted
  burst that expands and fades over 1.8s.
- Audio-reactive mode: an opt-in mic toggle (bottom-right, desktop
  pointer only) drives a --audio variable from the analyser's
  bass-mid band, modulating orb brightness and saturation in real
  time. Stream is torn down cleanly when toggled off.
The aurora layer, cursor spotlight, hero glow, scroll parallax,
hover-tinted spotlight, like burst and audio-reactive mode added on top
of the original ambient backdrop were a bit much. Restore
AmbientBackground.tsx, styles.css and Like.tsx to their state at
92028f2: three slowly drifting brand orbs plus a dot-noise overlay,
tuned separately for light and dark mode.
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.

2 participants