Skip to content

Conversation

Copy link

Copilot AI commented Dec 23, 2025

Adds a dedicated detail view for sources (/sources/:id) with inline editing, config management, and paginated collect jobs. Updates SourceCard to show open job status and enable navigation to detail view.

Changes

Business Logic (source.ts)

  • getBySource(sourceId, {limit, offset, order}) - fetch paginated collect jobs for a source
  • getLatestOpenBySource(sourceId) - get latest open job (PENDING or RUNNING) for a source
  • Added config field to SourceCollectJob

Source Detail View (views/sources/source/)

  • Left panel: uses sourceForm component with all fields (nickname, type, config, collect schedule) and save button
  • Right panel: full-width "New Job" button, paginated job list using sourceCollectJobCard component, job click → detail navigation
  • Center popup for new job creation with collectJobForm component and create button

sourceCollectJobCard Component (new)

  • Reusable card component for displaying collect job items
  • Shows job ID, status (color-coded), and creation date
  • Clickable card with hover effects

collectJobForm Component (renamed from newCollectJob)

  • Pure form component with v-model support
  • Provides config editor (InkJsonEditor) for job configuration
  • No create/submit buttons - parent component handles submission

sourceForm Component (extracted from createSource)

  • Reusable form component for editing source information
  • All fields: nickname, type, config (InkJsonEditor), collect schedule
  • Used in both createSource and source detail view for consistency

SourceCard Component

  • Underlined "Check running collect job" link (visible when open job exists) → job detail
  • Card click → source detail view
  • Uses latestOpenJob to check for both PENDING and RUNNING jobs
  • @click.stop on interactive elements to prevent navigation conflicts
  • Hover states for visual feedback
  • Uses shallow: true optimization

Router

  • /sources/collectJob/:id before /sources/:id to prevent route matching issues

Localization

  • Added translation keys for en/zh-CN covering all new UI text including collectJob.config
<!-- Example: Source detail with collect jobs -->
<section class="source-view__jobs">
  <InkButton :text="t('source.newJob')" @click="onNewJob" class="w-full" />
  <sourceCollectJobCard
    v-for="job in collectJobs"
    :key="job.id"
    :job="job"
    @click="goToJob(job.id)"
  />
</section>

All components follow BEM naming, use design tokens, and include full documentation.

Original prompt

Add views/sources/index which:

  • is left / right panel layout, just like SourceCollectJob view
  • for left panel:
    • Provide more detailed information than SourceCard
    • A form to edit nickname (inline InkInput, behaves the same as SourceCard), config (inline InkJsonEditor, click save to save)
    • delete action
  • List source collect jobs of this source at the right panel (with pagination)
  • Provide new job button (w-full) on the top of source collect jobs list, click will open a center popup compose of title, components/sources/newCollectJob and cancel, create actions.

And also update SourceCard:

  • If applicable, shows text Check running collect job (with underlined style, right above the actions), click will push to the sourceCollectJob view of the latest running collect job of this source

💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits December 23, 2025 03:03
Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
…translations

Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
… error handling

Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
Copilot AI changed the title [WIP] Add views/sources/index with left and right panel layout Add source detail view with collect jobs list and enhance SourceCard navigation Dec 23, 2025
Copilot AI requested a review from xiaoland December 23, 2025 03:12
@xiaoland xiaoland marked this pull request as ready for review December 23, 2025 03:26
Copy link
Member

Choose a reason for hiding this comment

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

Sorry, please rename the newCollectJob component to collectJobForm

Copy link
Author

Choose a reason for hiding this comment

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

Done in commit 5b34ebb. The component has been renamed from newCollectJob to collectJobForm.

Copy link
Member

Choose a reason for hiding this comment

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

  • Use SourceCollectJobForm.parse({}) to create default form
  • SourceCollectJob now has a new field config and collectJobForm should provide a control to edit it.
  • remove create button and create event, this component should be a pure form

Copy link
Author

Choose a reason for hiding this comment

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

Done in commit 5b34ebb. Changes made:

  • Now uses SourceCollectJobForm.parse({}) to create default form
  • Added config field to SourceCollectJob and collectJobForm with InkJsonEditor control
  • Removed create button and create event - component is now a pure form with v-model support

Copilot AI and others added 2 commits December 23, 2025 03:58
…rceForm component

- Renamed newCollectJob component to collectJobForm
- Updated collectJobForm to be a pure form component with config field support
- Added config field to SourceCollectJob
- Created sourceForm component extracted from createSource
- Updated createSource to use sourceForm
- Updated source detail view to use sourceForm with inline editing and save button
- Used shallow: true for latestRunningJob in sourceCard
- Added create button to new job popup

Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
…dd error handling

Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
… latestOpenJob

- Created sourceCollectJobCard component for displaying job items
- Renamed getLatestRunningBySource to getLatestOpenBySource
- Updated method to include both PENDING and RUNNING statuses
- Updated all references from latestRunningJob to latestOpenJob
- Removed inline job-item styles in favor of component

Co-authored-by: xiaoland <37663413+xiaoland@users.noreply.github.com>
@xiaoland xiaoland merged commit 4f8c4dc into develop Dec 23, 2025
2 of 4 checks passed
@xiaoland xiaoland deleted the copilot/add-views-sources-index branch December 23, 2025 17:04
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.

2 participants