Skip to content

feat(history/display): better UX #31

@wongjiahau

Description

@wongjiahau

Preface

Currently, I'm using History::display to display the navigation history for my editor, and I find it confusing during branch switching.

Steps to reproduce

For example, say we start with the following tree:

* 1-3 [HEAD] src/position.rs
* 1-2 src/soft_wrap.rs
| * 0-3 src/quickfix_list.rs
| * 0-2 src/context.rs
|/
* 1-1 src/components/editor.rs
* 1-0 [SAVED]

Expected outcome

And when I switched to [0-3], I expect it to display as follows (only [HEAD] is moved):

* 1-3 src/position.rs
* 1-2 src/soft_wrap.rs
| * 0-3 [HEAD] src/quickfix_list.rs
| * 0-2 src/context.rs
|/
* 1-1 src/components/editor.rs
* 1-0 [SAVED]

Actual outcome

However, it surprised me by totally modifying the tree, specifically:

  1. Making branch 0 the main trunk
  2. Renaming entries 1-1 and 1-0, to 0-1 and 0-0 respectively
* 0-3 [HEAD] src/quickfix_list.rs
* 0-2 src/context.rs
| * 1-3 src/position.rs
| * 1-2 src/soft_wrap.rs
|/
* 0-1 src/components/editor.rs
* 0-0 [SAVED]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions