# workspace: Add basic pane property tests and fix navigation bug \(\#52871\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/0ae6b4c61a4acc58c292a96d9d4b1e3ebe4b78b6)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 0ae6b4c61a4acc58c292a96d9d4b1e3ebe4b78b6

Requested commit: 0ae6b4c61a4acc58c292a96d9d4b1e3ebe4b78b6

Commit: 0ae6b4c61a4acc58c292a96d9d4b1e3ebe4b78b6

Tree: 056c31f65c7c2804cc3295d7ee601e7ad3b611d6

Author: Tim Vermeulen

Committer: GitHub

## Message

````
workspace: Add basic pane property tests and fix navigation bug (#52871)

Adds very basic property tests for navigation within a single pane, with
these operations:

```rust
enum Operation {
    Open { path: Arc<RelPath>, allow_preview: bool },
    GoBack,
    GoForward,
}
```

It primarily tests that a single backward or forward navigation step
results in the correct item being active. It doesn't currently test that
going back multiple times in a row results in the correct items because
the deduplication logic that Zed uses for this turned out to be hard to
model in an "obviously correct" way, and I aimed to keep it really
simple.

These tests surfaced a navigation bug that this PR also fixes, where
replacing an inactive preview tab would sometimes corrupt the navigation
history.

Before:


https://github.com/user-attachments/assets/52e21002-1319-4b16-93d7-8f84fb8858c0

After:


https://github.com/user-attachments/assets/790b6e3b-4c2b-4f2e-a705-70b1bc034872

Self-Review Checklist:

- [x] I've reviewed my own diff for quality, security, and reliability
- [x] Unsafe blocks (if any) have justifying comments
- [x] The content is consistent with the [UI/UX
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
- [x] Tests cover the new/changed behavior
- [x] Performance impact has been considered and is acceptable

Release Notes:

- Fixed a bug where replacing a preview tab would sometimes break
navigation.

---------

Co-authored-by: Ben Kunkle <ben@zed.dev>
````

## Parents

- [74b15e426bb2084612e6641c199295b32687a740](https://git.cafe/gitcafe/zed/commit/74b15e426bb2084612e6641c199295b32687a740?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/0ae6b4c61a4acc58c292a96d9d4b1e3ebe4b78b6?format=markdown)
