# Incorporate ElementId as part of the Element::id trait method and expose GlobalId \(\#11101\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 39fb1d567d559eb8acfa1c060c885f8debe8a8fa

Requested commit: 39fb1d567d559eb8acfa1c060c885f8debe8a8fa

Commit: 39fb1d567d559eb8acfa1c060c885f8debe8a8fa

Tree: 8a9c31a817b98c6531b3660d1e42858bef4d73d1

Author: Nathan Sobo

Committer: GitHub

## Message

```
Incorporate ElementId as part of the Element::id trait method and expose GlobalId (#11101)

We're planning to associate "selection sources" with global element ids
to allow arbitrary UI text to be selected in GPUI. Previously, global
ids were not exposed outside the framework and we entangled management
of the element id stack with element state access. This was more
acceptable when element state was the only place we used global element
ids, but now that we're planning to use them more places, it makes sense
to deal with element identity as a first-class part of the element
system. We now ensure that the stack of element ids which forms the
current global element id is correctly managed in every phase of element
layout and paint and make the global id available to each element
method. In a subsequent PR, we'll use the global element id as part of
implementing arbitrary selection for UI text.

Release Notes:

- N/A

---------

Co-authored-by: Antonio Scandurra <me@as-cii.com>
```

## Parents

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

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