Skip to content

Commit f7e3b36

Browse files
committed
fix(landing): correct sizes underestimate + fix dead .map header rule
- integrations-callout: derive sizes from the section's actual grid math (fixed 386px copy column, 40px gap, section gutters) instead of an approximated vw fraction. Verified against a static reproduction of the layout rendered at each Tailwind breakpoint - the old 110vw mobile tier underestimated real render width by ~3% right at the 1023px stack boundary, which could cause the browser to pick a too-small srcset candidate and upscale. - next.config: the .map header rule's trailing `$` was read as a literal character by Next's path-to-regexp source matcher, not a regex anchor, so the rule never matched a real .map URL (confirmed via routes-manifest regex + a live header check). Removed the dead anchor and added a bounded Cache-Control so a future decision to stop shipping source maps isn't undermined by a 1yr immutable cache on already-fetched maps.
1 parent 3de958b commit f7e3b36

2 files changed

Lines changed: 29 additions & 8 deletions

File tree

apps/sim/app/(landing)/components/features/components/integrations-callout/integrations-callout.tsx

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,17 @@ import { CalloutFrame } from '@/app/(landing)/components/features/components/cal
1818
* peek at part of the product rather than a complete miniature, scaling
1919
* proportionally with the aspect-locked stage. Decorative.
2020
*
21-
* `sizes` mirrors the sibling backdrop image's own hint (`FeatureCard`'s
22-
* `70vw`/`900px` stage width), scaled by this callout's 125% overhang, with an
23-
* extra `max-width: 1023px` tier for `FeatureCard`'s `max-lg:grid-cols-1`
24-
* stack (media becomes ~full card width there, not the desktop 2-column
25-
* remainder) - verified against Lighthouse's measured mobile render width.
21+
* `sizes` is derived directly from the section's grid math rather than
22+
* approximated, then rounded up to the worst-case (peak render/viewport
23+
* ratio) in each tier so the browser never under-fetches:
24+
* `callout = 1.25 * (viewport - 2*gutter - 32px card padding - [40px gap +
25+
* 386px fixed copy column, desktop only])`, gutter = `px-20`/`max-lg:px-8`/
26+
* `max-sm:px-5` from `Features`'s grid, matching `FeatureCard`'s
27+
* `max-lg:grid-cols-1` stack. Peak ratios (verified against a static
28+
* reproduction of this exact layout rendered at each Tailwind breakpoint):
29+
* ~113.3% at the `max-width: 1023px` stacked tier's own upper edge, ~108.6%
30+
* at `1460px` (the container's cap, where render width stops growing with
31+
* viewport - hence the final tier is a flat px value, not a vw fraction).
2632
*/
2733
export function IntegrationsCallout() {
2834
return (
@@ -35,7 +41,7 @@ export function IntegrationsCallout() {
3541
src='/landing/feature-integrate-ui.png'
3642
alt=''
3743
fill
38-
sizes='(max-width: 1023px) 110vw, (max-width: 1460px) 87.5vw, 1125px'
44+
sizes='(max-width: 1023px) 114vw, (max-width: 1460px) 109vw, 1053px'
3945
className='object-cover'
4046
/>
4147
</CalloutFrame>

apps/sim/next.config.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,14 +253,29 @@ const nextConfig: NextConfig = {
253253
},
254254
],
255255
},
256-
// Block access to sourcemap files (defense in depth)
256+
// Block access to sourcemap files (defense in depth). The trailing
257+
// `$` this rule previously ended with is not a regex anchor in Next's
258+
// `source` matcher (path-to-regexp syntax, not raw regex) - it matched
259+
// a literal `$` character, so this rule never actually fired against
260+
// real `.map` URLs. Next already anchors the compiled pattern at both
261+
// ends, so no trailing anchor is needed here.
262+
//
263+
// Also bounds `.map` files to a short, revalidated TTL rather than
264+
// Next's built-in 1yr immutable default for `_next/static/*` - maps
265+
// are content-hashed like their JS, so this isn't about staleness,
266+
// it's so a future decision to stop shipping `productionBrowserSourceMaps`
267+
// isn't undermined by browsers/edges holding old maps for a year.
257268
{
258-
source: '/(.*)\\.map$',
269+
source: '/(.*)\\.map',
259270
headers: [
260271
{
261272
key: 'x-robots-tag',
262273
value: 'noindex',
263274
},
275+
{
276+
key: 'Cache-Control',
277+
value: 'public, max-age=86400, stale-while-revalidate=604800',
278+
},
264279
],
265280
},
266281
// Chat pages - allow iframe embedding from any origin

0 commit comments

Comments
 (0)