ankitects / ankitects/anki

Dragging deck onto string-prefix sibling is incorrectly a no-op

Open
#5,183 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
31.2k
Forks
3.2k
Avg merge
2d 8h
Merged PRs (30d)
72

Description

### Problem

Dragging a deck onto a sibling whose name shares the dragged deck's string prefix is incorrectly treated as a no-op.

For example, with `foo::bar` and `foo::barbaz`, dragging `foo::bar` onto `foo::barbaz` should produce `foo::barbaz::bar`. Instead, nothing happens.

### Cause

The descendant check compares the raw unit-separator-joined deck names with `starts_with()`, so a sibling that merely shares a string prefix is mistaken for the dragged deck's descendant.

### Expected behavior

Deck ancestry should be compared on component boundaries. Only dropping onto the deck itself or a genuine descendant should be rejected.

### Related pull request

ankitects/anki#5170

Contributor guide

Open the contributing guide

Research direction

Start by locating the deck descendant check described in the issue and inspect where the raw unit-separator-joined names are compared with starts_with(). Reproduce the foo::bar and foo::barbaz drag case, then verify that only the deck itself or a genuine descendant is treated as a no-op.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.