tuttle-dev / tuttle

🪰 Tuttle - time and money management for freelancers
GNU General Public License v3.0
63 stars 12 forks source link

Screen: Time tracking data entry #101

Closed clstaudt closed 1 year ago

clstaudt commented 1 year ago

There are three ways of entering time tracking data:

  1. uploading a spreadsheet (
  2. uploading a calendar file (.ics)
  3. querying the data from a cloud calendar

Design the UX/UI for this and add to a screen.

Display the result, i.e. the time tracking data (e.g. via DataTable).

Preferences management:

vlad-ed-git commented 1 year ago

@clstaudt what is the flow for this usecase querying the data from a cloud calendar?

clstaudt commented 1 year ago

@vlad-ed-git

Details to be designed, but:

clstaudt commented 1 year ago

@vlad-ed-git The screen for getting the time tracking data from the cloud calendar may be as simple as having a reload button (🔄) and possibly a field or dropdown menu to set the calendar name.

When the reload button is clicked, a popup dialog asks for the iCloud password ( #103 ), then we see a progress bar and then the DataTable with the time tracking entries updates.

clstaudt commented 1 year ago

103

vlad-ed-git commented 1 year ago

@clstaudt If I understand correctly, we have two instances.

  1. The user has not set any iCloud account in their preferences. In which case they would provide the name of account, a password and this would configure that account. After this.
  2. They set a calendar name and click a button to load the data from this calendar name. Calendar names that have already been added can be accessed from a drop down list to be selected for reload.

Is this correct?

clstaudt commented 1 year ago

@vlad-ed-git

Re 1.: we can require that the account is configured in the preferences. The option to configure it "just in time" is not needed for the MVP. If it's not configured the option to get the time tracking data from the cloud is not available.

Re 2: For the first iteration a text field to set the name will do. Nice to have: There's probably a way to list all available calendars for the cloud account. In that case login would have to come before calendar selection.

clstaudt commented 1 year ago

Basically what the screen should do is calling timetracking.import_from_calendar and display the resulting DataFrame:

def import_from_calendar(cal: Calendar) -> DataFrame

The calendar may be a FileCalendar that was just uploaded or a CloudCalendar that can be queried.

To simplify you may ignore the spreadsheet upload option for now.

vlad-ed-git commented 1 year ago

@clstaudt please check the latest implementation if the setup is correct. **there is some sort of glitch now with dialogs, I need to check the refactoring you have done on app.py for this.

clstaudt commented 1 year ago

@vlad-ed-git I think it's a good start, let's refine tomorrow.

Screenshot 2023-01-09 at 20 10 19

Is it actually accessing the calendar yet?

As I said, I think it's fair to expect the user to configure the account in the settings first. Also whether it's an iCloud or Google Calendar or... whatever account (CalDAV?). The rest of the code should be generic, talk about "cloud calendar", and be named accordingly. In the Time tracking screen, it says that the option is available when a cloud account has been configured.

vlad-ed-git commented 1 year ago

I am referring to the flow on the UI. Calendar access is backend integration. I mean is the flow correct or do you wish to change it? By flow I mean: User clicks new, they see 3 options, one of them is to use iCloud acc (can be renamed to a more generic name, that's fine), they click on that and provide a calendar name and password (this acc is saved or pulled from the preferences setup). Or does configuration require more information?

On Tue, Jan 10, 2023 at 3:14 AM Christian Staudt @.***> wrote:

@vlad-ed-git https://github.com/vlad-ed-git I think it's a good start, let's refine tomorrow.

[image: Screenshot 2023-01-09 at 20 10 19] https://user-images.githubusercontent.com/875194/211388603-3c9045f3-b0b7-4070-bea6-ff0ba7621c51.png

Is it actually accessing the calendar yet?

As I said, I think it's fair to expect the user to configure the account in the settings first. Also whether it's an iCloud or Google Calendar or... whatever account (CalDAV?). The rest of the code should be generic, talk about "cloud calendar", and be named accordingly. In the Time tracking screen, it says that the option is available when a cloud account has been configured.

— Reply to this email directly, view it on GitHub https://github.com/tuttle-dev/tuttle/issues/101#issuecomment-1376152671, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGBW64X7M7P4LD7P32V2I3WRRPP3ANCNFSM6AAAAAATURI4RU . You are receiving this because you were mentioned.Message ID: @.***>

clstaudt commented 1 year ago

@vlad-ed-git There's an additional step for the cloud access we have to consider. Have a look at tuttle.cloud.login_iCloud. It usually asks for a 2FA code that is displayed on your Mac or iPhone. In the UI there needs to be a popup that requests this code.

clstaudt commented 1 year ago

There is also an UI bug when trying to access the cloud calendar:

Image

clstaudt commented 1 year ago

@vlad-ed-git I have trouble moving forward here because it seems entirely broken from the UI side: For example, when I try to upload an .ics file I get "new progress is being recorded" and then the app reloads. No error message displayed or logged. Error hiding? 👎👎👎

vlad-ed-git commented 1 year ago

*The app reloads if you run the app using flet ... -r -d, which listens to all changes in all directories. Since you just upload a file to the uploads directory , this command intepretes it as a change in the app and reloads the app. Instead run the app without those flags .

*The intent shall pass to you the path to this ics file for processing (I think I have that in place already) . Same for spreadsheet.

On Wednesday, January 11, 2023, Christian Staudt @.***> wrote:

Assigned #101 https://github.com/tuttle-dev/tuttle/issues/101 to @vlad-ed-git https://github.com/vlad-ed-git.

Reply to this email directly, view it on GitHub https://github.com/tuttle-dev/tuttle/issues/101#event-8201257757, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGBW6YUTDYK52THP3H4JDDWR2SL3ANCNFSM6AAAAAATURI4RU . You are receiving this because you were assigned.Message ID: @.***>

clstaudt commented 1 year ago

Yes I just noticed that. That's annoying, why does the reload option monitor the upload folder...

clstaudt commented 1 year ago

@vlad-ed-git

class TimeTrackingDataSource(SQLModelDataSourceMixin):
    def __init__(self):
        super().__init__()

    def process_timetracking_file(self, file_name) -> IntentResult:
        """process a recently uploaded time tracking file in .xlsx or .ics format
        returns was_intent_successful = True if processing completed successfully
        else was_intent_successful = False and err_msg are set
        """
        return IntentResult(was_intent_successful=True, data=None)

This codes hides the fact that processing the file is not yet implemented. What would be a better way to show that the intent is yet to be implemented?

clstaudt commented 1 year ago

@vlad-ed-git My tendency here is to go back to the drawing board together and trying to rewrite this screen.

vlad-ed-git commented 1 year ago

Just have process_timetracking_file return intent successful as False with an Unimplemented error message.

On Wednesday, January 11, 2023, Christian Staudt @.***> wrote:

@vlad-ed-git https://github.com/vlad-ed-git My tendency here is to go back to the drawing board together and trying to rewrite this screen.

— Reply to this email directly, view it on GitHub https://github.com/tuttle-dev/tuttle/issues/101#issuecomment-1378853384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGBW63HPFRKRX2XJ6A4T4TWR3BCBANCNFSM6AAAAAATURI4RU . You are receiving this because you were mentioned.Message ID: @.***>

vlad-ed-git commented 1 year ago

@clstaudt uploading a calendar file (.ics) now works. Please review. *Flet's data table control does not work for some reason (DataTable) cannot be imported. So I created a bare bones tabular structure instead.

vlad-ed-git commented 1 year ago

@clstaudt I found the issue with not being able to import DataTable , I was using an earlier version of flet. Upgraded and now I can call the data_frame_to_data_table method you created.

clstaudt commented 1 year ago

@vlad-ed-git great, that was a weird error because I already tested DataTable

vlad-ed-git commented 1 year ago

After upgrading, pip is telling me this:

ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tuttle 0.2.1 requires flet<0.2.0,>=0.1.65, but you have flet 0.3.2 which is incompatible.

The app works though. I can't find where this specification flet<0.2.0,>=0.1.65, is set.

On Sun, Jan 15, 2023 at 7:34 PM Christian Staudt @.***> wrote:

@vlad-ed-git https://github.com/vlad-ed-git great, that was a weird error because I already tested DataTable

— Reply to this email directly, view it on GitHub https://github.com/tuttle-dev/tuttle/issues/101#issuecomment-1383126254, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJGBW62VBGMD77GQQ77EQ4TWSPOERANCNFSM6AAAAAATURI4RU . You are receiving this because you were mentioned.Message ID: @.***>

clstaudt commented 1 year ago

Will investigate. Do you still have a pyproject.toml or poetry.lock file there? They should be gone. Did you use poetry for setup of the environment?

clstaudt commented 1 year ago

@vlad-ed-git When doing a clean install, I can't reproduce your dependency error. When in doubt clone a new copy of the repo. If you still encounter a problem create a new ticket please.

vlad-ed-git commented 1 year ago

@clstaudt clean install worked. I also needed to remove conda as it was not playing well with my homebrew's python.