Skip to content

Conversation

@pseudoyu
Copy link
Member

Description

PR Type

  • Feature
  • Bugfix
  • Hotfix
  • Other (please describe):

Screenshots (if UI change)

Demo Video (if new feature)

Linked Issues

Additional context

Changelog

  • I have updated the changelog/next.md with my changes.

@pseudoyu pseudoyu self-assigned this Jun 20, 2025
@vercel
Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
follow ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 0:39am
follow-external-ssr ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 20, 2025 0:39am

@pseudoyu pseudoyu requested review from Innei and Copilot June 20, 2025 00:32
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This chore adds a new filter field entry_attachments_duration to multiple condition schemas and related table definitions so that actions can also filter on attachment durations.

  • Extended the Zod enum and TypeScript unions to include entry_attachments_duration in conditionItemSchema and various actions schemas.
  • Updated the OpenAPI schemas (actionsItemOpenAPISchema, actionsOpenAPISchema) and route definitions to recognize the new field.
  • Adjusted the actions table column types to allow the new filter field in database queries.
Comments suppressed due to low confidence (1)

packages/internal/shared/src/hono.ts:461

  • Add unit tests for conditionItemSchema (and related OpenAPI schemas) that validate the new entry_attachments_duration field, ensuring valid durations pass and invalid inputs are rejected.
    field: "title" | "status" | "view" | "site_url" | "feed_url" | "category" | "entry_title" | "entry_content" | "entry_url" | "entry_author" | "entry_media_length" | "entry_attachments_duration";

declare const languageSchema: z.ZodEnum<["en", "ja", "zh-CN", "zh-TW"]>;
declare const conditionItemSchema: z.ZodObject<{
field: z.ZodEnum<["view", "title", "site_url", "feed_url", "category", "entry_title", "entry_content", "entry_url", "entry_author", "entry_media_length", "status"]>;
field: z.ZodEnum<["view", "title", "site_url", "feed_url", "category", "entry_title", "entry_content", "entry_url", "entry_author", "entry_media_length", "entry_attachments_duration", "status"]>;
Copy link

Copilot AI Jun 20, 2025

Choose a reason for hiding this comment

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

[nitpick] The list of valid condition fields is duplicated across dozens of schemas. Consider extracting this array into a shared constant (e.g. const conditionFields = [...]) and referencing it in each ZodEnum to reduce duplication and simplify future updates.

Suggested change
field: z.ZodEnum<["view", "title", "site_url", "feed_url", "category", "entry_title", "entry_content", "entry_url", "entry_author", "entry_media_length", "entry_attachments_duration", "status"]>;
field: z.ZodEnum<typeof conditionFields>;

Copilot uses AI. Check for mistakes.
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