Skip to content

feat: filter processes by image name - #27

Open
JamesLinYJ wants to merge 1 commit into
mainfrom
cursor/process-name-filter-bf3b
Open

JamesLinYJ wants to merge 1 commit into
mainfrom
cursor/process-name-filter-bf3b

Conversation

@JamesLinYJ

Copy link
Copy Markdown
Owner

Summary

Adds an image-name filter on the Processes page. The filter is a view over the snapshot that is already committed. It does not query processes, tokens, or icons, and it does not change the sampler. Options stays #[repr(C)] schema 2; the filter text is not stored.

  • A classic Win32 label and edit sit above the process list. View → Filter by Name, and Ctrl+F, focus that field. F5 is still Refresh Now.
  • An empty filter shows every process. A filter with no hits shows an empty list and does not raise a refresh error. The virtual list only contains matching rows, so hidden rows are not formatted.
  • Selection, focus, and scroll stay tied to ProcIdentity across refresh. A row hidden by the filter stays in the identity cache while that process is still in the unfiltered snapshot, and it is selected again when the filter is cleared. Otherwise the highlight moves to a visible match. Go to Process clears the filter so the requested process can be shown.
  • The menu command has its own resource ID, routing, enabled state, and status-bar help. The new strings are in TextKey and every locale.

Tests

  • An empty or whitespace filter shows the full list and keeps the selected identity.
  • Matching is a case-insensitive substring of the image name. An architecture suffix is not part of the name.
  • No matches produce an empty visible list and keep the cached identity.
  • A hidden selection moves the highlight to a visible row without dropping the cache. Clearing the filter restores that identity when it is still in the snapshot.
  • Refresh keeps the visible highlight and the scroll policy. Explicit navigation reveals the row.
  • A process that has left the snapshot moves the selection to the following row. A reused PID does not replace the cached creation time.
  • Filtering does not invent a selection when nothing was selected.

Verification

This host is Linux. cargo fmt --all -- --check passed. cargo check --all-targets --locked and cargo clippy --all-targets --locked -- -D warnings passed for x86_64-pc-windows-msvc. The same check passed for i686-pc-windows-msvc and aarch64-pc-windows-msvc. cargo test --locked --bin taskmgr stops because link.exe is not on this machine. These checks are not a Windows device test.

CI on this PR runs Quality (x86_64) and Architecture (i686, aarch64), including the Windows test and release builds.

Open in Web Open in Cursor 

Add a classic Filter field on the Processes page. The filter is a UI-thread
view of the committed snapshot, so sampling, tokens, and icons stay on the
worker. Selection is kept by ProcIdentity across refresh, including when a
row is hidden and the filter is later cleared.

Co-authored-by: jameslincn <jameslincn@outlook.sg>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T00:39:19.143724Z f3956b5 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Copy link
Copy Markdown

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

ℹ️ 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".

Comment on lines +817 to 820
} else {
self.pending_find_identity = Some(identity);
self.selected_identity = Some(identity);
self.refresh_processes();

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Rebuild the view before awaiting a missing target

When Go to Process clears an active filter but the requested identity is absent from the currently committed snapshot, this branch only queues an asynchronous refresh. The edit box and name_filter are already empty, while visible_rows and the ListView still show the old filtered subset until that refresh completes; if collection fails, the blank filter can remain paired with the filtered list indefinitely instead of continuing to display the prior trustworthy snapshot. Rebuild the existing snapshot immediately after clearing the filter, before scheduling collection.

AGENTS.md reference: AGENTS.md:L40-L42

Useful? React with 👍 / 👎.

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