Skip to content

Conversation

@lazysegtree
Copy link
Collaborator

…the last selected file, will work on changing that, but maybe having the last selected file makes sense?

@lazysegtree
Copy link
Collaborator Author

Issue #330

@lazysegtree
Copy link
Collaborator Author

lazysegtree commented Mar 12, 2025

@anaypurohit0907 It has failed the testsuite's compress, extract test. Meaning the existing functionality has been broken due to this change. Can you check and fix that.

@lazysegtree
Copy link
Collaborator Author

lazysegtree commented Mar 12, 2025

I would say it makes more sense to name from the first file.
The input is a list of selected files, it makes more sense to name to output from the first file.
The last file make sense when you consider how users made the selection - You are naming the output file based on what users added to the selection at last. But that could be wrong, as users might select from bottom.

Or users select in an arbitrary way, like this
image

@yorukot thoughts ?

@anaypurohit0907
Copy link

yup youre right i think, i never thought about users selecting arbitrarily . super helpfull. ill rewrite that logic(idk how but ill do it)

@lazysegtree lazysegtree added the pr needs work PR needs work before it can be further reviewed/merged label Mar 17, 2025
@lazysegtree
Copy link
Collaborator Author

We should replace our zipSource function with a third party library. We dont need to reinvent the wheel.

fileName := filepath.Base(panel.element[panel.cursor].location)

// Create a slice to hold the paths of all selected files
var selectedFiles []string
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

You dont need this. The slice of selected files is already available as panel.selected

@anaypurohit0907
Copy link

the third party library idea seems nice, but that is adding one more dependency, if you are okay with it ill try that

@lazysegtree lazysegtree removed the pr needs work PR needs work before it can be further reviewed/merged label Apr 11, 2025
@lazysegtree
Copy link
Collaborator Author

Yes @anaypurohit0907 We are fine with it. We already use external library for extraction of archives.

@lazysegtree lazysegtree added the pr needs work PR needs work before it can be further reviewed/merged label May 5, 2025
@coderabbitai
Copy link
Contributor

coderabbitai bot commented May 5, 2025

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@anaypurohit0907
Copy link

@lazysegtree i looked online but couldnt find any external library, all the results were using zip.Writer type from the archive/zip package. which is an inbuilt package i think. heres an example article i found : https://gosamples.dev/zip-file/

i think we are doing the same thing in the zipsource function anyways. we might have to continue using the current code, maybe improve its quality a bit. what do you think?

@lazysegtree
Copy link
Collaborator Author

okay. If we have to keep using current code its fine.
Improving the quality would be an optional thing for this PR. if you just fix the bug, that okay too.

@anaypurohit0907 anaypurohit0907 force-pushed the Compress-all-files-selected-#330 branch from 529c554 to 54aee46 Compare May 10, 2025 07:46
@lazysegtree
Copy link
Collaborator Author

lazysegtree commented Jun 6, 2025

Issue addressed in this PR #821

@lazysegtree lazysegtree closed this Jun 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fixes pr needs work PR needs work before it can be further reviewed/merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants