Skip to content

Added classification vis & settings, switched to vue-cli, massiv…#145

Merged
ErikBjare merged 34 commits intomasterfrom
dev/classify
Oct 19, 2019
Merged

Added classification vis & settings, switched to vue-cli, massiv…#145
ErikBjare merged 34 commits intomasterfrom
dev/classify

Conversation

@ErikBjare
Copy link
Copy Markdown
Member

@ErikBjare ErikBjare commented Sep 21, 2019

Todo

Now

  • Fix issue with the summary not immediately showing when using/clicking the PeriodUsage bars to navigate (path needs /summary appended)
    • An option is to go back to the old architecture (without subroutes), which should be easy now that everything is refactored out and subroutes are decoupled from $route.params.
  • Fix ErrorBoundary component (to avoid having alerts and error handlers in every component)
    • Sort of fixed. Works as long as all methods are properly async/await-
      ed.
  • Set the default classes in local storage, let user modify themselves in the settings.
  • Finalize the category settings stuff (adding/removing categories doesn't work right now, only editing)
  • When parent category is renamed also rename eventual children

After

  • Run eslint --fix on entire project in new PR that will be immediately merged. (Done in Lint it all #150)

Later (uncompleted moved to #151)

  • Add a category sunburst
  • Start using Vuex properly
  • Switch to Vue CLI 3 for easier config, better tooling, and future-proofing
  • Merge web watcher events into window events in the query? (to allow for classifying by url/domain)
  • Category Tree: If a category has children, but also activity attributed directly to the parent that does not belong to a child, then create a "Other" child containing the activity.
  • Should we have a way to filter on a specific event key? Right now the regexes are applied on every (string) data value.
  • Add a way to show how/which events are (un)categorized
  • Fix summary view to also use Vuex and all the new goodies

Depends on

How it looks (for now)

image

@johan-bjareholt
Copy link
Copy Markdown
Member

There's a lot of nice changes here, but one primary thing missing here is the ability to do make your own tags and save them.

Could we focus on taking in the underlying aw-server changes here, then take in these aw-webui changes and then disable the view by default until we have solved that? I would hate to see this PR stagnate and need huge rebases in the future.

title_events = limit_events(title_events, ${titlecount});
duration = sum_durations(events);
RETURN = {"app_events": app_events, "title_events": title_events, "app_chunks": app_chunks, "duration": duration};`;
RETURN = {"app_events": app_events, "title_events": title_events, "cat_events": cat_events, "app_chunks": app_chunks, "duration": duration};`;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As we have learned from earlier when we didn't have proper queries, sending all events to the web-ui and computing it there is not scalable for more than a days worth of data.
You should instead for example utilize the merge_events_by_keys for categories and write some new transform in the server for tags.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

But I am using merge_events_by_keys? I'm basically only sending one event per category in the cat_events.

@johan-bjareholt
Copy link
Copy Markdown
Member

  • Set the default classes in local storage, let user modify themselves in the settings.

We should not use browser storage for this, we should have an API in the server to save this.

We don't want all tags to be forgotten if we switch to a different browser.

@ErikBjare
Copy link
Copy Markdown
Member Author

We should not use browser storage for this, we should have an API in the server to save this.
We don't want all tags to be forgotten if we switch to a different browser.

Agreed, but just as with the next-day-start setting, I'm saying we could use browser storage until we have such a key/value store in aw-server for stuff like this.

@ErikBjare
Copy link
Copy Markdown
Member Author

There's a lot of nice changes here, but one primary thing missing here is the ability to do make your own tags and save them.

Could we focus on taking in the underlying aw-server changes here, then take in these aw-webui changes and then disable the view by default until we have solved that? I would hate to see this PR stagnate and need huge rebases in the future.

As I said, I think it'll be perfectly fine to use local storage until we have a way to store settings in aw-server.

I also want to refactor ActivityDaily.vue (using nested routes for the tabs) which I'll probably do in this PR. If I end up doing that I'll probably end up moving this stuff to a new tab with a "work in progress" disclaimer, which should prevent stagnation of this PR.

@johan-bjareholt
Copy link
Copy Markdown
Member

As I said, I think it'll be perfectly fine to use local storage until we have a way to store settings in aw-server.

Alright, but could we move it out to a separate view so it's clear that it's WIP? I don't want to add WIP features onto the primary view both because it gets cluttered but also because we want it to be very clear that it's WIP.

I also want to refactor ActivityDaily.vue (using nested routes for the tabs) which I'll probably do in this PR. If I end up doing that I'll probably end up moving this stuff to a new tab with a "work in progress" disclaimer, which should prevent stagnation of this PR.

I thought the plan was to refactor everything into the Summary view to then remove the daily view? Please don't waste time working on improving the daily view as that will just become duplicate work.

@ErikBjare
Copy link
Copy Markdown
Member Author

ErikBjare commented Oct 1, 2019

I thought the plan was to refactor everything into the Summary view to then remove the daily view? Please don't waste time working on improving the daily view as that will just become duplicate work.

I did not know this? What makes the Summary view such a great replacement? I really don't see it.

Anyway, before you replied I had already refactored the daily view massively, which should make it much easier to work with. (see the latest commit)

@johan-bjareholt
Copy link
Copy Markdown
Member

I did not know this? What makes the Summary view such a great replacement? I really don't see it.

Mostly because of the fact that if you implement something once you get it for free for all other time ranges.
The original plan was to slowly move more and more features from the daily view once we found performant ways to do it in both so we afterwards only needed a single view.

@johan-bjareholt
Copy link
Copy Markdown
Member

Mostly because of the fact that if you implement something once you get it for free for all other time ranges.
The original plan was to slowly move more and more features from the daily view once we found performant ways to do it in both so we afterwards only needed a single view.

Now that you have splitted out each section to its own file though that idea is probably moot as now each section is modular. Nice

@johan-bjareholt
Copy link
Copy Markdown
Member

Next time though please don't do massive linting like this in the same PR as actual code, it's really hard to read.

this.classes.push({name: "New class", re: "FILL ME"})
},
saveClasses: function() {
saveClasses(this.classes);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We should validate the regular expression before saving them. JS has built in re if i recall correctly.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The entire thing needs validation. This is probably not the final version of the UI anyway, but it works.

@ErikBjare
Copy link
Copy Markdown
Member Author

Next time though please don't do massive linting like this in the same PR as actual code, it's really hard to read.

Yeah, sorry about that.

Mostly because of the fact that if you implement something once you get it for free for all other time ranges.
The original plan was to slowly move more and more features from the daily view once we found performant ways to do it in both so we afterwards only needed a single view.

Now that you have splitted out each section to its own file though that idea is probably moot as now each section is modular. Nice

It will be even nicer when I get the whole thing into vuex and refactor the query builder.

… vuex, added support for typescript, added tests with jest, and more I probably forgot about
@ErikBjare
Copy link
Copy Markdown
Member Author

@johan-bjareholt It would be nice to have another review. The only thing missing is the ability to edit the categories/rules.

queryOptions: {
aw_client: this.$aw,
date: moment().format('YYYY-MM-DD'),
host: 'erb-laptop2-arch',
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you want this to go into master you should at least stop hardcoding this.
Just adding a text field or something as an input though should be good enough as i assume it's made to be a rough tool rather than for user debugging.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah right, I forgot. Will do.

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 14, 2019

This pull request introduces 1 alert and fixes 1 when merging 663f61c into c29c1cc - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 14, 2019

This pull request introduces 1 alert and fixes 1 when merging a60ed2b into c29c1cc - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 14, 2019

This pull request introduces 1 alert and fixes 1 when merging 3a5a5c6 into c29c1cc - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 18, 2019

This pull request introduces 1 alert and fixes 1 when merging 2b8bcbd into c51e5f4 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@ErikBjare
Copy link
Copy Markdown
Member Author

I got a sunburst working!

image

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 18, 2019

This pull request introduces 1 alert and fixes 1 when merging 53b5792 into c51e5f4 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 19, 2019

This pull request introduces 1 alert and fixes 1 when merging 3ac9190 into c51e5f4 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable

@ErikBjare ErikBjare changed the title Added basic classification visualizations Added classification visualizations & settings, switched to vue-cli, massive refactoring, etc. Oct 19, 2019
@ErikBjare ErikBjare changed the title Added classification visualizations & settings, switched to vue-cli, massive refactoring, etc. Added classification visualizations & settings, switched to vue-cli, massive refactoring (vuex), etc. Oct 19, 2019
@ErikBjare ErikBjare changed the title Added classification visualizations & settings, switched to vue-cli, massive refactoring (vuex), etc. Added classification vis & settings, switched to vue-cli, massive refactoring (vuex), etc. Oct 19, 2019
@lgtm-com
Copy link
Copy Markdown
Contributor

lgtm-com bot commented Oct 19, 2019

This pull request introduces 1 alert and fixes 2 when merging c0a66d4 into c51e5f4 - view on LGTM.com

new alerts:

  • 1 for Useless assignment to local variable

fixed alerts:

  • 1 for Useless assignment to local variable
  • 1 for Unused variable, import, function or class

@ErikBjare ErikBjare changed the title Added classification vis & settings, switched to vue-cli, massive refactoring (vuex), etc. Added classification vis & settings, switched to vue-cli, massiv… Oct 19, 2019
@ErikBjare ErikBjare merged commit 8196f9b into master Oct 19, 2019
@ErikBjare ErikBjare deleted the dev/classify branch October 19, 2019 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants