Skip to content

Cas/monaco diffs#62

Open
Cas Linden (CasLinden) wants to merge 22 commits into
developfrom
cas/monaco-diffs
Open

Cas/monaco diffs#62
Cas Linden (CasLinden) wants to merge 22 commits into
developfrom
cas/monaco-diffs

Conversation

@CasLinden
Copy link
Copy Markdown
Contributor

@CasLinden Cas Linden (CasLinden) commented Apr 30, 2026

Summary

Replace kibo ui codeblocks for diff display with monaco editor diffs, showing accurate file states and line numbers.
Adds scroll to hunk feature
Adds styles and configuration for monaco editor

Edit 05/05

  • fix monaco editor state resets, for diffs and nix-editor
  • use non-diff editor for one-version deleted or untracked files
  • add color theme extracted from claude design tests
  • remove edit button from deleted type diffs
  • improved UX and styling in general

Test Plan

Make more changes in a file and go to the diff tab, open the diff.

Edit 05/05

  • edited stories, added mocks and improved testability
Suite Total Pass Fail Skip Δ
Vitest unit 10 files (75 tests) 9 1 unchanged
Vitest storybook 47 files (153 tests) 45 2 only rebuild-overlay-panel's Starting and Infinite Recursion Error, both develop-side)
Rust unit 38 modules 38 0 unchanged
Playwright E2E 2 2 0 unchanged
wdio 6 suites 4 2 unchanged (conversational + onboarding; not branch-related)

Docs

  • No docs update needed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).
⚠️ ❗ Big PR (2842 lines changed). Consider splitting it into smaller, focused changes.
⚠️

New TypeScript source files were added without any new tests:

  • apps/native/src/components/widget/summaries/monaco-setup.ts
  • apps/native/src/components/widget/summaries/monaco-theme.ts

📋 PR Overview

Lines changed 2842 (+1490 / -1352)
Files 20 added, 35 modified, 6 deleted
Draft / WIP no
Has Test Plan yes
New UI components yes (6)
New Storybook stories yes (6)
New Rust modules no
New TS source files yes (8)
New tests no
package.json touched yes
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 16.7% 16.7% 29.3% 53.0%

Generated by 🚫 dangerJS against ed81e1a

Base automatically changed from main to develop May 4, 2026 09:33
@CasLinden Cas Linden (CasLinden) marked this pull request as ready for review May 8, 2026 12:27
@CasLinden Cas Linden (CasLinden) marked this pull request as draft May 8, 2026 12:30
@CasLinden Cas Linden (CasLinden) marked this pull request as ready for review May 8, 2026 12:33
@CasLinden
Copy link
Copy Markdown
Contributor Author

Updated test rersults, WDIO failures are on develop.

Vitest — unit project

File Result Notes
src/stores/widget-store.test.ts PASS 25 tests
src/hooks/use-permissions.test.ts PASS 6 tests (2 emit expected stderr from "plugin throws" cases)
src/components/widget/widget.test.tsx PASS 4 tests
src/components/widget/controls/directory-picker.test.tsx FAIL (1 failing) 12 pass / 1 fail — > ignores setHostAttr failures without breaking the happy path (expected hosts ["mbp"], got []) at line 246
src/components/widget/utils.test.ts PASS 2 tests
src/components/kibo-ui/nix-editor/use-nix-editor.test.ts N/A file does not exist on this branch (moved out of kibo-ui — see row below)
src/components/nix-editor/use-nix-editor.test.ts PASS 13 tests
src/components/ui/ui.test.tsx N/A file moved to packages/ui/src/components/ui/ui.test.tsx in commit 34e4237 (2026-05-06); not run by apps/native vitest
src/lib/ai-provider-validation.test.ts PASS 2 tests
src/components/widget/summaries/summary-items.test.tsx PASS 4 tests

