Skip to content

feat: 投稿日時の範囲を条件に加えてノート検索出来るようにする#16119

Draft
samunohito wants to merge 10 commits intomisskey-dev:developfrom
samunohito:feat/16035-serach-range-time
Draft

feat: 投稿日時の範囲を条件に加えてノート検索出来るようにする#16119
samunohito wants to merge 10 commits intomisskey-dev:developfrom
samunohito:feat/16035-serach-range-time

Conversation

@samunohito
Copy link
Copy Markdown
Member

@samunohito samunohito commented May 29, 2025

What

ノート検索で期間を指定できるようになります

image

Why

fix #16035

Additional info (optional)

Checklist

  • Read the contribution guide
  • Test working in a local environment
  • (If needed) Add story of storybook
  • (If needed) Update CHANGELOG.md
  • (If possible) Add tests

@codecov
Copy link
Copy Markdown

codecov Bot commented May 29, 2025

Codecov Report

❌ Patch coverage is 15.38462% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.80%. Comparing base (74e847a) to head (b979b95).
⚠️ Report is 1 commits behind head on develop.

Files with missing lines Patch % Lines
packages/backend/src/core/SearchService.ts 9.09% 20 Missing ⚠️
...s/backend/src/server/api/endpoints/notes/search.ts 50.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #16119      +/-   ##
===========================================
+ Coverage    62.77%   62.80%   +0.03%     
===========================================
  Files         1150     1152       +2     
  Lines       114944   115183     +239     
  Branches      7862     7899      +37     
===========================================
+ Hits         72157    72343     +186     
- Misses       40643    40695      +52     
- Partials      2144     2145       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2025

このPRによるapi.jsonの差分

差分はこちら
--- base
+++ head
@@ -71791,6 +71791,18 @@
                   "query": {
                     "type": "string"
                   },
+                  "rangeStartAt": {
+                    "type": [
+                      "integer",
+                      "null"
+                    ]
+                  },
+                  "rangeEndAt": {
+                    "type": [
+                      "integer",
+                      "null"
+                    ]
+                  },
                   "sinceId": {
                     "type": "string",
                     "format": "misskey:id"

Get diff files from Workflow Page

@samunohito samunohito requested a review from Copilot May 29, 2025 22:54
Copy link
Copy Markdown
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 pull request enhances the note search functionality by adding the ability to filter results based on a range of posting dates.

  • Adds two new fields (rangeStartAt and rangeEndAt) to the type definitions for search queries.
  • Updates the frontend search form with new datetime-local inputs and integrates the date range into the search parameters.
  • Extends the backend API endpoint and search service to support filtering notes by a specified date range.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
packages/misskey-js/src/autogen/types.ts Adds new optional fields rangeStartAt and rangeEndAt to the operations type definition.
packages/frontend/src/pages/search.note.vue Introduces new inputs for date filtering and includes the range in the computed search parameters.
packages/backend/src/server/api/endpoints/notes/search.ts Extends the API parameter definitions and passes the new range fields to the search service.
packages/backend/src/core/SearchService.ts Implements the new date range filtering for notes in both the query and pagination filters.

Comment thread packages/backend/src/core/SearchService.ts
Comment thread packages/backend/src/core/SearchService.ts
@samunohito samunohito requested a review from Copilot May 31, 2025 01:01
Copy link
Copy Markdown
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 PR enables filtering notes by a date range in the search feature.

  • Extends the API schema and misskey-js types with rangeStartAt and rangeEndAt
  • Updates the frontend search page to render datetime inputs and include their values in search parameters
  • Implements backend handling in the endpoint and SearchService to apply date‐based filters

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/misskey-js/src/autogen/types.ts Added rangeStartAt and rangeEndAt to the notes/search query type
packages/frontend/src/pages/search.note.vue Rendered two datetime-local inputs and wired them into the computed searchParams
packages/backend/src/server/api/endpoints/notes/search.ts Exposed rangeStartAt/rangeEndAt in the endpoint schema and passed them through
packages/backend/src/core/SearchService.ts Added query conditions and filter entries to restrict notes by the given date range
locales/ja-JP.yml Added Japanese translations for the new “postFrom” and “postTo” labels
Comments suppressed due to low confidence (1)

packages/backend/src/core/SearchService.ts:238

  • Add tests for the new date-range filtering logic to verify that rangeStartAt and rangeEndAt correctly include/exclude notes.
if (opts.rangeStartAt) {

Comment thread packages/backend/src/core/SearchService.ts
Comment thread packages/frontend/src/pages/search.note.vue
Comment thread packages/backend/src/server/api/endpoints/notes/search.ts
@samunohito samunohito changed the title [wip] feat: 投稿日時の範囲を条件に加えてノート検索出来るようにする feat: 投稿日時の範囲を条件に加えてノート検索出来るようにする May 31, 2025
@samunohito samunohito marked this pull request as ready for review May 31, 2025 01:04
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Oct 31, 2025
@kakkokari-gtyih
Copy link
Copy Markdown
Contributor

検索にページネーションコントロールってあったっけ
あるならそれで事足りるようになっている(or なる)可能性がある

image

@samunohito
Copy link
Copy Markdown
Member Author

あるならそれで事足りるようになっている(or なる)可能性がある

もうだいぶ記憶が薄れてるけど、ならなかったパターンでした。
日付範囲選択用のパラメータを増やさないと、ページング機能と競合します。

※指定した期間の検索結果数がページネーションの閾値を超えると、期間の設定を維持しつつページネーション機能を使えない(from-toかsince/untilのどちらかしか指定できない)

@samunohito
Copy link
Copy Markdown
Member Author

@syuilo
仕様的な是非はどうでしょう
採用頂けるのであればメンテしますし、不要であればcloseしてしまいたいなとおもっており

@kakkokari-gtyih

This comment was marked as resolved.

@samunohito

This comment was marked as resolved.

@kakkokari-gtyih

This comment was marked as resolved.

@kakkokari-gtyih

This comment was marked as resolved.

@syuilo
Copy link
Copy Markdown
Member

syuilo commented Dec 25, 2025

よさそう

@samunohito samunohito marked this pull request as draft December 25, 2025 12:06
@samunohito
Copy link
Copy Markdown
Member Author

(いちおう最新に追従したけど、やっぱりDB検索部分だけでもテスト生やしたいのでdraftにします)

@github-actions
Copy link
Copy Markdown
Contributor

Backend Memory Usage Comparison

Metric base head Diff
RSS 354.78 MB 353.19 MB -1.58 MB (-.44%)

See workflow logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

packages/backend Server side specific issue/PR packages/frontend Client side specific issue/PR packages/misskey-js size:M This PR changes 30-99 lines, ignoring generated files.

Projects

Development

Successfully merging this pull request may close these issues.

検索時に検索対象とする期間を指定出来るようにして欲しい

4 participants