microsoft / microsoft/vscode-documentdb

Easy Data Editing 🚀

Open
#62 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feedback wanted
Dominant language
TypeScript
Stars
31
Forks
22
Avg merge
2d 20h
Merged PRs (30d)
21

Description

Easy Data Editing: Feedback and Collaboration Welcome! 🚀

We propose Easy Data Editing for DocumentDB and MongoDB databases, a feature designed to enable in-place editing of data directly within the "Collection View." This functionality aims to make quick edits simple and intuitive, catering especially to developers who need to adjust single documents or values during feature development or debugging. Here’s the concept, and we’d appreciate your input to make it even better.


Proposed Feature Overview

Easy Data Editing will allow users to update individual fields in documents directly from the interface. This feature supports all simple data types and provides an intuitive way to navigate and edit complex types like objects and arrays. It will be integrated into the "Collection View," supporting both table and tree views.

Core Features
  1. In-Place Editing for Simple Data Types

    • Double-click on any editable value to update it directly.
    • Support for simple types:
      • Strings, numbers, booleans, dates, and null values.
    • Immediate visual feedback after edits, ensuring changes are clear.
  2. Editing Complex Types (Objects and Arrays)

    • For objects and arrays, users can "step into" the entry for detailed editing:
      • Expand the object or array to reveal individual fields or items.
      • Edit nested values in a similar double-click workflow.
    • Provide breadcrumbs or navigation aids for easy context tracking.
  3. Integrated into Table and Tree Views

    • Available in both the tabular and hierarchical (tree) display modes.
    • Ensure consistency in editing workflows across views.
  4. Error Validation and Feedback

    • Validate edits immediately for correctness:
      • Type consistency with existing schema.
      • Database-specific constraints (e.g., _id uniqueness, validation rules).
    • Highlight invalid edits with error messages and allow re-editing.
  5. Undo and Redo Support (Topic for Evaluation)

    • Should changes be executed immediately, or should the user commit all changes once editing is complete?
    • Immediate writes are simple to understand but hard to undo, especially as documents may change underneath during live edits.
    • Delayed commits allow a chance to review all changes but introduce UX complexity.
    • Consider introducing a "read-only" lock mode in the Collection View, which would require users to unlock the view explicitly for editing. This default "locked" mode could prevent unintended edits and provide clarity.
    • We welcome feedback on the best approach to balancing usability, safety, and intuitiveness.
  6. Save Changes

    • Prompt users to confirm or discard changes before persisting them to the database if a delayed commit is chosen.
    • Highlight unsaved edits in the interface for clarity.

We Need Your Feedback!

Discussion Areas
  1. Immediate vs. Deferred Changes

    • Should edits be applied directly to the database, or should users commit final changes in bulk?
    • How important is it to maintain an undo feature when working with live data, given that underlying documents can change dynamically?
    • Would a default "read-only" lock mode, requiring explicit unlocking for edits, improve safety and clarity?
  2. Decoupling from SlickGrid

    • The current table component ("SlickGrid") might be replaced in the future. How can we design this feature to minimize dependency on the specific grid implementation?
    • Should editing logic and workflows be component-agnostic to ensure compatibility with future UI updates?
  3. Editing Experience

    • Are there additional workflows or shortcuts that would make editing faster or more intuitive?
    • Should we allow bulk editing for multiple selected fields in a single operation?
  4. Error Handling and Validation

    • How should the interface handle invalid inputs, especially for complex nested structures?
    • Would users prefer automatic type conversion (e.g., string to number) or strict enforcement of the original type?
  5. Performance Considerations

    • For large collections, how can we ensure smooth editing without significant lag?
    • Should edits be deferred or batched to optimize database interactions?

How It Will Work

  1. In-Place Editing Workflow

    • Users double-click on a value in the table or tree view.
    • The value becomes editable, and users can input new data directly.
    • For objects or arrays, a "step into" button or interaction reveals detailed editing options for nested fields.
  2. Validation and Feedback

    • Edits are validated locally for basic errors (e.g., type mismatch).
    • For complex validations (e.g., schema compliance), errors are displayed after attempting to save.
  3. Save or Discard Changes (Pending Decision)

    • If deferred writes are chosen, users review and confirm changes before saving them to the database.
    • Changes are highlighted until saved to remind users of pending updates.
  4. Undo and Redo (Topic for Evaluation)

    • Immediate writes make undo difficult but offer simplicity and speed.
    • Deferred commits allow undo functionality but introduce workflow complexity.
    • Explore feedback on the balance between these approaches.
  5. Integration with Current UI Components

    • Ensure editing workflows are decoupled from SlickGrid by:
      • Using reusable logic components for editing workflows.
      • Abstracting cell editing functionality to work with any table or tree view component.

Draft Development Plan

  1. Editing Logic and Validation

    • Develop reusable logic for in-place editing, supporting simple and complex data types.
    • Implement validation rules for database-specific constraints.
  2. UI Integration

    • Integrate editing workflows into the current SlickGrid-based table view and tree view.
    • Abstract the editing interface to ensure compatibility with potential future view components.
  3. Error Feedback and Undo Support

    • Design error feedback and highlighting for invalid edits.
    • Explore undo functionality and the feasibility of deferred commit workflows.
  4. Performance Optimization

    • Test and optimize editing workflows for large datasets and collections.
    • Explore deferred or batched updates to improve responsiveness.
  5. Testing and Validation

    • Validate the feature with diverse data types and complex structures.
    • Ensure compatibility across various database schemas and constraints.
  6. Documentation and User Guide

    • Provide a detailed guide for using in-place editing.
    • Include best practices for navigating and editing nested objects and arrays.

What’s Next?

This is the initial concept for Easy Data Editing. With your feedback, we’ll refine and enhance this feature to ensure it’s fast, reliable, and intuitive. Together, let’s make data editing practical and effective for DocumentDB and MongoDB databases! 🌟

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points; start by reviewing the existing Collection View, table/tree views, and SlickGrid integration. Resolve the immediate-versus-deferred save, validation, undo, and component-decoupling decisions before implementation, then verify editing simple and nested MongoDB or DocumentDB data with feedback and save or discard behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
mongodb, typescript, vscode
Domain
database, devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.