Vitest totals: 8 files run, 7 pass, 1 fail; 69 tests run, 68 pass, 1 fail. 2 template rows N/A (files don't exist in apps/native scope on this branch).


Rust unit tests — by module

Module Result Notes
ai::log_summarizer PASS
ai::provider_errors PASS
bootstrap::default_config PASS
bootstrap::template PASS
commands::config PASS
commands::debug PASS
commands::helpers PASS
db::schema PASS
e2e_runtime PASS
evolve::age PASS
evolve::chat_memory PASS
evolve::config_dir_context PASS
evolve::edit_nix_file PASS
evolve::ensure_secret PASS 1 ignored: execute_ensure_secret_full_flow_interactive (manual; launches sops editor)
evolve::file_ops PASS
evolve::gitignore PASS
evolve::search_code PASS
evolve::search_docs PASS
evolve::search_packages PASS
evolve::sops PASS
evolve::tools PASS
evolve::utils PASS
feedback PASS
git::changes_from_diff PASS
git::exec PASS
managed_edits::homebrew_adopt PASS 1 ignored: scan_homebrew_manual_output (manual; requires Homebrew installed locally)
state::build_state PASS
state::evolve_state PASS
storage::credential_store PASS
storage::store PASS
summarize::build_prompt PASS
summarize::group_existing PASS
summarize::queue_summarizer PASS
summarize::token_budgets PASS
system::nix_ast_lists PASS
system::permissions PASS
system::scanner PASS
updater_pin PASS
utils PASS

Cargo totals: 286 passed, 0 failed, 2 ignored (both noted above — manual-only tests).


Playwright E2E

Test Result Notes
app shell mounts PASS
page has expected title PASS

Playwright totals: 2 passed / 0 failed.


wdio — Tauri app suites

Debug binary present; ran headless (Option B): Vite on 5173, tauri-wd on 4444, run from apps/native.

Suite Result Notes
smoke PASS 4/4: tauri smoke (1) + top-level views (3)
basic-prompts PASS 3/3
conversational FAIL (1 failing) 1 pass / 1 fail — submits a conversational prompt on the Evolve step: window.__testWidget?.getChangeMap?.() returned null, expected populated change map (singles list with jetbrains-mono font edit). Begin step variant passed
discard PASS 2/2
modify PASS 1/1
onboarding FAIL (1 failing) 0 pass / 1 fail — shows onboarding UI and bootstraps a new config repo: timed out waiting for [data-testid="create-default-config-button"] selector (62s timeout)

wdio totals: 6 suites: 4 pass, 2 fail. Tests: 11 pass, 2 fail.

Summary

Counted at the most natural unit per suite: vitest by file, rust by module, the rest by test/suite as listed.

Suite Total Pass Fail Skip / N/A
Vitest unit (by file) 10 rows 7 1 2 N/A (kibo-ui/.../use-nix-editor.test.ts and ui/ui.test.tsx not present in apps/native on this branch)
Vitest unit (by test) 69 68 1
Rust unit (by module) 39 39 0
Rust unit (by test) 288 286 0 2 ignored (manual-only)
Playwright E2E 2 2 0 0
wdio (by suite) 6 4 2 0
wdio (by test) 13 11 2 0
Peekaboo 1 1 (CI only)
System E2E 1 1 (CI only)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't read all the code, but when testing the app, the diff lines summaries (+X -Y on top) are correct, but the diff shows that the whole file has been deleted (see screenshot).

Image

The actual diff looks like this in Emacs:

Image

@arximboldi
Copy link
Copy Markdown
Contributor

About the issue above, I wonder whether it may be related to this: https://linear.app/darkmatterlabs/issue/ENG-472/review-fix-edit-path-resolution-for-nested-flake-configs

@CasLinden
Copy link
Copy Markdown
Contributor Author

About the issue above, I wonder whether it may be related to this: https://linear.app/darkmatterlabs/issue/ENG-472/review-fix-edit-path-resolution-for-nested-flake-configs

You are right. The file read is lacking awareness of the nested structure and thus lacked the ability to read the changed version of the file.

I added a helper in the git module, which fixes only the issue on this branch.

The full range of changes needed to support the nested dir may exceed the ticket. I will comment.

I also added a preference to prefer the diff tab to the preference settings. Deemed the scope creep worth it.

Ran tests again,

Suite Total Pass Fail Skip
Vitest unit (files) 10 rows in template 8 0 1 missing (ui.test.tsx) + 1 N/A on this branch (kibo-ui/...)
Vitest unit (tests) 66 66 0 0
Rust unit (modules) 39 39 0 0
Rust unit (tests) 288 286 0 2 (ignored — manual)
Playwright E2E 2 2 0 0
wdio (suites) 6 4 2 0
wdio (tests, observed) 13 11 2 0
Peekaboo 1 1
System E2E 1 1

Cause of two WDIO failures:

  • setup step (-> recent whirlwind of changes to component)
  • Conversational response (-> bug fix not surviving merge resolution while test change made it through)

@arximboldi
Copy link
Copy Markdown
Contributor

Hi Cas Linden (@CasLinden)! Thanks for the update. I have tried it again and it seems to be better. Also nice that you also addressed eng-487. However, I am still unsure about the result. When I expand a file, the I see the whole file, like this:

Screenshot 2026-05-15 at 19 09 21

So that I have to scroll a fair bit to see the actual change. The view does some cool things (keeps blocks as a kind of "header" to see context as you scroll) but I feel like having to scroll through the full file kind of defeats the purpose of a "summary". Perhaps it could show just the hunks (maybe with the old impl) and then with a button expand to the full file. What do you think? Pinging Farhan (@fkb032) and cooper (@czxtm) in case they have an opinion this?

@arximboldi Juanpe Bolívar (arximboldi) marked this pull request as draft May 15, 2026 18:53
@arximboldi Juanpe Bolívar (arximboldi) marked this pull request as ready for review May 15, 2026 18:53
@CasLinden
Copy link
Copy Markdown
Contributor Author

Juanpe Bolívar (@arximboldi) The editor should scroll to the first diff hunk on open. I will see if these is an issue with this.
Alternatively you can click the (+1) pill, or the summary if that is available, you to scroll to that diff.

Maybe I could add highlighting to pills when editor expanded and hunk in view, to nudge users towards the interaction.

Part of the motivation for this full file impl. is that multiple changes in one file were creating long lists of elements.
I initially tested showing the full file only for files with multiple changes, but that it seemed inconsistent. I think with scroll working (which it does at least sometimes) I hope this addresses your concern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants