feat(virtual-scroll): Add dynamic fixed size virtual scroll strategy
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- angular, typescript
- Domínio
- frontend
Direção de pesquisa
Comece revisando a estratégia atual de rolagem virtual de tamanho fixo e a estratégia experimental cdk autoSize; em seguida, execute os exemplos vinculados do StackBlitz. O trabalho estará concluído quando uma estratégia aceitar uma função que mapeie um índice para um tamanho em pixels e oferecer suporte a tamanhos de item fixos, variáveis, com espaçamento, com preenchimento e expansíveis ou recolhíveis.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Feature Description
Currently the provided virtual scroll strategy is only for fixed size. This is very restrictive.
In cdk experimental there is an autoSize strategy that determines the size of an item automatically but it is experimental and decides the size by itself.
I propose a new strategy for fixed, known but dynamic size.
For example if I have a list of items with some items being with 50px height and some with 80px height I can't use any default strategy for it but I also don't need autoSize. I know item 3 is 80px but item 6 is 50px which makes it easier to implement.
Using the new strategy I can express the dynamic (but known) size.
An example API for it is passing a function: (index: number) => number that returns a pixel size based on given item index.
One of the benefits is that fixed size is a specific case of the new strategy with the function returning the same size always (with a bit of worse performance) - so no need to create two default strategies as fixed (the current one) can be derived from the new strategy.
I created a stackblitz with such strategy and some use cases:
https://stackblitz.com/edit/stackblitz-starters-eey1ve9m
Use Case
- Can be used for fixed size like now
- Can be used to add gap between items
- Can be used to add padding (top/bottom) - although there are other ways to do it currently
- Can be used to express varying sizes (80px and 50px mixed for example)
- Can be used to allow expand/collapse items for details - initial size for index X is 50px. On click increase size to 80px and refresh strategy. Same for collapse but the other way around.
- Can be a mix of all the above
To summarize it gives a lot of control for many use cases including the fixed size that exists today.
- Linguagem predominante
- TypeScript
- Estrelas
- 25k
- Forks
- 6.8k
- Merge médio
- 1d 7h
- PRs com merge (30d)
- 92
Preparar o ambiente
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de angular/components
-
area: material/datepicker P4
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/components#33763 · 2 comentários · 3 reações ·
Mantenedores costumam responder em até 1 dia
-
area: material/table P4
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 88/100
angular/components#33709 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
area: material/table docs gemini-triaged P4
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
angular/components#33455 ·
Mantenedores costumam responder em até 1 dia
-
area: material/core gemini-triaged P3
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 78/100
angular/components#33059 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
area: material/dialog P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
angular/components#30536 · 3 reações ·
Mantenedores costumam responder em até 1 dia
Todas as issues de angular/components
Issues semelhantes
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
opengovsg/FormSG#10118 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
ai-driven-qa bug claude
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
linagora/twake-calendar-frontend#1434 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
Add: MBC kr [Geo-blocked]Abertacheck:passed streams:add
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
iptv-org/iptv#52824 · 2 comentários ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 78/100
jaegertracing/jaeger-ui#4512 ·
Mantenedores costumam responder em até 1 dia
-
area:ide documentation enhancement platform:macos platform:vscode
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
anthropics/claude-code#97389 ·
Mantenedores costumam responder em até 1 dia