Skip to content

✨ feat: add Daily Brief module to homepage#13627

Merged
canisminor1990 merged 9 commits into
LOBE-6597-with-uifrom
LOBE-5481
Apr 15, 2026
Merged

✨ feat: add Daily Brief module to homepage#13627
canisminor1990 merged 9 commits into
LOBE-6597-with-uifrom
LOBE-5481

Conversation

@sudongyuer

Copy link
Copy Markdown
Collaborator

Summary

  • Add Daily Brief section below the chat input on the homepage, displaying unresolved briefs from the Agent Tasks system
  • Users can resolve, comment, and provide feedback directly from brief cards
  • Display stacked agent avatars from the task tree on each brief card

Changes

New: src/features/DailyBrief/

  • BriefCard — Card with type icon, title, agent avatars, time, markdown summary, action buttons
  • BriefCardActions — Dynamic action buttons (resolve/comment/link) + fixed "Add feedback" button + inline success state
  • BriefCardSummary — Markdown rendering with overflow detection and expand/collapse
  • CommentInput — Rich text editor (@lobehub/editor) for feedback input

New: src/store/brief/

  • Independent Zustand store with SWR data fetching (useClientDataSWRWithSync)
  • Actions: useFetchBriefs, resolveBrief, markBriefRead, addComment

New: src/services/brief.ts

  • Service layer wrapping lambdaClient for brief and task comment APIs

Modified

  • src/routes/(main)/home/features/index.tsx — Insert DailyBrief below InputArea
  • src/locales/default/home.ts + locales/zh-CN/ + locales/en-US/ — i18n keys

