发布

  • [OPIK-6260] [BE] [FE] feat: display recent activity on project home page (#6595)

    frostbyte_neo 发布于 2026-05-07 16:15:03 +00:00

    • [OPIK-6260] [BE] [FE] feat: display recent activity on project home page

    BE: New aggregated endpoint GET /v1/private/projects/{projectId}/recent-activity
    that fetches the most recent items across 6 entity types (experiments,
    optimizations, dataset/test suite versions, agent config blueprints, alert
    events) in parallel, merges and returns the top N sorted by date.

    Also enriches alert event logs with project_id in markers for project-scoped
    filtering.

    FE: Redesigned project home page with greeting, action buttons, and recent
    activity feed. Split sidebar into Home + Ollie tabs. Added /ollie route for
    full-page assistant (previous home behavior).

    • Revision: address PR review comments
    • Fix import order in RecentActivitySection (external before internal)
    • Add @Max(100) to size query param in RecentActivityResource
    • Pass size through to per-source queries instead of hardcoded limit
    • Use UserLog constants for marker keys and add null guard in fetchAlertEvents
    • Fix dataset/test suite links to navigate to /items directly
    • Revision 2: Add unit tests for RecentActivityService

    Tests cover: merge/sort across sources, size limiting, graceful
    degradation (partial + total failure), alert event null guard filtering,
    and empty project handling.

    • Revision 3: Show Home in sidebar even when Ollie is disabled

    Home should always be visible; only Ollie depends on the assistant plugin.

    • Revision 4: Address FE review comments
    • Rename showHome → showOlliePage (only controls Ollie visibility now)
    • Replace Button+onClick with Link for nav buttons and activity items
    • Move formatRelativeDateTime to @/lib/date.ts alongside other date utils
    • Revision 5: Address BE review comments and add resource-level tests
    • Rename endpoint path to /activities (RESTful plural)
    • Add @Consumes(JSON), @JsonView, @ApiResponse docs (200, 400, 500)
    • Add pagination (RecentActivityPage with page/size/total/projectId/content)
    • Add createdBy field to RecentActivityItem
    • Use @Builder pattern for all DTOs and construction
    • Remove top-level onErrorResume (errors bubble as 500)
    • Add class-level javadoc documenting page-1 limitation
    • Parallelize JDBI sources (datasets + agent configs as separate Monos)
    • Merge dataset/test suite query into single call (drop type filter)
    • Add UUIDv7 30-day lookback filter for dataset query scan reduction
    • Import HashMap instead of inline java.util.HashMap
    • Update unit tests: @InjectMocks, Podam, precise mocks, full object assertions
    • Add resource-level black box tests with Testcontainers (all entity types,
      sort order, project isolation, permission enforcement)
    • Revision 6: Gate dashboards button with permission, guard future timestamps
    • Hide "View dashboards" button when canViewDashboards is false
    • Guard future timestamps in formatRelativeDateTime to prevent "0 days ago"
    • Revision 8: Address remaining review comments
    • Remove projectId from RecentActivityPage (not a page-level field)
    • Reorder createdBy before createdAt in RecentActivityItem
    • Add @NonNull to RecentDatasetVersion DB-enforced fields
    • Use InstantToUUIDMapper.toLowerBound() for proper UUIDv7 lower bound
    • Extract RecentActivityResourceClient for test reuse
    • Full object assertion on empty project test, field assertions on combined test
    • Make Podam instance field (thread safety)
    • Document graceful degradation in class javadoc
    • Rename Ollie to Opik Connect in sidebar
    • Revision 9: Temporarily hide home page, show Opik Connect as default

    Home page hidden until redesign is complete. /home route renders OlliePage,
    sidebar shows Opik Connect only. TODO comments mark all temporary changes
    for easy restoration in follow-up PR.

    下载附件