Skip to content

feat: add function to append values to existing multiline or single-line lists while preserving formatting#171

Open
Scott McMaster (scottmcmaster) wants to merge 2 commits into
developfrom
scott/multi-line-nix-lists
Open

feat: add function to append values to existing multiline or single-line lists while preserving formatting#171
Scott McMaster (scottmcmaster) wants to merge 2 commits into
developfrom
scott/multi-line-nix-lists

Conversation

@scottmcmaster
Copy link
Copy Markdown
Contributor

@scottmcmaster Scott McMaster (scottmcmaster) commented May 16, 2026

Summary

Removes the TODO in edit_nix_file about preserving list commenting and formatting.

Screenshot 2026-05-16 at 10 15 35 AM

Test Plan

Added/updated unit tests. Also manual testing, for example see the screenshot.

Docs

  • Docs updated
  • No docs update needed

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 16, 2026

Warnings
⚠️ Please assign this PR to someone (usually yourself).
Messages
📖 No docs update needed — acknowledged.

📋 PR Overview

Lines changed 199 (+183 / -16)
Files 0 added, 1 modified, 0 deleted
Draft / WIP no
Has Test Plan yes
New UI components no
New Storybook stories no
New Rust modules no
New TS source files no
New tests no
package.json touched no
Cargo.toml touched no
Infra / CI touched no

🔬 Coverage

Report Lines Statements Functions Branches
apps/native/coverage/coverage-summary.json 17.3% 17.3% 27.8% 52.9%

Generated by 🚫 dangerJS against 8ffdb9b

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves Nix list editing in the Tauri native “evolve” layer by appending new list items into an existing list literal without rewriting the whole list, preserving existing multiline formatting and comment structure (removing the prior TODO about formatting loss).

Changes:

  • Added append_values_to_existing_list() to insert new values before the list’s closing bracket while preserving formatting.
  • Updated add() to append only missing values to an existing list rather than replacing the full list text.
  • Expanded/updated unit tests to validate formatting preservation for commented and multiline lists.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/native/src-tauri/src/evolve/edit_nix_file.rs
Comment thread apps/native/src-tauri/src/evolve/edit_nix_file.rs Outdated
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.

2 participants