[Doc] Error example code in CN doc

Open Beginner friendly
#4,026 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
rust
Domain
documentation

Research direction

Read website/zh-CN/component/list.md and compare its List section examples with website/component/list.md. Replace the incorrect TableState references with ListState in the Chinese source; done when the examples match the English source on this point.

Written by the indexing model from the issue text.

Description

All the examples in the List section use TableState in CN doc.

    fn render_item(
        &mut self,
        ix: IndexPath,
        _window: &mut Window,
        _cx: &mut Context<TableState<Self>>,
    ) -> Option<Self::Item> {
        self.items.get(ix.row).map(|item| {
            ListItem::new(ix)
                .child(Label::new(item.clone()))
                .selected(Some(ix) == self.selected_index)
        })
    }

But correct is ListState in EN doc.
Page: https://gpui-kit.com/zh-CN/component/list/
Source: https://github.com/longbridge/gpui-kit/blob/main/website/zh-CN/component/list.md
English source for comparison (correct): https://github.com/longbridge/gpui-kit/blob/main/website/component/list.md

Dominant language
Rust
Stars
20.8k
Forks
1.3k
Avg merge
1d 16m
Merged PRs (30d)
270

Getting set up

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.

More from longbridge/gpui-kit

All issues in longbridge/gpui-kit

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.