Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions apps/web/app/api/admin/banners/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@ export async function GET() {
const auth = await requireAdmin();
if (!auth.ok) return auth.response;

const supabase = createSupabaseServiceRoleClient();
const { data, error } = await supabase
.from("ad_banners")
.select(AD_BANNER_SELECT)
.order("priority", { ascending: false });
try {
const supabase = createSupabaseServiceRoleClient();
const { data, error } = await supabase
.from("ad_banners")
.select(AD_BANNER_SELECT)
.order("priority", { ascending: false });

if (error) {
if (error) {
return NextResponse.json({ code: "banner_read_failed" }, { status: 500 });
}

return NextResponse.json({ banners: data ?? [] });
} catch {
return NextResponse.json({ code: "banner_read_failed" }, { status: 500 });
}

return NextResponse.json({ banners: data ?? [] });
}
4 changes: 4 additions & 0 deletions apps/web/app/home-app-globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
@source "../lib/naver-map-overlay-position-helpers.ts";
@source "../lib/naver-map-overlay-timings.ts";

html[data-home-chrome-ready="true"] [data-home-static-skeleton] {
display: none;
}

@media (max-width: 1279px) {
html[data-mobile-search-open] .mobile-map-status-badge {
display: none;
Expand Down
6 changes: 6 additions & 0 deletions apps/web/components/home/home-control-panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,12 @@ function HomeControlPanelComponent({
activeRightPanel = null,
selectedAnnouncement = null,
}: HomeControlPanelProps) {
useEffect(() => {
document.documentElement.dataset.homeChromeReady = "true";

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 Badge Wait for the deferred controls before hiding the skeleton

On a fresh or throttled load, this effect runs when the outer HomeControlPanel chunk mounts, but the mobile and desktop controls are subsequently loaded through useDeferredComponent, and this component returns null until that second chunk resolves. The new selector therefore removes the only loading UI while no control chrome is rendered, producing a blank gap; mark readiness only after the selected deferred component is available or has mounted.

Useful? React with 👍 / 👎.

return () => {
delete document.documentElement.dataset.homeChromeReady;

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 Badge Keep the skeleton hidden during mobile fullscreen

On mobile/tablet, entering map fullscreen makes the conditional in home-client.tsx unmount HomeControlPanel, so this cleanup deletes the readiness attribute even though HomeStaticSkeleton remains mounted by MobileHomeLayout. The CSS selector stops matching and the top and bottom skeleton bars reappear over the fullscreen map; the one-way loading-complete state should not be cleared during this transient unmount.

Useful? React with 👍 / 👎.

};
}, []);
const { isMobileOrTablet } = useDeviceType();
const shouldRenderMobile = isMobileOrTablet || (
typeof window !== 'undefined' && window.innerWidth <= BREAKPOINTS.tabletMax
Expand Down
Loading