Key Design Decisions

  • Action buttons are dynamic: Rendered from BriefAction[] with three interaction types — resolve (closes brief), comment (resolve with text), link (safe URL navigation)
  • Fixed "Add feedback" button: Calls task.addComment (adds comment without resolving the brief)
  • Comment input replaces action bar: Click feedback → entire actions area replaced by editor → cancel restores buttons
  • Resolve shows inline success: After resolve, ActionBar shows "✓ Resolved" → next SWR revalidate removes card
  • Agent avatars: Uses enriched agents data from listUnresolved API (🔨 chore: add agent avatar data to brief list API #13489)
  • URL validation: Link actions validate protocol (http/https only) + noopener,noreferrer

Test Plan

  • Type check passes (bun run type-check)
  • 21 tests pass (service, store selectors, BriefCardActions, BriefCardSummary)
  • Manual: No briefs → section hidden
  • Manual: Brief cards render with correct type icons and colors
  • Manual: Expand/collapse summary works for long markdown content
  • Manual: Resolve button → "✓ Resolved" state → card gone after refresh
  • Manual: Comment action → editor replaces buttons → submit resolves brief
  • Manual: Add feedback → editor → submit → "✓ Feedback sent" → 1.5s restore
  • Manual: Light/dark mode styling correct

Closes LOBE-5481

🤖 Generated with Claude Code

@vercel

vercel Bot commented Apr 7, 2026

Copy link
Copy Markdown

Deployment failed with the following error:

You don't have permission to create a Preview Deployment for this Vercel project: lobehub.

View Documentation: https://vercel.com/docs/accounts/team-members-and-roles

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've reviewed this pull request using the Sourcery rules engine

@lobehubbot

Copy link
Copy Markdown
Member

👋 @arvinxx - Could you review this PR? It adds a Daily Brief module to the homepage with new React components (src/features/DailyBrief/), a Zustand store (src/store/brief/), and a service layer (src/services/brief.ts).

@codecov

codecov Bot commented Apr 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (LOBE-6597-with-ui@4787bed). Learn more about missing BASE report.

Additional details and impacted files
@@                 Coverage Diff                  @@
##             LOBE-6597-with-ui   #13627   +/-   ##
====================================================
  Coverage                     ?   83.99%           
====================================================
  Files                        ?      534           
  Lines                        ?    36258           
  Branches                     ?     5982           
====================================================
  Hits                         ?    30456           
  Misses                       ?     5678           
  Partials                     ?      124           
Flag Coverage Δ
packages/agent-runtime 79.72% <ø> (?)
packages/context-engine 83.33% <ø> (?)
packages/conversation-flow 92.36% <ø> (?)
packages/file-loaders 87.02% <ø> (?)
packages/memory-user-memory 74.74% <ø> (?)
packages/model-bank 99.85% <ø> (?)
packages/model-runtime 84.61% <ø> (?)
packages/prompts 69.69% <ø> (?)
packages/python-interpreter 92.90% <ø> (?)
packages/ssrf-safe-fetch 0.00% <ø> (?)
packages/utils 90.14% <ø> (?)
packages/web-crawler 88.66% <ø> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store ∅ <0.00%> (?)
Services ∅ <0.00%> (?)
Server ∅ <0.00%> (?)
Libs ∅ <0.00%> (?)
Utils 93.47% <0.00%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 280d3f59fd

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/features/DailyBrief/style.ts Outdated
Comment thread src/features/DailyBrief/CommentInput.tsx Outdated
Comment thread src/store/brief/store.ts Dismissed
sudongyuer and others added 5 commits April 10, 2026 10:52
Add a Daily Brief section below the chat input on the homepage that
displays unresolved briefs from the Agent Tasks system. Users can
resolve, comment, and provide feedback directly from the brief cards.

- Service: BriefService with listUnresolved, resolve, markRead, addComment
- Store: Independent Zustand store (src/store/brief/) with SWR data fetching
- Components: BriefCard, BriefCardActions (dynamic action buttons),
  BriefCardSummary (Markdown with expand/collapse), CommentInput (@lobehub/editor)
- Three action types: resolve (closes brief), comment (resolve with text),
  link (safe URL navigation with protocol validation)
- Fixed feedback button: adds task comment without resolving the brief
- Inline success state ("Feedback sent") with 1.5s auto-restore
- i18n: zh-CN + en-US translations
- Tests: 21 tests across service, store selectors, and components
- CLI: Register task and brief commands for local development

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Display stacked agent avatars next to brief card titles using the
new `agents` data from Arvin's enriched listUnresolved API (#13489).

- Add AgentAvatarInfo type and agents field to BriefItem
- Render overlapping circular avatars (20px, -6px overlap)
- Use cssVar.colorBgContainer for border (dark mode compatible)
- Extract avatar style to function to avoid inline object creation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Extract duplicate success state JSX into reusable SuccessTag component
- Remove redundant comments that describe what code does
- Use DEFAULT_AVATAR from @lobechat/const instead of hardcoded emoji

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use cssVar.colorBgBase instead of hardcoded #fff for primary button
  text color (dark mode contrast fix)
- Add submitting state to CommentInput to prevent duplicate submissions
  (disable buttons + show loading during async submit)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Run pnpm i18n to generate translations for all 18 locales.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
sudongyuer and others added 3 commits April 13, 2026 14:49
Export BriefType union from packages/types and use it in
BRIEF_TYPE_COLOR and BRIEF_TYPE_ICON records for compile-time
key validation. Adding a new brief type now requires updating
the shared type, and TypeScript will flag missing mappings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Apr 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 14, 2026 10:22am

Request Review

<MaskShadow
size={32}
style={{
maxHeight: expanded ? undefined : COLLAPSED_MAX_HEIGHT,
@canisminor1990 canisminor1990 changed the base branch from canary to LOBE-6597-with-ui April 15, 2026 05:21
@canisminor1990 canisminor1990 merged commit 8d45acf into LOBE-6597-with-ui Apr 15, 2026
35 of 38 checks passed
@canisminor1990 canisminor1990 deleted the LOBE-5481 branch April 15, 2026 05:22
sudongyuer added a commit that referenced this pull request Apr 15, 2026
…13627)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@canisminor1990 canisminor1990 restored the LOBE-5481 branch April 15, 2026 13:38
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.

3 participants