-
Notifications
You must be signed in to change notification settings - Fork 344
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
Make selfoss navigable #869
Conversation
This pages modifies the client ui to make heavy use of location.hash: hash changes are now responsible for loading the entry list. Another big change is that the server side template is basically empty of any data. It is loaded via the same client side code responsible for updating item lists, tags, stats, etc.
The problem is explained there : http://stackoverflow.com/questions/1703552/encoding-of-window-location-hash As a summary, the hash exposed in JS in Firefox is already URL-encoded, which is not the case in Chrome for instance.
- slightly better performance - easier to read than extra explicitely requested entries for fixing fossar#774
Hash is processed asynchroneously, which would cause ajax requests to be sent with an opened entry on slow devices. This change ensures the hash is processed in that case.
It happened at least: - selecting a tag containing % then changing the filter - selecting a tag containing % then openning an item
SQLite does not support booleans as PostgreSQL does, nor has aliases for `0` and `1` like MySQL.
Another problem:
Selfoss will change URL to http://localhost/selfoss/#sources/all Which reminds me that there is no unknown route handling – if I go to http://localhost/selfoss/#newest/source-99999, it will just show empty listing. Though the API is partly to blame because it does not return an error on invalid source filter. |
Okay, this fixes clicking on settings and then filters. Settings followed by tag or source are still broken. |
Much better. Also, when clicking settings and then filter, no tag or source will be selected. |
Looks good so far. Could you also handle non-existent sources and tags and invalid links? |
I am now testing it on my live server and noticed another detail:
The “All tags” filter will not be highlighted in the sidebar. Tags or sources do not suffer from this. The navigation works, the issue is purely visual. |
Also it seems like SQLite does not support tuple comparisons. You will need to expand it as follows: (items.datetime $ltgt :offset_from_datetime OR (items.datetime = :offset_from_datetime AND items.id $ltgt :offset_from_id)) |
Nice. Is it intentional that the URL is only changed when an item is clicked, not when keyboard shortcut is used? |
Neat, though you still cannot navigate back/forward for these. |
Additionally, is the extra_ids thing still working? When I open an item, for example, on the second page, then scroll up and reload, it is not visible on the first page. Nevertheless, the item comes up as a first item on every page after its own page. |
Are not now both item id in the URL and the |
Thanks, now only remove the
|
For me, as said, the whole point of putting the item id in the url is that it makes it possible to reload the item that was open before a browser crash or when the tab containing selfoss was offloaded from memory. Without this, the problem was that the item was lost in read items and that it was a lot of searching to find it back, for instance to star it or to finish reading. |
The problem is that |
In other cases, because the items are sorted by |
daos/mysql/Items.php
Outdated
WHERE items.source=sources.id '.$where.' | ||
ORDER BY items.datetime '.$order.' | ||
WHERE items.source=sources.id AND '.$where_sql.' | ||
ORDER BY items.datetime '.$order.' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually they are only ordered by datetime
, this should be also ordered by id
for seek pagination to work properly.
You're right, I'll see if I can fix that using only one query. |
daos/mysql/Items.php
Outdated
items.id, datetime, items.title AS title, content, unread, starred, source, thumbnail, icon, uid, link, updatetime, author, sources.title as sourcetitle, sources.tags as tags | ||
FROM '.\F3::get('db_prefix').'items AS items, '.\F3::get('db_prefix').'sources AS sources | ||
WHERE items.source=sources.id AND'; | ||
$order = 'ORDER BY items.datetime,items.id '.$order; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be 'ORDER BY items.datetime ' . $order . ', items.id ' . $order
Otherwise, it just returns the first page over again, when you use oldest first.
If I open page at other than default filter (e.g. https://localhost/selfoss/#starred/all), |
This looks good, if you are okay with that, I will rebase it and merge. |
Many thanks for your testing. |
These patches make selfoss navigable using the url hash. This makes the url reflect whats displayed in selfoss. This also makes it possible to reload the item that was open before a browser crash or when the tab containing selfoss was offloaded from memory on a mobile browser.
This is #834 rebased and with two additional fixes.