Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 51 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ jobs:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
with:
fetch-depth: 0
- name: Install Linux system libraries
if: runner.os == 'Linux'
# gpui's Linux backend (x11rb/xkbcommon/wayland/blade/font-kit) links
Expand All @@ -23,22 +25,62 @@ jobs:
sudo apt-get install -y --no-install-recommends \
libxcb1-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libvulkan-dev libfontconfig-dev libfreetype-dev
- uses: dtolnay/rust-toolchain@1.99.1
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@e9d7b9f1e587218970671bac74e5511ed9506e6a
- uses: taiki-e/install-action@97888a140839b7239d62fbf6af4e20adb5be3666
with:
tool: nextest
- name: Check format
run: cargo fmt --all --check
- name: Clippy
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Test
run: cargo test --workspace
shell: bash
run: scripts/ci-nextest.sh

examples-and-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Linux system libraries
# gpui's Linux backend (x11rb/xkbcommon/wayland/blade/font-kit) links
# these; the list follows zed's script/linux apt packages.
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libxcb1-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libvulkan-dev libfontconfig-dev libfreetype-dev
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8
- uses: Swatinem/rust-cache@e9d7b9f1e587218970671bac74e5511ed9506e6a
- name: Build every example package
run: >-
cargo build
-p demo_app
-p form
-p gallery
-p hello_world
-p screenshots
-p widgets
- name: Build fluent crate documentation
env:
RUSTDOCFLAGS: -Dwarnings
run: >-
cargo doc --no-deps
-p fluent-app
-p fluent-core
-p fluent-layout
-p fluent-primitives
-p fluent-ribbon
-p fluent-test-utils

# Only crates/fluent-* may use gpui (CONTRIBUTING.md §2).
layering:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.99.1
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8
- name: Layering guard
run: python3 scripts/check-layering.py

Expand All @@ -47,23 +89,23 @@ jobs:
deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: EmbarkStudios/cargo-deny-action@v2
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- uses: EmbarkStudios/cargo-deny-action@3c6349835b2b7b196a839186cb8b78e02f7b5f25
with:
command: check licenses bans

# fluent-* zed-rev metadata equals vendor/zed/UPSTREAM.md (CONTRIBUTING.md §4).
zed-rev:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Check recorded zed rev
run: scripts/check-zed-rev.sh

# The one required check: Windows and Linux tests plus every guard.
ci:
if: always()
needs: [test, layering, deny, zed-rev]
needs: [test, examples-and-docs, layering, deny, zed-rev]
runs-on: ubuntu-latest
steps:
- name: All jobs passed
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Release dry run

on:
push:
tags:
- 'v*\+zed.*'
pull_request:
paths:
- '.github/workflows/release.yml'
- 'scripts/check-zed-rev.sh'
- 'scripts/release-notes.sh'
schedule:
- cron: '23 3 * * *'
workflow_dispatch:

permissions:
contents: read

jobs:
validate:
name: Validate release inputs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Check Zed revision and release tag
env:
RELEASE_TAG: ${{ startsWith(github.ref, 'refs/tags/') && github.ref_name || '' }}
run: scripts/check-zed-rev.sh "$RELEASE_TAG"
- name: Draft release notes from CHANGELOG
run: |
scripts/release-notes.sh release-notes.md
cat release-notes.md >> "$GITHUB_STEP_SUMMARY"

build:
name: Build (${{ matrix.os }})
needs: validate
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Install Linux system libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
libxcb1-dev libx11-xcb-dev libxkbcommon-dev libxkbcommon-x11-dev \
libwayland-dev libvulkan-dev libfontconfig-dev libfreetype-dev
- uses: dtolnay/rust-toolchain@d124f86f28ff42855784ff3319f48ac182c248f8
- uses: Swatinem/rust-cache@e9d7b9f1e587218970671bac74e5511ed9506e6a
- name: Build release workspace
run: cargo build --workspace --release --locked

draft-release:
name: Draft GitHub release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
- name: Create draft release
env:
GH_TOKEN: ${{ github.token }}
RELEASE_TAG: ${{ github.ref_name }}
run: |
scripts/release-notes.sh release-notes.md
gh release create "$RELEASE_TAG" --draft --verify-tag \
--title "$RELEASE_TAG" --notes-file release-notes.md
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ per crate.

## Unreleased

- fluent-primitives: deny missing public API documentation and document every exported control and supporting type (WI-2945).

