Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context selection excludes the content of Pinned files #1984

Open
kgilpin opened this issue Sep 11, 2024 · 1 comment
Open

Context selection excludes the content of Pinned files #1984

kgilpin opened this issue Sep 11, 2024 · 1 comment
Labels
bug Something isn't working navie-plan

Comments

@kgilpin
Copy link
Contributor

kgilpin commented Sep 11, 2024

When selecting context, the contents of "pinned" files should not be included:

Screen Shot 2024-09-11 at 2 42 45 PM

--

In the navie package, set context options indicating which files are already "pinned". Utilize the existing "exclude" list option for this.

To support this option, the "codeSelection" parameter should be enhanced to support named files.

In the cli package, skip "pinned" files when searching for context.

Ignore the UI (components) for this design.

@kgilpin kgilpin added bug Something isn't working navie-plan labels Sep 11, 2024
Copy link

github-actions bot commented Sep 11, 2024

Title:

Enhance Context Selection to Exclude Pinned Files in Navie and CLI Packages

Problem:

The content of pinned files is currently not excluded during context selection. The user wants to enhance the system to recognize pinned files and skip them, particularly focusing on the navie and cli packages. The UI components are not to be considered in this design.

Analysis:

The core of the problem lies in adding the ability to identify pinned files globally and then ensuring they are excluded during context selection.

  1. In the navie package:

    • Context options indicating pinned files should be set.
    • Update the codeSelection parameter to support file names, so the system can identify the pinned files.
  2. In the cli package:

    • Ensure context selection respects the pinned files list (i.e., skip these files).

The exclude list option should be leveraged to store and recognize pinned files during context selection. Essentially, an overarching mechanism to manage pinned files is needed, so that when context selection happens, these files are skipped.

Proposed Changes:

  1. navie package (code-selection-service.ts):

    • Update the CodeSelectionService class to support managing pinned files. Include methods to add and remove pinned files from the global exclude list.

    MODIFICATION:

    <!-- file: /home/runner/work/appmap-js/appmap-js/packages/navie/src/services/code-selection-service.ts -->
    Add methods to manage pinned files by enhancing the code selection mechanism.
  2. cli package (DiffDiagrams.ts):

    • Ensure the context selection mechanism skips pinned files by checking against the global exclude list.
    • Update the ExcludeFilter to recognize pinned files.

    MODIFICATION:

    <!-- file: /home/runner/work/appmap-js/appmap-js/packages/cli/src/sequenceDiagramDiff/DiffDiagrams.ts -->
    Add logic to skip the context selection of pinned files by utilizing the exclude list.

Detailed Implementation:

  1. navie package:

    • Update the CodeSelectionService to manage a list of pinned files:
      <!-- file: /home/runner/work/appmap-js/appmap-js/packages/navie/src/services/code-selection-service.ts -->
      Add methods to set pinned file paths in the exclude list:
      - Add `pinFile(filePath: string)` method to add files to the pinned list.
      - Add `unpinFile(filePath: string)` method to remove files from the pinned list.
      - Update `applyCodeSelection(codeSelection: string)` method to account for pinned files by modifying code execution to include pinned file paths in the context.
  2. cli package:

    • Modify the ExcludeFilter in DiffDiagrams.ts to respect pinned files.
    • Update diff() and filterDiagram() methods to skip files listed in the pinned list.
      <!-- file: /home/runner/work/appmap-js/appmap-js/packages/cli/src/sequenceDiagramDiff/DiffDiagrams.ts -->
      Use the exclude list to filter out pinned files during context search:
      - In `ExcludeFilter`, adjust the `test(action: Action)` method to include logic checking against pinned files.
      - Update the `filterDiagram(diagram: Diagram)` method to skip actions involving pinned files by leveraging the exclude list that now contains pinned files.

By implementing the above logic, pinned files will be excluded from context selection seamlessly, honoring the user requirement while maintaining the core functionality of the context selection system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working navie-plan
Projects
None yet
Development

No branches or pull requests

2 participants