linebender / linebender/druid

how do I filter the vector to construct a list

Open
#2,177 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

I am writing a history clipboard, and I want to switch the content type, for example, I want to press the **All** button to show all content, press **Text** to only show the text contents, or press **Image** to only show image contents

I have a field `contents: Vector` and the Content is

```rust
enum Content {
Text(...),
Image(...)
}
```

I pass `AppData::contents` to the `List::lens` to show all contents, but how do I filter the vector, when I just want to show text or image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Druid List::lens API and the Content enum shown in the issue, then trace how AppData::contents is supplied to the list. Determine how the list can switch among All, Text, and Image views, and verify that the chosen approach supports all three requested content filters.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.