Skip to content

feat(frontend): renew duty detail + holder detail screens (#435)#497

Merged
yu23ki14 merged 3 commits into
v3from
issue/435
May 12, 2026
Merged

feat(frontend): renew duty detail + holder detail screens (#435)#497
yu23ki14 merged 3 commits into
v3from
issue/435

Conversation

@yu23ki14

Copy link
Copy Markdown
Member

Summary

  • Rebuild /{treeId}/{hatId} on the design system — breadcrumb, header, description card, combined assignees + supporters card (with 当番リード / サポーター badges), and a quest panel that lives on the right side (60/40 split) on desktop or below 説明 on mobile. クエスト作成 button is part of the quest panel.
  • Rebuild /{treeId}/{hatId}/{address} — duty/wearer header with active/休止 badge, stats card (活動開始日 / 総活動日数 / あなたの{ロールシェア|ケアポイント}), ロールシェアの保有率 chart, send shortcut (hidden when logged out), and 一時休止 / 再開 / 当番を剥奪 actions with sonner toast on success.
  • Add two design-system composites with Ladle stories: Breadcrumb (every crumb rendered as a <Link> with the current page disabled, so the baseline is identical) and ShareDistribution (stacked horizontal bar + legend with avatars + percent).
  • Wire breadcrumbs across /{treeId}/role, /{treeId}/{hatId}, /{treeId}/{hatId}/{address} so navigation back through the chain works without per-page back buttons.
  • Convert useActiveState to useQuery and return refetch — the holder detail flips アクティブ → 休止中 from chain-confirmed data instead of revalidation tokens or optimistic state.
  • Fix the FractionToken display bug where formatEther was being applied to ERC-1155 integer balances and turning them into near-zero "dummy" values.

Closes #435.

Test plan

  • Navigate /{treeId}/role/{treeId}/{hatId}: breadcrumb shows 当番一覧 > {duty}, クエスト一覧が右(or下)に表示、クエスト作成ボタンが同じパネルにある
  • On /{treeId}/{hatId}, 現在の担当 card lists wearers with 当番リード and RoleShare holders with サポーター badges
  • Visit /{treeId}/{hatId}/{address}: breadcrumb shows 当番一覧 > {duty} > {resolved name}, 活動開始日 / 総活動日数 / あなたのロールシェア が表示
  • あなたのロールシェア shows when the shard hasn't been minted yet or the user is logged out, 0 only when others hold but the user doesn't, the real number otherwise
  • 一時休止 → toast成功後にバッジが アクティブ休止中 に切り替わる。再開も同様
  • 「ロールシェアを送る」ボトムシートはログイン時のみ表示

🤖 Generated with Claude Code

yu23ki14 and others added 3 commits May 12, 2026 16:36
- Rebuild `/{treeId}/{hatId}` on the design system: breadcrumb, quest
  panel on the right (60/40 split on desktop), combined assignees +
  supporters card with kind-specific badges, edit button inline.
- Rebuild `/{treeId}/{hatId}/{address}` with a stats card (活動開始日 /
  総活動日数 / あなたの{ロールシェア|ケアポイント}), ロールシェアの保有率
  ShareDistribution chart, and toast-on-success deactivate / reactivate
  flow. Logged-in user's balance is read straight from the GraphQL
  response (no formatEther — FractionToken is ERC-1155 integer counts).
- Add `Breadcrumb` and `ShareDistribution` composites with Ladle
  stories. Wire breadcrumbs across role list / duty / holder pages;
  every crumb renders as `<Link>` with the current page disabled so the
  baseline doesn't shift between linked and current items.
- Convert `useActiveState` to a `useQuery` so callers can `refetch`
  after a wallet write instead of juggling revalidation tokens.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Extract QuestPanel (with QuestCard / QuestStateBadge / questMeta) into
  `app/components/quests/QuestPanel.tsx` so duty and holder detail share
  one implementation.
- Mirror the duty detail's desktop 60/40 split on holder detail with
  the QuestPanel in the right column on desktop and stacked on mobile.
- Gate the "クエストを作成" CTA behind `canCreate` — only show it when
  the viewer actually holds role share for the hat (any wearer's shard
  on duty detail, the current wearer's shard on holder detail).
- Role card on `/{treeId}/role` now shows both `詳細` and `担当を追加`
  buttons; "詳細を見る" copy trimmed to "詳細".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ers (#435)

The contract's `deactivate` / `reactivate` / `renounce` gate is
`hasAuthority(msg.sender) || msg.sender == wearer`, but the holder
detail page was only rendering the action buttons for `isMe`. Operator
hat wearers / admins (anyone the module's `minterHatId` resolves to)
were locked out of the UI despite being allowed on-chain.

- Add the missing `hasAuthority(address) view returns (bool)` entry to
  the frontend's `HatsTimeFrameModule` ABI.
- Add `useHasAuthority` (React Query) that reads the module's
  `hasAuthority` for the connected wallet.
- Gate the authorized-actions block on
  `canManage = isMe || hasModuleAuthority`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@yu23ki14 yu23ki14 changed the base branch from main to v3 May 12, 2026 08:03
@yu23ki14 yu23ki14 merged commit 85c5ed1 into v3 May 12, 2026
1 of 2 checks passed
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.

[Phase 3] 当番詳細画面のリニューアル

1 participant