feat: import CSV UI#9437
Conversation
fe873f5 to
1d48c6b
Compare
|
Contains commits from #9423, best to get that in first |
|
#9423 is in! |
1d48c6b to
d3dd359
Compare
d3dd359 to
3221a42
Compare
|
I expect this'll pass CI now. Will remove the draft if it does Review questions:
|
| override fun onViewCreated(view: View, savedInstanceState: Bundle?) { | ||
| super.onViewCreated(view, savedInstanceState) | ||
|
|
||
| downloadPercentage = view.findViewById(R.id.import_progress_text) |
There was a problem hiding this comment.
How would other reviewers feel about using a DI framework to reduce code here?
There was a problem hiding this comment.
I had to Google it, and I see no issue here.
I mean, I'm never totally fan of adding state, but I'm not fan of huge method either
| AnkiDroidApp.sendExceptionReport(ex, "import failed") | ||
| onException(ex) | ||
| } | ||
| GlobalScope.launch(Dispatchers.Main + exceptionHandler) { |
There was a problem hiding this comment.
@Arthur-Milchior pinging for your opinion on me testing a new async mechanism, and thoughts on whether this API is too far from what we're currently using
There was a problem hiding this comment.
I don't know the first thing about GlobalScope.launch, so hard to tell.
My main concern with switching with a new async mechanism is that all async code currently assume that a single background thread runs at one point in time (appart from synchronization thread). In particular, it means that there is never two activities touching the database at the same time.
I suppose that "performImport" will write to the database.
I can't imagine any actual trouble, but even if it works as expected, still not a great idea to break this invariant until we know how we want async to evolve.
Plus, I'd assume it make testing it more complex as you can't use the same tooling to move this method to frontend
There was a problem hiding this comment.
Agreed in general that testing a new async exec mechanism as a sort of one-off mixed in another PR doesn't seem like the right spot.
| const val RESULT_BUNDLE_OPTIONS = "importOptions" | ||
|
|
||
| /** | ||
| * |
3221a42 to
f3e2792
Compare
usage: `collection.models[noteTypeId]!!`
Handles a user selecting a file For use in the CSV Import (issue 6772)
Handles obtaining a single character (and allows tab input) For use in the CSV Import (issue 6772)
Handles the UI of mapping from CSV to Note fields/tags For use in the CSV Import (issue 6772)
f3e2792 to
180459f
Compare
Also made NoteImporter/TextImporter mutable to handle this as is in the Python Handles the UI of all options when mapping from CSV to Note fields/tags For use in the CSV Import (issue 6772)
For CSV import: Issue 6772
Performs import, shows progress and results For use in the CSV Import (issue 6772)
Ties all the fragments together and responsible for workflow Related: 6772
Adds activity, linked to host fragment and implemented as menu in DeckPicker Fixes 6772
180459f to
12a233a
Compare
This comment has been minimized.
This comment has been minimized.
|
Soft-blocked on #9466 |
|
mostly just noting soft-block PR was merged, and I took a moment to briefly scan comments and perform Seagull Management duties (swoop in, squawk, leave droppings, swoop out hahah) |
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Not going to get to this for a while - scoped storage needs to happen and working on that is my prioirty. |
|
Hello 👋, this PR has been opened for more than 2 months with no activity on it. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically |
|
Superseded by #12105 |

Pull Request template
Purpose / Description
We want to allow the user to import CSVs
Fixes
Fixes #6772
Approach
We already have the python code converted. We use a fragment-based approach for the UI
How Has This Been Tested?
Some unit tests, tested on my phone
Checklist
ifstatements)Screenshots
Accessibility failures