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

Add quick suggestions to easily amend the include/exclude params #44

Open
ScottWilliamAnderson opened this issue Dec 23, 2024 · 0 comments
Labels
suggestion New feature or request

Comments

@ScottWilliamAnderson
Copy link

It would be nice if there were some quick ways to modify the subset of files used for the ingestion, without having to type them out manually.

This would make it both quicker to ingest new repos, as well as give new users an indication of easy ways to improve the usefulness of this tool.

The existing *.md and src/ is useful, but to verify the effectiveness of the list that we pass to the tool, it's quite iterative: add one more, check the structure/summary, edit the list, repeat. This can be taxing on the server if it needs to recompute every time it's submitted.

Letting the user bulk add a few at a time would lessen this burden.

For ease of planning, assume these examples could be used both with the included and exclude options.

After some testing some repos, I often used:

tests/*

*.md 

*.json

*.py

.gitignore

*.docs

*.css

*.html

If you've used gitingest quite a bit and remember using any others frequently, do tell!

To ensure these suggestions are relevant (e.g. don't show *.py suggestion in a JavaScript repository) a quick way could be, for each suggestion, to append it to the current filter. If the subset of files used does not change, exclude that suggestion as it would not have an effect. You can sort the suggestions shown to the user by number of files (or total number of lines) affected, and only show say the top 3 or top 5 for example. Letting the user scroll through to see more is usually a good idea but not required at first.

If you collect data at all about the most used filters, you could either use those to make the list of suggestions themselves, or just help in the sorting of the existing suggestions.

Finally, it's a very good idea to let the user quickly undo adding a suggestion without needing to edit manually. Tapping or clicking the suggestion again to remove it could be a good way of doing this.

If the user manually adds an entry that was actually part of the suggestions, it could be treated the same way as if they added it via the suggestion, so that the quick removal feature works for editing that piece as well.

I hope this makes sense. Do let me know what you think!

ScottWilliamAnderson added a commit to ScottWilliamAnderson/gitingest that referenced this issue Dec 23, 2024
Related to cyclotruc#44

Add quick suggestions feature to easily amend include/exclude parameters.

* **In `src/gitingest/ingest_from_query.py`**:
  - Add `generate_suggestions` function to analyze repository and identify common file patterns.
  - Implement `check_relevance` function to check the relevance of each suggestion.
  - Add `sort_suggestions` function to sort suggestions based on the number of files or total lines affected.

* **In `src/gitingest/cli.py`**:
  - Add new `--suggestions` option to display quick suggestions for include/exclude patterns.
  - Update `main` function to include suggestions in the output.

* **In `src/gitingest/parse_query.py`**:
  - Add `normalize_user_added_patterns` function to normalize user-added patterns.
  - Add `check_user_added_matches_suggestions` function to check if user-added patterns match any suggestions.

* **In `src/gitingest/tests/test_ingest.py`**:
  - Add tests for `generate_suggestions`, `check_relevance`, and `sort_suggestions` functions.

* **In `src/static/js/utils.js`**:
  - Add `toggleSuggestion` function to handle adding/removing suggestions by clicking.
  - Add `displaySuggestions` function to display suggestions in the web interface.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/cyclotruc/gitingest/issues/44?shareId=XXXX-XXXX-XXXX-XXXX).
@cyclotruc cyclotruc added the suggestion New feature or request label Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
suggestion New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants