-
-
Notifications
You must be signed in to change notification settings - Fork 777
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
[feature request] add a context object #634
Comments
I marked this ticket as critical since it will be necessary for big changes like plugin system and useful to refactor some parts of the source code. |
I'm working on the Context object but I'm not sure of what it should do:
|
For me, it should hold the configuration and the current state. It should also make all the calculation regarding the state, the next/previous feed/category and maybe other things. |
Maybe we can start with a simple object and use it to simplify the code in the controllers, views and DAOs. If something comes up, we can add it later. |
Ok, fine, I begins something :) |
My last commit gives an idea of how to use context object. Here is my plan:
|
- Replace $this->view->conf in controllers - Replace $this->conf in views
- Seperate normal, global and rss outputs in dedicated actions (NOT WORKING YET!) - Rewrite aside_flux and nav_menu to use Context object - Improve Context object See #634
I have pushed my work in a dedicated branch. IT'S NOT WORKING ANYMORE. There is still a lot of work to finish but I'm quite satisfied of what I have done so far :) |
I have moved a lot of code from indexController to Context object, please have a look to the source code. I have to add comments and finish to fix bugs and missing features. I hope the code is clearer now: |
- Context object raises correct Exception if get is invalid - RSS feed is well-indicated on the home page - State is better calculated - Add some comments See #634
- Seperate view mode from default state in conf - Load read articles if no unread articles only if view is adaptive See #634
I have finished the Context object and fixed some bugs, |
I just thought about something to add in the context object. We need to store the query parameters and have methods to get those values easily. That would be useful for filtering the result, counting the number of results of a query (see #546 and #611), mark as read a selection (see #608 and #609), and improve the filter options (see #610). |
Do you mean we need to store parameters such as |
That's what I meant. So 👍 |
No problem, we all have our constraints ;) I have finished my work on this branch so I merge it into |
Multiple small bugs in global and reader views. Related to these old issues: FreshRSS#634 FreshRSS#275
See #632 for the context of the discussion.
It would be nice to have a context object that handle the current state of the application and the current configuration for the user.
This way we can have a more efficient way to modify the layout and query the database.
At the moment, here is the list of the thing I can think of:
The text was updated successfully, but these errors were encountered: