Compare commits

...

5 Commits

Author SHA1 Message Date
1128712170 Merge branch 'feature/video-official-site-overlay': 영상 종료 전 공식 링크 오버레이 2026-08-21 11:46:37 +09:00
e328fc950c feat: 업체 직접 입력 시 공식 홈페이지 링크 입력란 추가
- BusinessNameInputModal에 선택 입력 URL 필드 추가 (프로토콜 미입력 시 https:// 보정)
- onManualInput 콜백 체인(officialSiteUrl) 확장
- POST /marketing 요청 body에 official_site_url 전달 (미입력 시 null)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:56:39 +09:00
547dd415c5 fix: 영상 링크 오버레이 문구를 '자세히 보기'로 변경
official_site_url이 네이버 플레이스/인스타그램 등 업체 대표 링크일 수 있어
중립적인 문구로 조정

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:50:23 +09:00
cea60e70db feat: 영상 종료 3초 전 공식 홈페이지 링크 오버레이 표시
- VideoDetailItem/VideoListItem에 official_site_url 필드 추가
- 플레이어 onTimeUpdate로 잔여 3초 감지, 링크 카드 오버레이 노출
- official_site_url이 null이면 오버레이 미렌더링

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DKTAqpFj8pbWzgvq7MRDHk
2026-08-21 10:45:15 +09:00
0d3167c1a2 fix: 공유하기 수정 2026-08-20 16:35:17 +09:00
16 changed files with 178 additions and 49 deletions

View File

@ -354,14 +354,14 @@ const App: React.FC = () => {
};
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
const handleManualInput = async (businessName: string, address: string, category: string) => {
const handleManualInput = async (businessName: string, address: string, category: string, officialSiteUrl?: string) => {
setAfterLoadTarget('generation_flow');
setViewMode('loading');
setIsAnalysisComplete(false);
setError(null);
try {
const data = await marketingAnalysis(businessName, address, category);
const data = await marketingAnalysis(businessName, address, category, officialSiteUrl);
if (!validateCrawlingResponse(data)) {
throw new Error(t('app.autocompleteError'));

View File

@ -5,7 +5,7 @@ import CitySelectModal, { REGIONS } from './CitySelectModal';
interface BusinessNameInputModalProps {
onClose: () => void;
onSubmit: (businessName: string, address: string, category: string) => void;
onSubmit: (businessName: string, address: string, category: string, officialSiteUrl: string) => void;
}
const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose, onSubmit }) => {
@ -14,6 +14,7 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
const [selectedCity, setSelectedCity] = useState('');
const [detailAddress, setDetailAddress] = useState('');
const [category, setCategory] = useState('');
const [officialSiteUrl, setOfficialSiteUrl] = useState('');
const [isCityModalOpen, setIsCityModalOpen] = useState(false);
useEffect(() => {
@ -42,7 +43,12 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
const handleSubmit = () => {
if (!isValid) return;
const fullAddress = `${selectedCity} ${detailAddress.trim()}`;
onSubmit(businessName.trim(), fullAddress, category.trim());
// 프로토콜 없이 입력하면 https:// 를 붙여서 전달
const trimmedUrl = officialSiteUrl.trim();
const normalizedUrl = trimmedUrl && !/^https?:\/\//i.test(trimmedUrl)
? `https://${trimmedUrl}`
: trimmedUrl;
onSubmit(businessName.trim(), fullAddress, category.trim(), normalizedUrl);
onClose();
};
@ -118,6 +124,19 @@ const BusinessNameInputModal: React.FC<BusinessNameInputModalProps> = ({ onClose
/>
</div>
<div className="manual-modal-field">
<label className="manual-modal-label">{t('landing.hero.manualLabelSiteUrl')}</label>
<input
type="url"
className="manual-modal-input"
placeholder={t('landing.hero.manualPlaceholderSiteUrl')}
value={officialSiteUrl}
onChange={e => setOfficialSiteUrl(e.target.value)}
onKeyDown={handleKeyDown}
maxLength={2048}
/>
</div>
<div className="manual-modal-actions">
<button type="button" className="manual-modal-cancel" onClick={onClose}>
{t('common.cancel')}

View File

@ -7,6 +7,7 @@ interface ContentCardSocialActionsProps {
videoId: number;
storeName: string;
region?: string;
title?: string | null;
commentCount: number;
initialLikeCount: number;
initialIsLiked?: boolean;
@ -15,7 +16,7 @@ interface ContentCardSocialActionsProps {
const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
videoId,
storeName,
region,
title,
commentCount,
initialLikeCount,
initialIsLiked = false,
@ -27,15 +28,13 @@ const ContentCardSocialActions: React.FC<ContentCardSocialActionsProps> = ({
const likeDebounceRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = storeName || t('videoDetail.kakaoDefaultTitle');
const shareDescription = t('videoDetail.kakaoDescription', { region: region ?? '' });
const shareTitle = title || storeName || t('videoDetail.kakaoDefaultTitle');
const handleShareBtnClick = async (e: React.MouseEvent) => {
e.stopPropagation();
const handled = await tryNativeShare({
title: shareTitle,
text: shareDescription,
url: shareUrl,
});
if (handled) {

View File

@ -38,7 +38,7 @@ const extractUrl = (text: string): string | null => {
interface SearchInputFormProps {
onAnalyze?: (value: string, type: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
/** 직접입력 버튼 클릭 시 기본 동작(모달 열기)을 대체합니다. 제공 시 모달을 직접 관리해야 합니다. */
onManualButtonClick?: () => void;
error?: string | null;
@ -340,9 +340,9 @@ const SearchInputForm: React.FC<SearchInputFormProps> = ({
{!onManualButtonClick && isManualModalOpen && (
<BusinessNameInputModal
onClose={() => setIsManualModalOpen(false)}
onSubmit={(businessName, address, category) => {
onSubmit={(businessName, address, category, officialSiteUrl) => {
setIsManualModalOpen(false);
onManualInput?.(businessName, address, category);
onManualInput?.(businessName, address, category, officialSiteUrl);
}}
/>
)}

View File

@ -33,6 +33,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const [copied, setCopied] = useState(false);
const [isLandscape, setIsLandscape] = useState(false);
const [showSiteOverlay, setShowSiteOverlay] = useState(false);
const [showLoginModal, setShowLoginModal] = useState(false);
const [comments, setComments] = useState<CommentItem[]>([]);
@ -68,6 +69,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
const fetchVideo = async () => {
setLoading(true);
setError(null);
setShowSiteOverlay(false);
try {
const data = await getVideoById(videoId);
setVideo(data);
@ -103,26 +105,27 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
};
const shareUrl = buildVideoShareUrl(API_URL, videoId);
const shareTitle = video?.store_name ?? t('videoDetail.kakaoDefaultTitle');
const shareDescription = t('videoDetail.kakaoDescription', { region: video?.region ?? '' });
const shareTitle = video?.title || video?.store_name || t('videoDetail.kakaoDefaultTitle');
const handleCopyLink = async () => {
try {
await navigator.clipboard.writeText(shareUrl);
} catch {
// clipboard API 미지원 환경에서는 무시
}
setCopied(true);
setTimeout(() => setCopied(false), 2000);
};
const handleShareButtonClick = async () => {
const handled = await tryNativeShare({
title: shareTitle,
text: shareDescription,
url: shareUrl,
});
if (handled) {
return;
}
try {
await navigator.clipboard.writeText(shareUrl);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
// clipboard API 미지원 환경에서는 무시
}
await handleCopyLink();
};
const likeDebounceRef = React.useRef<ReturnType<typeof setTimeout> | null>(null);
@ -220,18 +223,46 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<div className="ado2-contents-error"><p>{error}</p></div>
) : video ? (
<div className={`video-detail-content ${isLandscape ? 'landscape' : ''}`}>
<video
src={video.result_movie_url}
controls
autoPlay
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
/>
<div className="video-detail-player-wrap">
<video
src={video.result_movie_url}
controls
autoPlay
controlsList="nodownload"
onContextMenu={(e) => e.preventDefault()}
className="video-detail-player"
onLoadedMetadata={(e) => {
const v = e.currentTarget;
setIsLandscape(v.videoWidth > v.videoHeight);
}}
onTimeUpdate={(e) => {
if (!video.official_site_url) return;
const v = e.currentTarget;
// 영상 종료 3초 전부터 공식 홈페이지 오버레이 노출
setShowSiteOverlay(
Number.isFinite(v.duration) && v.duration - v.currentTime <= 3
);
}}
/>
{video.official_site_url && showSiteOverlay && (
<a
href={video.official_site_url}
target="_blank"
rel="noopener noreferrer"
className="video-site-overlay"
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="12" cy="12" r="10"/>
<line x1="2" y1="12" x2="22" y2="12"/>
<path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"/>
</svg>
<span className="video-site-overlay-text">
<strong>{video.store_name}</strong>
{t('videoDetail.siteOverlayLabel')}
</span>
</a>
)}
</div>
<div className="video-detail-info">
<h2 className="video-detail-store">{video.store_name}</h2>
@ -252,6 +283,7 @@ const VideoDetailContent: React.FC<VideoDetailContentProps> = ({ videoId, isModa
<button
className="video-detail-copy-btn"
onClick={handleShareButtonClick}
title={t('videoDetail.share')}
>
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2">
<circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/>

View File

@ -208,7 +208,9 @@
"manualPlaceholderAddress": "Enter the address",
"manualPlaceholderRegion": "Select a region",
"manualPlaceholderDetail": "Enter detail address (e.g. Gangnam-gu Teheran-ro 123)",
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)"
"manualPlaceholderCategory": "Enter the business category (e.g. pension, cafe, salon)",
"manualLabelSiteUrl": "Website link (optional)",
"manualPlaceholderSiteUrl": "Enter the official website URL (e.g. https://example.com)"
},
"welcome": {
"title": "Welcome to ADO2.AI",
@ -624,6 +626,7 @@
"closeAriaLabel": "Close",
"share": "Share",
"copied": "Copied!",
"siteOverlayLabel": "View more",
"shareKakao": "KakaoTalk",
"shareFacebook": "Facebook",
"shareTwitter": "X (Twitter)",

View File

@ -207,7 +207,9 @@
"manualPlaceholderAddress": "주소를 입력하세요.",
"manualPlaceholderRegion": "지역을 선택하세요.",
"manualPlaceholderDetail": "상세 주소를 입력하세요. (예: 강남구 테헤란로 123)",
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)"
"manualPlaceholderCategory": "업종을 입력하세요. (예: 펜션, 카페, 미용실)",
"manualLabelSiteUrl": "홈페이지 링크 (선택)",
"manualPlaceholderSiteUrl": "공식 홈페이지 주소를 입력하세요. (예: https://example.com)"
},
"welcome": {
"title": "ADO2.AI에 오신 것을 환영합니다.",
@ -623,6 +625,7 @@
"closeAriaLabel": "닫기",
"share": "공유하기",
"copied": "복사됨!",
"siteOverlayLabel": "자세히 보기",
"shareKakao": "카카오톡",
"shareFacebook": "페이스북",
"shareTwitter": "X (트위터)",

View File

@ -194,6 +194,7 @@ const ADO2ContentsPage: React.FC<ADO2ContentsPageProps> = () => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
title={video.title}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}

View File

@ -299,13 +299,13 @@ const GenerationFlow: React.FC<GenerationFlowProps> = ({
};
// 업체명·주소 수동 입력으로 마케팅 분석 API 호출
const handleManualInput = async (businessName: string, address: string, category: string) => {
const handleManualInput = async (businessName: string, address: string, category: string, officialSiteUrl?: string) => {
goToWizardStep(-1);
setIsAnalysisComplete(false);
setAnalysisError(null);
try {
const data = await marketingAnalysis(businessName, address, category);
const data = await marketingAnalysis(businessName, address, category, officialSiteUrl);
if (data.processed_info) {
data.processed_info.customer_name = data.processed_info.customer_name || businessName;

View File

@ -291,6 +291,7 @@ const MyContentsPage: React.FC<MyContentsPageProps> = ({ onNavigate }) => {
videoId={video.video_id}
storeName={video.store_name}
region={video.region}
title={video.title}
commentCount={video.comment_count ?? 0}
initialLikeCount={video.like_count ?? 0}
initialIsLiked={video.is_liked_by_me}

View File

@ -5,7 +5,7 @@ import SearchInputForm, { SearchType } from '../../components/SearchInputForm';
interface UrlInputContentProps {
onAnalyze: (value: string, type?: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
error: string | null;
}

View File

@ -35,7 +35,7 @@ const orbConfigs: OrbConfig[] = [
interface HeroSectionProps {
onAnalyze?: (value: string, type?: SearchType) => void;
onAutocomplete?: (data: AutocompleteRequest) => void;
onManualInput?: (businessName: string, address: string, category: string) => void;
onManualInput?: (businessName: string, address: string, category: string, officialSiteUrl?: string) => void;
onNext?: () => void;
error?: string | null;
scrollProgress?: number;
@ -184,10 +184,10 @@ const HeroSection: React.FC<HeroSectionProps> = ({ onAnalyze, onAutocomplete, on
{isManualModalOpen && (
<BusinessNameInputModal
onClose={() => setIsManualModalOpen(false)}
onSubmit={(businessName, address, category) => {
onSubmit={(businessName, address, category, officialSiteUrl) => {
if (tutorial.isActive) tutorial.nextHint();
setIsManualModalOpen(false);
onManualInput?.(businessName, address, category);
onManualInput?.(businessName, address, category, officialSiteUrl);
}}
/>
)}

View File

@ -720,18 +720,77 @@
flex-direction: column;
}
.video-detail-player-wrap {
position: relative;
width: 100%;
max-width: 360px;
flex-shrink: 0;
}
.video-detail-content.landscape .video-detail-player-wrap {
max-width: 100%;
width: 100%;
}
.video-detail-player {
display: block;
width: 100%;
height: auto;
max-width: 360px;
border-radius: 12px;
}
/* 영상 종료 직전 공식 홈페이지 링크 오버레이 (유튜브 엔드스크린 스타일) */
.video-site-overlay {
position: absolute;
left: 12px;
right: 12px;
bottom: 64px; /* 네이티브 컨트롤 바를 가리지 않도록 */
display: flex;
align-items: center;
gap: 10px;
padding: 10px 14px;
background: rgba(0, 0, 0, 0.75);
border: 1px solid rgba(255, 255, 255, 0.25);
border-radius: 10px;
color: #fff;
text-decoration: none;
font-size: 13px;
line-height: 1.35;
backdrop-filter: blur(4px);
animation: video-site-overlay-in 0.3s ease-out;
transition: background 0.2s;
}
.video-site-overlay:hover {
background: rgba(0, 0, 0, 0.9);
}
.video-site-overlay svg {
flex-shrink: 0;
}
.video-detail-content.landscape .video-detail-player {
max-width: 100%;
width: 100%;
.video-site-overlay-text {
display: flex;
flex-direction: column;
min-width: 0;
}
.video-site-overlay-text strong {
font-weight: 600;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
@keyframes video-site-overlay-in {
from {
opacity: 0;
transform: translateY(8px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.video-detail-info {
@ -1158,7 +1217,7 @@
.video-detail-content {
flex-direction: column;
}
.video-detail-player {
.video-detail-player-wrap {
max-width: 100%;
width: 100%;
}

View File

@ -281,6 +281,7 @@ export interface VideoListItem {
title?: string | null;
description?: string | null;
hashtags?: string[] | null;
official_site_url?: string | null;
created_at: string;
like_count: number;
comment_count: number;
@ -294,6 +295,9 @@ export interface VideoDetailItem {
poster_url?: string | null;
store_name: string;
region: string;
title?: string | null;
description?: string | null;
official_site_url?: string | null;
created_at: string;
like_count: number;
is_liked_by_me: boolean;

View File

@ -1093,7 +1093,7 @@ export async function autocomplete(request: AutocompleteRequest): Promise<Crawli
}
// 업체명·주소 직접 입력으로 마케팅 분석
export async function marketingAnalysis(storeName: string, address: string, category = ''): Promise<CrawlingResponse> {
export async function marketingAnalysis(storeName: string, address: string, category = '', officialSiteUrl?: string): Promise<CrawlingResponse> {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), CRAWL_TIMEOUT);
@ -1103,7 +1103,12 @@ export async function marketingAnalysis(storeName: string, address: string, cate
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({ store_name: storeName, address, category }),
body: JSON.stringify({
store_name: storeName,
address,
category,
official_site_url: officialSiteUrl?.trim() || null,
}),
signal: controller.signal,
});

View File

@ -1,6 +1,9 @@
/**
* .
*
* `text` URL을 .
* · OG (`og:title`, `og:description`) , url( title) .
*
* .
*/
export async function tryNativeShare(data: ShareData): Promise<boolean> {