feat(share): symbol page share button + distinguish note delete vs failure

- New ShareButton in the page header tries navigator.share() first
  (native sheet on mobile), then falls back to navigator.clipboard, then
  to a hidden textarea + execCommand("copy") for non-secure-context LAN.
  Shows a brief "링크 복사됨" / "복사 안됨" toast; native share success
  shows none (the OS sheet is the feedback).
- Mounted between ⇄ 비교 and the Star button.

Fixes reviewer concern on 442cc38: writeNote() used to return null for
both "user emptied the textarea (intentional delete)" and "localStorage
quota failure," so clearing a note showed "저장 안됨." It now returns a
discriminated { status: "saved" | "deleted" | "failed" } and the panel
shows "저장됨" / "삭제됨" / "저장 안됨" accordingly. Failure keeps the
user's text so they can retry or shorten it.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
claude-owner
2026-05-29 00:08:37 +09:00
parent 442cc38c32
commit f18493fad4
4 changed files with 129 additions and 10 deletions

View File

@@ -17,6 +17,7 @@ import { PredictionPanel } from "../../components/PredictionPanel";
import { PriceHero } from "../../components/PriceHero";
import { PriceTargets } from "../../components/PriceTargets";
import { RelatedStocks } from "../../components/RelatedStocks";
import { ShareButton } from "../../components/ShareButton";
import { StarButton } from "../../components/StarButton";
import { StockChart } from "../../components/StockChart";
import { SymbolSidebar } from "../../components/SymbolSidebar";
@@ -163,6 +164,7 @@ export default function CodePage({ params }: { params: { code: string } }) {
>
</Link>
<ShareButton code={code} name={chart?.name} />
<StarButton code={code} name={chart?.name} />
<PeriodTabs value={period} onChange={(id) => setPeriod(id)} />
</div>