- docs: document DPI scaling conversion and resize behavior across Windows DirectX, Linux X11, and Linux Wayland, with native-run evidence requirements (WI-3061).
- Layout: add Fluent 2 Breadcrumb and Pagination controls with overflow menus, current-item semantics, RTL separators, and keyboard-ready controls (WI-3036).
- fluent-layout, gallery: Drawer with inline and overlay modes, RTL-aware start/end placement, size presets, reduced-motion-aware transitions, focus trapping and opener restoration (WI-3038).
Expand Down
8 changes: 0 additions & 8 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions crates/fluent-core/src/components.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@
/// icon gutters for aligned menus and popups.
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct ComponentTokens {
/// Fluent 2 button heights for small, medium, and large controls.
pub button_small_height: f32,
pub button_medium_height: f32,
pub button_large_height: f32,
/// Fluent 2 button icon sizes for small, medium, and large controls.
pub button_small_icon_size: f32,
pub button_medium_icon_size: f32,
pub button_large_icon_size: f32,
pub menu_bar_height: f32,
pub menu_item_height: f32,
pub menu_min_width: f32,
Expand Down Expand Up @@ -40,6 +48,12 @@ pub struct ComponentTokens {
impl Default for ComponentTokens {
fn default() -> Self {
Self {
button_small_height: 24.0,
button_medium_height: 32.0,
button_large_height: 40.0,
button_small_icon_size: 12.0,
button_medium_icon_size: 16.0,
button_large_icon_size: 20.0,
menu_bar_height: 28.0,
menu_item_height: 28.0,
menu_min_width: 200.0,
Expand Down
4 changes: 4 additions & 0 deletions crates/fluent-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ mod stroke_width;
mod theme;
mod typography;

/// Re-export the underlying UI toolkit for examples and downstream Fluent crates.
pub use gpui;
pub use gpui_platform;

pub use async_resource::{AsyncResource, AsyncResourceState, ResourceRequest};
pub use colors::{
gradient_from_hue, hue_for, tint, with_alpha, ColorScheme, ControlStates, NeutralColorStates,
Expand Down
2 changes: 1 addition & 1 deletion crates/fluent-layout/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ impl Workspace {
/// Prepend a built-in "File" menu with an Exit item that calls `cx.quit()`.
///
/// Pass `app_name` to label the menu "File" (ignored for now; reserved for
/// future "About <app>" or per-platform behaviour).
/// future `About <app>` or per-platform behaviour).
pub fn with_file_menu(mut self, _app_name: impl Into<SharedString>) -> Self {
self.app_name_for_file_menu = Some("File".into());
self
Expand Down
5 changes: 5 additions & 0 deletions crates/fluent-primitives/src/accordion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ pub struct Accordion {
}

impl Accordion {
/// Creates a new instance for use in a Fluent interface.
pub fn new(id: impl Into<ElementId>) -> Self {
Self {
id: id.into(),
Expand All @@ -27,21 +28,25 @@ impl Accordion {
}
}

/// Sets the item configuration for this control.
pub fn item(mut self, item: Expander) -> Self {
self.items.push(item);
self
}

/// Sets the items configuration for this control.
pub fn items(mut self, items: impl IntoIterator<Item = Expander>) -> Self {
self.items = items.into_iter().collect();
self
}

/// Sets the multiple configuration for this control.
pub fn multiple(mut self, multiple: bool) -> Self {
self.multiple = multiple;
self
}

/// Sets the collapsible configuration for this control.
pub fn collapsible(mut self, collapsible: bool) -> Self {
self.collapsible = collapsible;
self
Expand Down
4 changes: 4 additions & 0 deletions crates/fluent-primitives/src/app_dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pub struct AppDot {
}

impl AppDot {
/// Creates a new instance for use in a Fluent interface.
pub fn new(seed: impl Into<SharedString>) -> Self {
let seed: SharedString = seed.into();
let letter: SharedString = seed
Expand All @@ -32,16 +33,19 @@ impl AppDot {
}
}

/// Sets the letter configuration for this control.
pub fn letter(mut self, letter: impl Into<SharedString>) -> Self {
self.letter = letter.into();
self
}

/// Sets the hue configuration for this control.
pub fn hue(mut self, deg: f32) -> Self {
self.hue = Some(deg);
self
}

/// Sets the size configuration for this control.
pub fn size(mut self, size: f32) -> Self {
self.size = size;
self
Expand Down
4 changes: 4 additions & 0 deletions crates/fluent-primitives/src/avatar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ pub struct Avatar {
}

impl Avatar {
/// Returns the initials value.
pub fn initials(initials: impl Into<SharedString>) -> Self {
Self {
initials: Some(initials.into()),
Expand All @@ -26,6 +27,7 @@ impl Avatar {
}
}

/// Returns the image value.
pub fn image(path: impl Into<SharedString>) -> Self {
Self {
initials: None,
Expand All @@ -35,11 +37,13 @@ impl Avatar {
}
}

/// Sets the hue configuration for this control.
pub fn hue(mut self, deg: f32) -> Self {
self.hue = Some(deg);
self
}

/// Sets the size configuration for this control.
pub fn size(mut self, size: f32) -> Self {
self.size = size;
self
Expand Down
Loading
Loading