Commit Graph
25009 Commits
Author SHA1 Message Date
Max BrunsfeldandMarshall bc284a96f6 Fix DisplaySnapshot::x_for_point always returning 0
Co-authored-by: Marshall <marshall@zed.dev>
2023-11-08 13:55:39 -08:00
Max Brunsfeld e000126645 Fix blinking in editor2 (#3272)
This also introduces new APIs in `ViewContext` for observing window
focus changes.

Release Notes:

- N/A
2023-11-08 13:53:43 -08:00
Julia eedb8fb633 Get tsserver running again 2023-11-08 16:51:54 -05:00
Conrad Irwin e486dff146 Merge branch 'main' into go-to-line2 2023-11-08 14:46:52 -07:00
Conrad Irwin c0c4c4f1f3 Make Modals dismissable in theory 2023-11-08 14:45:54 -07:00
Nate Butler 75dcde53e9 WIP 2023-11-08 16:43:32 -05:00
Nate Butler aa604a3623 Document ColorScaleSteps (#3271)
[[PR Description]]

Adds documentation to ColorScaleSteps:

```rust
/// Returns the specified step in the [`ColorScale`].
    #[inline]
    pub fn step(&self, step: ColorScaleStep) -> Hsla {
        // Steps are one-based, so we need convert to the zero-based vec index.
        self.0[step.0 - 1]
    }

    /// `Step 1` - Used for main application backgrounds.
    ///
    /// This step provides a neutral base for any overlaying components, ideal for applications' main backdrop or empty spaces such as canvas areas.
    ///
    #[inline]
    pub fn step_1(&self) -> Hsla {
        self.step(ColorScaleStep::ONE)
    }

    /// `Step 2` - Used for both main application backgrounds and subtle component backgrounds.
    ///
    /// Like `Step 1`, this step allows variations in background styles, from striped tables, sidebar backgrounds, to card backgrounds.
    #[inline]
    pub fn step_2(&self) -> Hsla {
        self.step(ColorScaleStep::TWO)
    }

    /// `Step 3` - Used for UI component backgrounds in their normal states.
    ///
    /// This step maintains accessibility by guaranteeing a contrast ratio of 4.5:1 with steps 11 and 12 for text. It could also suit hover states for transparent components.
    #[inline]
    pub fn step_3(&self) -> Hsla {
        self.step(ColorScaleStep::THREE)
    }

    /// `Step 4` - Used for UI component backgrounds in their hover states.
    ///
    /// Also suited for pressed or selected states of components with a transparent background.
    #[inline]
    pub fn step_4(&self) -> Hsla {
        self.step(ColorScaleStep::FOUR)
    }

    /// `Step 5` - Used for UI component backgrounds in their pressed or selected states.
    #[inline]
    pub fn step_5(&self) -> Hsla {
        self.step(ColorScaleStep::FIVE)
    }

    /// `Step 6` - Used for subtle borders on non-interactive components.
    ///
    /// Its usage spans from sidebars' borders, headers' dividers, cards' outlines, to alerts' edges and separators.
    #[inline]
    pub fn step_6(&self) -> Hsla {
        self.step(ColorScaleStep::SIX)
    }

    /// `Step 7` - Used for subtle borders on interactive components.
    ///
    /// This step subtly delineates the boundary of elements users interact with.
    #[inline]
    pub fn step_7(&self) -> Hsla {
        self.step(ColorScaleStep::SEVEN)
    }

    /// `Step 8` - Used for stronger borders on interactive components and focus rings.
    ///
    /// It strengthens the visibility and accessibility of active elements and their focus states.
    #[inline]
    pub fn step_8(&self) -> Hsla {
        self.step(ColorScaleStep::EIGHT)
    }

    /// `Step 9` - Used for solid backgrounds.
    ///
    /// `Step 9` is the most saturated step, having the least mix of white or black.
    ///
    /// Due to its high chroma, `Step 9` is versatile and particularly useful for semantic colors such as
    /// error, warning, and success indicators.
    #[inline]
    pub fn step_9(&self) -> Hsla {
        self.step(ColorScaleStep::NINE)
    }

    /// `Step 10` - Used for hovered or active solid backgrounds, particularly when `Step 9` is their normal state.
    #[inline]
    pub fn step_10(&self) -> Hsla {
        self.step(ColorScaleStep::TEN)
    }

    /// `Step 11` - Used for text and icons requiring low contrast or less emphasis.
    #[inline]
    pub fn step_11(&self) -> Hsla {
        self.step(ColorScaleStep::ELEVEN)
    }

    /// `Step 12` - Used for text and icons requiring high contrast or prominence.
    #[inline]
    pub fn step_12(&self) -> Hsla {
        self.step(ColorScaleStep::TWELVE)
    }
```

Release Notes:

- N/A
2023-11-08 16:25:17 -05:00
Nate Butler fd64d86611 Extend Styled for Zed-specific methods (#3276)
[[PR Description]]

- Adds `StyledExt` for Zed-specific methods like `ui_text`, `v_flex`,
etc.
- Updates components previously using `text_*` methods.

Release Notes:

- N/A
2023-11-08 16:04:46 -05:00
Mikayla b37f5c083e WIP 2023-11-08 12:49:09 -08:00
Nate ButlerandMarshall Bowers 7cab4b8784 Update usages of text_size_* to text_ui in ui components
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:28:38 -05:00
Nate ButlerandMarshall Bowers 30d837f5ca Update StyledExt to impl over I & F as well as V for Div
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:25:44 -05:00
Marshall Bowers 1047c1d378 Use a fork of ctor to silence warnings generated by macro (#3275)
This PR switches us over to a fork of `ctor` that contains the fixes
from https://github.com/mmastrac/rust-ctor/pull/295, backported to our
current version of `ctor` (v0.1.20).

Once 1) the `ctor` maintainer publishes a new version with that change
and 2) we're ready to upgrade to the latest version of `ctor` we can
switch back to the mainline version.

Release Notes:

- N/A
2023-11-08 15:05:19 -05:00
Nate ButlerandMarshall Bowers 55abfc6eca Remove the Stack trait, update StyledExt to include stacks
Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
2023-11-08 15:00:47 -05:00
Nate Butler f396e9d48f Remove unused code in avatar 2023-11-08 14:46:47 -05:00
Mikayla Maki 50c038fefd WIP: Add collab tests (#3232)
TODO:
- [x] GPUI2: Implement record_backtrace on executor
- [x] GPUI2: Implement rng on executor
- [x] GPUI2: Determine whether to Implement global notifications for
removals
- [x] Get existing tests passing

TODO later:
- [ ] Port: collab_ui and uncomment tests
- [ ] Port: editor and uncomment tests
- [ ] Port: notifications and uncomment tests



Release Notes:

- N/A
2023-11-08 11:46:22 -08:00
Nate Butler ed6dbf0861 Update StyledExt to use more idiomatic method naming 2023-11-08 14:42:56 -05:00
Conrad Irwin 5083adda17 Silence problem 2023-11-08 12:37:35 -07:00
Conrad Irwin 185d8f7a15 Merge branch 'main' into add-collab-tests 2023-11-08 12:33:15 -07:00
Mikayla 738ca57aba Merge branch 'main' into go-to-line2 2023-11-08 11:32:36 -08:00
Nate Butler 7a7cc4d086 BROKEN: Checkpoint 2023-11-08 14:29:38 -05:00
Mikayla 65345a5023 Fix double borrow in synchronous tests 2023-11-08 11:23:35 -08:00
Max Brunsfeld c0fb399c06 Merge branch 'main' into fix-editor-blinking 2023-11-08 11:01:13 -08:00
Max Brunsfeld 3e0ddf4559 Preserve stateless interactivity when assigning elements an id (#3274) 2023-11-08 10:56:02 -08:00
Max Brunsfeld aa0f49d6b3 Merge branch 'main' into picker-actions 2023-11-08 10:49:44 -08:00
Max Brunsfeld 42eb6722e8 Extract a Frame struct from Window (#3273)
This PR pulls the previous/current frame data out of the `Window` and
into a separate `Frame` struct.

Release Notes:

- N/A
2023-11-08 10:47:11 -08:00
5fb0fdd52e Preserve stateless interactivity when assigning elements an id
Co-authored-by: Nathan <nathan@zed.dev>
Co-authored-by: Piotr <piotr@zed.dev>
2023-11-08 10:45:10 -08:00
Mikayla Maki 02b51487e5 Don't generate licenses on every PR (#3260)
Build speed improvification
2023-11-08 10:40:51 -08:00
Mikayla 991c40b727 Get tests green 2023-11-08 10:38:43 -08:00
Marshall Bowers 5fb37a8deb Remove unused SceneBuilder constructor 2023-11-08 13:30:20 -05:00
8b1491bfb0 Extract a Frame struct from Window
Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-08 13:24:11 -05:00
Antonio ScandurraandMarshall 330a7ea602 Introduce ViewContext::on_blur
Co-Authored-By: Marshall <marshall@zed.dev>
2023-11-08 19:09:01 +01:00
Antonio ScandurraandMarshall b7903e2199 Fix blinking behavior in editor when receiving/losing focus
Co-Authored-By: Marshall <marshall@zed.dev>
2023-11-08 19:03:57 +01:00
Nate Butler 6257c42f5c Update titlebar 2023-11-08 12:57:31 -05:00
Nate Butler e6dabbda75 add ui_text_size functions 2023-11-08 12:57:24 -05:00
Mikayla 2bda91180c Merge branch 'main' into add-collab-tests 2023-11-08 09:57:08 -08:00
Mikayla 34a01d2565 Merge branch 'main' into add-collab-tests 2023-11-08 09:41:57 -08:00
Max Brunsfeld 8feec8108e Register menu2 actions using actions macro 2023-11-08 09:35:19 -08:00
5dfcae922f Extract a Frame struct from Window
Co-Authored-By: Marshall <marshall@zed.dev>
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Piotr <piotr@zed.dev>
2023-11-08 18:17:38 +01:00
Joseph T. Lyons 8c8f368d17 Improve get preview channel changes script (#3270)
- Improve reliability of finding release note lines
- Identify cases where release notes were accidentally omitted (no "N/A
line)
- Filter out N/As

Release Notes:

- N/A
2023-11-08 11:55:52 -05:00
Antonio Scandurra 4db70841a6 Fix clipping bugs in editor2 (#3269)
Release Notes:

- N/A
2023-11-08 17:51:39 +01:00
Marshall Bowers 9f7bef63b3 Port the picker and uniform list (#3248)
This adds a `UniformList` element and partially implements `Picker` as a
component, using `UniformList`. Because editor2 isn't fully implemented
yet, the picker doesn't have filtering logic yet. We want to merge this
for now though, to make the UniformList element available for other
crates.

Release Notes:

- N/A
2023-11-08 17:45:23 +01:00
Joseph T. LyonsandPiotr Osiewicz 33b5e84df2 Improve get preview channel changes script
- Filter out N/As
- Identify missing release note lines

Co-Authored-By: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com>
2023-11-08 11:40:53 -05:00
Marshall Bowers 8f89c1e77b Replace GitStatusColors with StatusColors (#3268)
This PR removes `GitStatusColors` in favor of just using `StatusColors`
instead.

Release Notes:

- N/A
2023-11-08 11:32:32 -05:00
86408a2a85 Fix clipping in Line::draw
Co-Authored-By: Nathan <nathan@zed.dev>
Co-Authored-By: Marshall <marshall@zed.dev>
2023-11-08 17:32:21 +01:00
Antonio ScandurraandNathan 66eb8deb10 Use a consistent clipping strategy for drawing all the primitives
Co-Authored-By: Nathan <nathan@zed.dev>
2023-11-08 17:29:05 +01:00
Marshall Bowers 7896996c5c Fix overflow in UniformList 2023-11-08 11:26:26 -05:00
Marshall Bowers 443543c4a8 Merge branch 'main' into picker 2023-11-08 11:18:54 -05:00
Joseph T. Lyons 3ffe1f8323 v0.113.x dev 2023-11-08 10:53:37 -05:00
Antonio Scandurra fafc884460 Wire up mouse interaction in editor2 (#3267)
Release Notes:

- N/A
2023-11-08 15:36:47 +01:00
Antonio Scandurra ef746a7850 💄 2023-11-08 15:33:11 +01:00