Scrub GIT_DIR and friends from git tests #45

Manually merged
mdoorn merged 2 commits from feat/045-scrub-git-dir-and-friends-from-git-tests into master 2026-06-18 15:25:14 +02:00
Owner

Scrub GIT_DIR and friends from git tests

Along the way:

  • Redesign buffer tab strip and drop the duplicate file-name header

Touches 6 files: ck-ui/src/theme/dark.rs, ck-ui/src/theme/tokens.rs, ckeditor-lint/baseline.toml, ckeditor-lint/baseline_CHANGELOG.md, ckeditor/src/app_layout/buffer_panel.rs, ckeditor/src/git/diff.rs.

Scrub GIT_DIR and friends from git tests Along the way: - Redesign buffer tab strip and drop the duplicate file-name header Touches 6 files: `ck-ui/src/theme/dark.rs`, `ck-ui/src/theme/tokens.rs`, `ckeditor-lint/baseline.toml`, `ckeditor-lint/baseline_CHANGELOG.md`, `ckeditor/src/app_layout/buffer_panel.rs`, `ckeditor/src/git/diff.rs`.
mdoorn approved these changes 2026-06-18 11:14:50 +02:00
mdoorn left a comment

Happy with this. I ran the suite against the branch and it is green, ckeditor/src/app_layout/buffer_panel.rs included.

Happy with this. I ran the suite against the branch and it is green, `ckeditor/src/app_layout/buffer_panel.rs` included.
@ -293,0 +375,4 @@
}
}
fn paint_tab_background(
Owner

paint_tab_background reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?

`paint_tab_background` reads, decides and writes in one function. The deciding part is the piece I would want to test on its own. Worth splitting?
Author
Owner

Split. The decision in paint_tab_background is a pure function now, with its own tests in ckeditor/src/app_layout/buffer_panel.rs.

Split. The decision in `paint_tab_background` is a pure function now, with its own tests in `ckeditor/src/app_layout/buffer_panel.rs`.
hkowalski approved these changes 2026-06-18 14:08:11 +02:00
hkowalski left a comment

Looked through ckeditor/src/app_layout/buffer_panel.rs as well. Fine by me.

Looked through `ckeditor/src/app_layout/buffer_panel.rs` as well. Fine by me.
ckeditor::git::diff::tests spawns `git init` / `git config` inside a
tempfile::tempdir so each test has its own self-contained repo. Run
directly via `cargo test --workspace` that works, but under the
pre-commit hook git inherits GIT_DIR (and GIT_WORK_TREE,
GIT_INDEX_FILE, GIT_COMMON_DIR, GIT_OBJECT_DIRECTORY) from the hook's
environment. Every git invocation then secretly operates on the outer
repo's .git rather than the tempdir, so two parallel tests race on
.git/config.lock and one of them quietly stages a `seed.txt` into the
outer repo's index.

The git test helper now scrubs those env vars per Command, so the
tempdir's local repo is the only thing each git invocation sees.
Tests now pass under both `cargo test --workspace` and the pre-commit
hook environment.
Replaces the plain text-plus-X buffer tabs with proper tabs: each tab
is a filled rect with rounded top corners, distinct active /
inactive / hover fills, and a 2px top indicator that uses the active
context's branch color (via context_palette::accent, falling back to
theme.color.accent). The close × is always visible on the active tab
and on hover for inactive tabs, with a rounded highlight when hovered.

The renderer is rewritten with the painter API in free functions
(render_buffer_tab_strip, render_one_tab, paint_tab_background,
paint_active_indicator, paint_tab_label, paint_close_button) so the
per-tab branching does not land on app_layout::CkEditorApp's metric
ledger — same pattern as dashboard_keyboard_focused. Cyclomatic
drops 443 → 440 and RFC drops 257 → 252 on that type.

Tab styling is driven by new TabTokens fields (bg_active, bg_inactive,
bg_hover, strip_bg, padding_h, padding_v, corner_radius, gap,
close_size, close_padding, close_hover_bg) so the values are tuned in
one place and the existing TabBar<T> consumer is unaffected.

Also drops the large file-path heading that was rendered above the
buffer content. The status bar already shows the selected file path
with a file icon, so the heading was duplicate chrome eating
vertical space. show_file_header keeps the [EDIT] indicator and the
right-aligned mode label (NAVIGATE / EDIT / VISUAL / READ), since
the mode label is the only top-of-buffer surface for Visual /
Navigate states (the status bar only shows EDIT).
mdoorn manually merged commit bc1cc3f5e3 into master 2026-06-18 15:25:14 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
northgale/ckeditor!45
No description provided.