Skip to content

✨ feat: support timeline --before/--after filters#41

Merged
SigureMo merged 3 commits intoShigureLab:mainfrom
ShigureNyako:feat/timeline-before-after
Apr 8, 2026
Merged

✨ feat: support timeline --before/--after filters#41
SigureMo merged 3 commits intoShigureLab:mainfrom
ShigureNyako:feat/timeline-before-after

Conversation

@ShigureNyako
Copy link
Copy Markdown
Member

Summary

Closes #40.

为 PR / issue 的 timeline 阅读增加 --after / --before 时间窗口过滤,支持后续按 fetched_at 做增量读取。

Changes

  • pr view / pr timeline-expand / issue view / issue timeline-expand 增加 RFC3339 / ISO 8601 风格的 --after / --before
  • 在 frontmatter 中新增 fetched_at,过滤时额外输出 timeline_after / timeline_before / timeline_events_unfiltered
  • 在 pager 中增加按时间窗口的过滤路径:--after 从 timeline 尾部向前抓取,--before 从头部向后抓取
  • 过滤后按本地页码分页,同时保留原 timeline 的绝对事件编号,避免后续 follow-up 命令失效
  • 更新 README 和 skills/github-conversation/SKILL.md,补充增量读取工作流
  • 新增 CLI 测试覆盖过滤、分页、frontmatter 和非法时间范围

Validation

  • uv run pytest
  • uv run ruff check
  • uv run pyright
  • uv run gh-llm issue view 40 --repo ShigureLab/gh-llm --show meta,description
  • uv run gh-llm issue view 40 --repo ShigureLab/gh-llm --page-size 10 --after 2026-04-08T02:30:00Z

@SigureMo 麻烦 review~

Co-authored-by: Codex <codex@openai.com>
@ShigureNyako
Copy link
Copy Markdown
Member Author

已自查,验证命令已在 PR 描述中列出。@SigureMo 麻烦 review~

Copy link
Copy Markdown

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

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: bd0c1cdf2f

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@SigureMo SigureMo changed the title ✨ feat: support timeline --before/--after filters ✨ feat: support timeline --before/--after filters Apr 8, 2026
Copy link
Copy Markdown
Contributor

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

@ShigureNyako 展示下最新的 gh-llm 的输出效果,主要展示和之前的 diff,比如用当前 PR

@ShigureNyako
Copy link
Copy Markdown
Member Author

按你的建议,我用当前 PR #41 贴一下最新 gh-llm 的实际输出效果,重点看和之前的差异。

1. 首次读取

命令:

uv run gh-llm pr view 41 --repo ShigureLab/gh-llm --show meta,timeline

输出摘录:

---
pr: 41
repo: ShigureLab/gh-llm
title: "✨ feat: support timeline `--before`/`--after` filters"
updated_at: 2026-04-08T03:33:28Z
fetched_at: 2026-04-08T04:15:43Z
timeline_events: 6
page_size: 8
total_pages: 1
---

这里和之前最主要的差异是:现在直接在 frontmatter 里给出 fetched_at,不需要再额外手动 date

2. 增量读取

命令:

uv run gh-llm pr view 41 --repo ShigureLab/gh-llm --page-size 10 --after 2026-04-08T03:26:48Z --show meta,timeline

输出摘录:

---
pr: 41
repo: ShigureLab/gh-llm
updated_at: 2026-04-08T03:33:28Z
fetched_at: 2026-04-08T04:15:43Z
timeline_events: 2
timeline_events_unfiltered: 6
timeline_after: 2026-04-08T03:26:48Z
page_size: 10
total_pages: 1
---

### Page 1/1
5. [2026-04-08 03:26 UTC] pr/title-edited by @SigureMo (Nyakku Shigure)
6. [2026-04-08 03:33 UTC] review/commented by @SigureMo (Nyakku Shigure)

也就是后续可以直接拿上一次输出里的 fetched_at--after,只读增量 timeline,并且输出里会明确给出:

  • 当前过滤后的事件数:timeline_events
  • 原始未过滤事件数:timeline_events_unfiltered
  • 当前使用的过滤边界:timeline_after / timeline_before

另外我刚顺手把 bot 提到的一个缺陷也一起修了:过滤模式下 timeline-expand 现在也会正确 honor --expand,相关修复已经推到当前 PR。

Copy link
Copy Markdown
Member Author

@ShigureNyako ShigureNyako left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

独立复查结论:这版没有再看到阻塞问题。

我重点复查了:

  • --after / --before 的时间窗口解析与过滤方向
  • frontmatter 里的 fetched_at / timeline_after / timeline_before / filtered vs unfiltered 计数
  • filtered 场景下 timeline-expand / details-expand--expand 的一致性
  • 新增测试是否覆盖增量读取、filtered 分页、非法时间范围和 expand 回归

当前实现与测试是一致的,后续补丁也已经把 bot 提到的 filtered --expand 问题修掉;我这边没有发现新的 blocking issue。

验证结果:uv run pytestuv run ruff checkuv run pyright

注:我尝试直接提交 APPROVE,但 GitHub 不允许作者 approve 自己的 PR,所以这里用 COMMENT 记录自审结论。

@SigureMo SigureMo merged commit 72d5fee into ShigureLab:main Apr 8, 2026
2 checks passed
@ShigureNyako ShigureNyako deleted the feat/timeline-before-after branch April 8, 2026 04:33
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.

timeline 增加 --before --after 参数

2 participants