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

autobib find improvements #77

Open
alexrutar opened this issue Oct 12, 2024 · 6 comments
Open

autobib find improvements #77

alexrutar opened this issue Oct 12, 2024 · 6 comments
Labels
enhancement New feature or request waiting-for-upstream Waiting for upstream changes
Milestone

Comments

@alexrutar
Copy link
Collaborator

alexrutar commented Oct 12, 2024

Summary:

  • We should support some options so that autobib find can operate in non-interactive mode. For instance, for a given query, return the n most likely hits, etc.
  • Improve formatting of records when printing, such as removing the braces {} where extraneous, or formatting the author field
  • Add a --preview option to show the corresponding record when highlighting the item (maybe do this by default, when it is implemented); upstream: Previewer nucleo-picker#5
  • Only display records with at least one of the fields provided by -f (so we do not display 'empty' records)
  • When Allow 'formatting strings' in autobib attach --rename and for rows in autobib find #172 is merged, we might want to replace the implementation of -f to instead specify an arbitrary "format string" (which has access to the fields) with the exact same syntax as might be accepted by --format
@alexrutar alexrutar added the enhancement New feature or request label Oct 12, 2024
@alexrutar alexrutar changed the title Headless autobib find options autobib find improvements Oct 24, 2024
@alexrutar
Copy link
Collaborator Author

There's also an upstream issue for a previewer implementation in autobib/nucleo-picker: autobib/nucleo-picker#5

When this is implemented, we could potentially add a --preview option so when the user highlights a particular record, it renders the contents of the corresponding record in the preview window.

@alexrutar
Copy link
Collaborator Author

We should also add filter options:

  • To check if a given record has an attached file
  • Filter by provider
  • Other filters?

@alexrutar
Copy link
Collaborator Author

alexrutar commented Oct 28, 2024

Also think of a way to make slightly better guarantees: maybe the inject_all_records should be wrapped into a transaction, and the return type should be a rowid, and then we return the row on completion so we can guarantee that the given rowid is valid and construct the relevant row. This way the selected record is guaranteed to exist in the database.

I think this is not necessary.

@alexrutar alexrutar mentioned this issue Oct 29, 2024
5 tasks
@alexrutar
Copy link
Collaborator Author

alexrutar commented Oct 29, 2024

We should also be able to recursively list attached files to make it easier to find files to open. We could use the ignore crate for directory walking. It would be nice to be able to give an 'amalgamated' view, which includes filenames, plus associated metadata, etc. so it can all be searched against simultaneously.

Implemented in #171

@alexrutar
Copy link
Collaborator Author

alexrutar commented Dec 2, 2024

Copying in a comment from earlier:

Actually I am hoping somehow that the 'find' command could be used as a general placeholder in many places so that if the user does not specify a record to some function call (e.g. in the future, a call to autobib file open) then choose_canonical_id (with a relevant renderer for the call context) is automatically invoked for the user to pick the relevant item(s).

This is still waiting on some upstream changes; namely autobib/nucleo-picker#4 which depends on another upstream PR (which has already been merged, but is not yet part of a versioned release), so that the picker can return multiple items. In this situation the return code will be automatically modified, I guess, since instead of Picker::pick returning Option<&T> we will get Picker::pick_multi returning Vec<&T>.

I guess this is only a good idea in situations where there is a positional RecordId argument which is the final provided argument; either as a Vec<RecordId> or <RecordId>; then we could just define a custom Clap argument type here.

@alexrutar alexrutar added this to the Version 0.3.0 milestone Dec 8, 2024
@alexrutar alexrutar added the waiting-for-upstream Waiting for upstream changes label Jan 1, 2025
@alexrutar
Copy link
Collaborator Author

alexrutar commented Feb 1, 2025

Could also have --open flag (using https://docs.rs/open/latest/open/) such that:

  1. In --attachments mode, open the selected file;
  2. Otherwise open the URL associated with the record (related to Handle web URLs #42)

Also pass a --open-with option to specify the program to open

Implemented in #171

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request waiting-for-upstream Waiting for upstream changes
Projects
None yet
Development

No branches or pull requests

1 participant