[openstreetmap-website] OWL Activity Tab (#876)

PaweĊ‚ Paprota notifications at github.com
Mon Jan 19 21:12:13 UTC 2015


OK, so this has been brewing for over 2 years (!) now... so I thought I'd make a pull request and get some sanity/reality checks on this code and features themselves.

In this branch you will find what I named a "activity tab". This has been briefly demo'ed to people last year (or was it 2013...?), hopefully OWL API will be back soon so it can all come together again.

Currently this new tab displays many different things:

1. __List of changesets__ - this is done in a completely different way than with the history tab and the list always shows changesets which actually have any changes in the current view.

2. __List of changes__ - there is no such thing as "change" in OSM API but in OWL this is a basic unit of information. A change is more or less synonymous with node/way version but in addition to object versions, changes also capture more subtle alterations like moving one node of a way - this is only recorded in the OSM API as a node version but in OWL you will see the actual change caused by moving the node.

3. __Details of changes__ - it shows what exactly has changed (which tags, previous geometry) and also uses icons from the map key to visually identify change - so if you add/remove/move/whatever a coffee shop then you will get a proper icon in the activity tab.

4. __Geometry of changes__ - OWL API provides vector tiles which are rendered using Leaflet GeoJSON tile layer. The user can interact with the geometry - if you click something which is highlighted on the map, you will get more information about it in the sidebar - basically the sidebar will scroll through to the position so that it shows the details of a change that you clicked on the map.

You can see an example of all this on the screenshot below.
![owl](https://cloud.githubusercontent.com/assets/469990/5807677/ddbce6a0-a025-11e4-9c1c-6e6651985b20.png)

It's not pretty, I know. It's also not very intuitive to use. It's more of a showcase for the capabilities of the OWL API - to show what information the API provides. There are many ideas how to better use the API, I've also had some feature requests (for example, ppawel/openstreetmap-website#26), I think some of them definitely make sense - like inspecting a single changeset. That would probably need to be a separate "mode" from the activity tab.

Anyway, if anything, it would be good to accomplish two things with this pull request:

1. Get your feedback / suggestions on the __usability, design, features__ and all that. I have many more ideas where to take this - I'd love to integrate the changeset commenting feature - this would give us a lovely social network-style interactive activity stream. But on the other hand, it all needs some UX love, otherwise it will probably end up as some kind of monster crammed with every feature under the sun.

2. Get this stuff __code reviewed__ or at least get some of my assumptions validated. I mean things like new dependencies introduced - client-side templates (EJS), jQuery timeago plugin. Note that the code is pretty much WIP but of course all suggestions are welcome.

Looking forward to your comments.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/876

-- Commit Summary --

  * Started work on OWL integration.
  * More work on the history tab. Now uses tilerange API.
  * Use openstreetmap.org instead of osm.org.
  * Just some UI tweaks.
  * Implemented simple paging.
  * Sorting changesets.
  * Highlighting changesets.
  * Layout tweaks, displaying comments.
  * CSS tweaks, handle empty comments better.
  * Fixed JS error when highlighting changesets.
  * Properly manage changeset bboxes (there can be more than one now).
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Merge branch 'master' into owl-history-tab
  * Compatibility with the new OWL API.
  * Work on the history sidebar UI.
  * Work on the history sidebar UI.
  * Merge branch 'owl-history-tab' of github.com:ppawel/openstreetmap-website into owl-history-tab
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Showing change details.
  * Refactored the OWL-related JS code to make it more readable and maintainable.
  * Extracted styles and misc stuff to config.js.
  * Cleanup, improved change popup.
  * Updated the OWL API URL to include API version.
  * Work on the change popup UI.
  * Align the timestamp.
  * Highlighting the history tab when selected.
  * Translated history sidebar title.
  * Cleanup.
  * Tweaked displaying icons.
  * Added "beta".
  * Support zoom levels lower than 16 properly.
  * Loading indicator.
  * Don't refresh when it's not needed.
  * Added sidebar footer.
  * Updating the RSS link.
  * Fixes to the footer.
  * Fixed "next page".
  * Small CSS tweaks.
  * Small adjustments.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Ignore response that is not applicable to the current viewport.
  * Added username to the popup.
  * Some tweaks.
  * Organized JS templates better; proper close sidebar handling.
  * Added jQuery timeago plugin for nicer dates.
  * Tweaks to geometry styling, now it can be done per action.
  * Showing previous geometry in the UI.
  * More info in the popup.
  * Display only the latest version of every element.
  * Removed debug logging.
  * Do a second pass when adding changes to properly order them.
  * Style for "affected" ways.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Adjusted popup UI.
  * #2 Fix links to objects
  * Styling tweaks.
  * Closes #2 Fixed links to ways/nodes
  * Display latest changes above older ones.
  * Adjusted colors.
  * Added link to report issues.
  * Don't forget affected ways.
  * Added onChangeClicked event and refactored related code so it's easier to change the UI.
  * #5 Removed change popup, now change details are displayed on the sidebar.
  * #5 More work on sidebar.
  * #5 More compact sidebar layout.
  * Fixed a bug where tags from affected ways were shown as new tags.
  * Hide tag table when unhighlighting change.
  * Slight styling change.
  * Fixed clicking on changeset in the list, extracted some utility functions to a separate file.
  * Added minZoomLevel.
  * Clicking on changes now shows change tags.
  * Added user friendly descriptions of changes.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * #13 Icons in the summary are no longer links - confusing for navigation!
  * Forced   - Firefox is not able to overflow spans without it (Chromium is fine).
  * Enable changeset highlighting again.
  * #15 Changeset/item and geometry highlighting in both directions
  * Implemented highlighting the other way. Closes #15.
  * #15 Fixed a couple of highlighting bugs.
  * #15 Fixed even more interaction bugs.
  * Small style changes.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Use a "More results" button instead of a >> link. Closes #9.
  * Display tags as a list, not a table with background color on rows. Hopefully this is more readable.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Display element id, not change id.
  * #3 Better handling of tag symbols.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Added tag symbol class for building=yes according to required convention.
  * #10 Avoid having 10 lines of building icons as changeset description.
  * #10 Take prev_tags into account when generating tag symbols.
  * Fixed JS error.
  * Simplified some code.
  * Fixed "show previous geometry" feature when prev_geom was null.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Removed minzoom for the History tab - hate this modal alert box! Also, the sidebar informs the user that they have to zoom in.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Render changes only after they are shown.
  * #9 Implemented infinite scroll for the changeset list.
  * More tag symbols (because I like them).
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * There's no geom_changed anymore.
  * Typo.
  * Fixed a bug in displaying geom/prev_geom.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Display user avatars to make the changeset list more "social".
  * Merge branch 'owl-history-tab' into vector-tiles
  * Icons for actions.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * There's no geom_changed anymore.
  * New feature styling mechanism that handles (multi)polygons better.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Added status information to the page.
  * Merge branch 'vector-tiles' into owl-history-tab
  * Fixed a bug with highlighting features, adjusted colors.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Updated status.
  * Properly display deleted geometry.
  * Some users returned by the API don't have the avatar link for some reason...
  * Display only the latest change for each element.
  * Disabled the link to changeset to make interaction more intuitive.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab
  * Added jquery scrollIntoView plugin again.
  * Fixed a regression with symbols not showing up (CSS class names have changed).
  * Fixed symbols in Firefox (::before is :before there).
  * Fixed loading more changesets, displaying symbols.
  * Tweaks to the changeset list UX (still sucks, but small steps, right?).
  * Moved RSS icon to the sidebar header. Closes #20.
  * Open links to objects in new window.
  * Updates for the new API.
  * More work with new API.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * More changes for new API.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * Updates for new API.
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * Merge branch 'master' of git://github.com/openstreetmap/openstreetmap-website into owl-history-tab-new
  * Merge remote-tracking branch 'origin/master' into owl-history-tab-new
  * Added temporary workaround for performance problems in the OWL layer.

-- File Changes --

    M Gemfile (3)
    M Gemfile.lock (2)
    A app/assets/images/info.png (0)
    A app/assets/images/undo.png (0)
    M app/assets/javascripts/application.js (10)
    M app/assets/javascripts/index.js (27)
    A app/assets/javascripts/index/owl.js (232)
    M app/assets/javascripts/osm.js.erb (3)
    A app/assets/javascripts/owl/TileLayer.GeoJSON.js (257)
    A app/assets/javascripts/owl/config.js (71)
    A app/assets/javascripts/owl/layer.js (319)
    A app/assets/javascripts/owl/owl.js.erb (222)
    A app/assets/javascripts/owl/utils.js (166)
    A app/assets/javascripts/templates/owl/changes.jst.ejs (35)
    A app/assets/javascripts/templates/owl/changeset_list.jst.ejs (40)
    A app/assets/javascripts/templates/owl/sidebar_layout.jst.ejs (11)
    M app/assets/stylesheets/common.css.scss (185)
    A app/controllers/activity_controller.rb (8)
    A app/views/activity/display.html.erb (13)
    A app/views/browse/activity.html.erb (14)
    M app/views/layouts/_header.html.erb (3)
    M app/views/site/index.html.erb (7)
    M config/example.application.yml (4)
    M config/i18n-js.yml (2)
    M config/locales/en.yml (1)
    M config/routes.rb (1)
    A vendor/assets/jquery/jquery.scrollIntoView.js (137)
    A vendor/assets/jquery/jquery.timeago.js (153)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/876.patch
https://github.com/openstreetmap/openstreetmap-website/pull/876.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/876
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20150119/94484d82/attachment-0001.html>


More information about the rails-dev mailing list