Pagination of securities #268
No reviewers
Labels
No labels
bug
conflicts
documentation
DO NOT MERGE
duplicate
enhancement
good first issue
hardware
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
greg/info-orbs!268
Loading…
Reference in a new issue
No description provided.
Delete branch "stock_mulit_page"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Allow more than 5 securities via pagination.
Changes
@ -142,0 +146,4 @@StockDataModel &StockDataModel::setInitializationStatus(bool initialized) {m_initialized = initialized;return *this;Return value not needed/used. Yes, the other setters do the same (to permit chaining), but chaining is never used in this codebase from what I can see...
imho should be:
m_page = (m_page + 1) % m_pageCount;config.h.templatestill says "Choose 5 securities..."When running this code with default config.h
the output said:
But the actual HTTP requests looked OK
Looks like some corruption / off-by-one? Digging
Clicking through to the stocks tag showed the same corruption:
By comparison:
vs
Looks like the latter is missing a
c_str()Q: when the widget switches pages, can we just updated the orbs one-by-one, rather than clearing them all to black, and having them reappear over a second or so?
Edit: the (minor) problem with just removing the
.clearAllScreens()call is when the "loading..." text is shown. The realdisplayStock()call includes its ownclearScreen()@ -157,6 +173,14 @@ void StockWidget::displayStock(int8_t displayIndex, StockDataModel &stock, uint3m_manager.drawString(stock.getCurrencySymbol() + stock.getCurrentPrice(2), centre, 155, bigFontSize, Align::MiddleCenter);Too much noise
@ -8,24 +8,28 @@StockWidget::StockWidget(ScreenManager &manager, ConfigManager &config) : Widget(manager, config) {Too much noise
LGTM (feel free to revert my changes if you want)
@ -142,0 +146,4 @@StockDataModel &StockDataModel::setInitializationStatus(bool initialized) {m_initialized = initialized;return *this;Yep, was just trying to follow the pattern
Thanks for going through it in so much detail. Really appreciate it and love all the tweaks
Thanks for the PR. Merged
Found a big where the screen flashes/refreshes even if <= 5 stocks. That should not happen.
Sorry - too many issues, going to need to revert this PR. Keep your branch open.
https://github.com/brettdottech/info-orbs/issues/290
https://github.com/brettdottech/info-orbs/issues/291 (two issues)
I see you fixed the issue I introduced with pagination causing flashing when there are 5 or less securities specified, but do you still want to revert this pr?