Git Product home page Git Product logo

gyroid's Introduction

Metrics

gyroid's People

Contributors

coteh avatar renovate[bot] avatar

Watchers

 avatar  avatar

gyroid's Issues

Customize ordering of article list

Retrieve endpoint allows you to retrieve articles in the following sorted orders: newest, oldest, title, and site. Add support for all of these orderings plus an additional random ordering as well.

A preferences JSON/YML file can be used for the user to specify which sorting they want to use.

Can also add an ordering preference to sort by expected read time if #3 is done.

Investigate user.Current() support on macOS (Darwin)

Last time I checked, I did not appear to have any issue with creating and retrieving config file using os/user despite what I'm reading online about os/user not working on Darwin systems due to cgo. Investigate this, and consider changing the utility function for getting home directory if it does work on Darwin (and Windows and Linux).

Alternative would be to use https://github.com/mitchellh/go-homedir

Handle edge cases of Pocket API

One I can think of off the top of my head that I've encountered:

  • If Retrieve returns a status of 2, then it appears to indicate that I have gone past the last article (ie. I set an offset greater than total number of articles)

Create new issues for some of these types of edge cases if necessary. If this project is switching to go-pocket (#7), then we might not need to do anything if that library already handles such cases.

TODO

  • Find edge cases of Pocket API to consider
    • For each one, either make a new issue or fix it here
  • Figure out if go-pocket is being adopted (#7)

Additional tag features

This issue can be used for considering which additional tag capabilities from the Pocket API to incorporate into this app. (remove tags, replace tags, clear tags, rename tags, delete tags)

New issues can be created for each one if necessary.

Refine new article on the spot

Upon adding a new article, ask user if they would like to refine the article on the spot. If yes, then fetch article information from Pocket API and give user the options. Otherwise, it'll just be added like normal (go back to the user's list). This can also be configured within preferences.

Get a total count of posts

Ensure that the async calls we make to Pocket API can correctly return all articles from a user's Pocket list as well as report the total count of articles. Since it's async (ie. in goroutines) we don't have to get this data right away before displaying the first article to the user.

TODO

  • Indicate to cli somehow that all articles have finished loading
  • Once cli is indicated all articles are done loading, get the length of the articles array (this will be the number of untagged, or unrefined articles)
  • Print this somehow???
    • Should probably be on top or on bottom of article printout
    • What should print when we're still waiting for all articles to load?
  • When user adds article, increment the number of unrefined articles by 1

Copy article link to clipboard

I would like to be able to easily copy a link in the refinement list to the clipboard, as sometimes I would like to take an article off of my Pocket list and into another tool (Todoist, Trello, etc.) right away.

TODO

  • Add new CLI option to copy article link
  • Extend Clipboard class to copy given string
  • When CLI option is activated, pass article link into new Clipboard method

Configuration of definition of "refined"

Currently, all untagged articles - the "unrefined" articles - will be loaded on startup. This suits my personal needs, as articles with one or more tags assigned usually means that I have gave some thought as to whether I want to read the article or not.

However, I am considering whether this can be made configurable. Perhaps a refined article to someone else can mean one or more tags and then an additional tag that says "refined"? Maybe something else entirely?

Allow user to enable/disable clipboard support

Putting this in a separate issue because it can involve creating a preferences JSON/YML that can contain this setting and settings mentioned in other issues.

  • Toggle clipboard usage in main by boolean variable
  • Boolean variable is configured from preferences JSON/YML or from environment variable
  • Have it disabled by default?

When user adds article and does not refine on the spot, append to articles list

Title self-explanatory. If they choose not to refine, add it to back of list. If so, keep previous behaviour of putting it in front.

TODO

  • Append article to end of articles list if user adds article and decides not to refine (or has refine-new set to no in config)
  • Test for no race conditions with initial article load

Prompt user to add article when end of article list reached

Definitely a UI oversight on my end ๐Ÿ˜… When the user reaches the end of their list (or their list is empty), give them a prompt for whether they would like to add an article.

TODO

  • Add prompt asking user to add article
    • If yes, open up add article prompt
    • If no, exit cli
  • When user reaches end of list, prompt
  • When user has no articles, prompt
  • Have this configurable in config.yml: end-of-list-add (true or false)
  • Complete testing
  • Add a pointer to start of articlesList for article loop, or block this task on article queue

Create mock Pocket API server for development

Thought I made an issue for this already, but guess I didn't. ๐Ÿ˜…

TODO

  • Create mock server that mimics get, modify, add, and auth endpoints
  • Populate server with fake article data
  • Set API URL of dev gyroid to mock server address
    • Will need to move out API URL to be a config value (either in .env or config.yml)

Improve mock usage in Pocket actions tests

Found out with testify that you can pass return values into a Call expectation object and have the mocked method return those arguments, received from the Called() method.

  • Use single mock for all Pocket actions tests (if possible)
  • Pass return values into their expectation call instead
  • Add expectation calls for tests that originally did not have them (ie. ones that has FailingPocketClientMock)

Shifting problem when article is added before articles load from goroutine

Reproduction Steps

  1. Set load timeout to something relatively high like 10 seconds, as long as it would take to add an article in time (for step 4)
  2. Have 2 articles in your Pocket account before performing this (can possibly be reproduced with just one article as well - have not had the time to check)
  3. Start gyroid
  4. Add an article
  5. Wait 10 seconds
  6. Hit N for next article
  7. The next article will be a duplicate of the previous, presumably this is because the newly added article pushed the other articles down the list, and the goroutine was originally coded with the assumption that nothing would be added while articles are loading

Possible Fixes

When #4 is done, it will be a lot easier to load articles and check that we have them in the loaded list of articles already.

In the meantime, this particular problem can be fixed by incrementing the offset passed into GetUntaggedArticles by 1 whenever an article is added, but this is assuming that:

  • Newly added articles will be added to the very top of the list every time
  • Nothing else can cause an article to be added (e.g. adding an article via your browser or mobile phone)

This can be refined when a better solution can be determined.

Quick Tag feature

I would like to be able to have a small list of quickly accessible shortcuts to assign one or more "quick" tags to an article. (I am currently envisioning this as mapped to characters 0-9)

I can determine the quick tags to be available for me using a config JSON/YML file.

I can type one or more of the characters within the article prompt to assign these tags instantly to the article.

Add option to delete one or more tags

I would like to be able to have the option to quickly delete one or more tags that I'm no longer interested in, in order to keep the number of tags for articles in my Pocket list down to a minimum (allowing for quicker access to tags that I am interested in from the tags list).

Remove clipboard suggestion once it's added

Clipboard suggestion should no longer be suggested once it's added, unless a new URL is copied into the clipboard.

TODO

  • Save clipboard item to clipboard manager (or somewhere else)
  • Add flag to clipboard manager to indicate that user used clipboard suggestion
  • If user adds from clipboard, set flag to true
  • If URL from clipboard is different from saved value, then replace the saved value with new clipboard URL and set flag to false

Cache articles locally

For this command line app, since ideally it'd just be a single user looking at their Pocket list, we can cache the list of articles obtained. We would also cache the timestamp returned from the Retrieve endpoint indicating the most recent item obtained. Then when user reloads the app, we load all articles since this timestamp and then cache the new results alongside the previous results, so on so forth. If a new session is obtained, then delete the cache unless it's the same user being authenticated as before.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

circleci
.circleci/config.yml
  • codecov 1.0.5
  • circleci/golang 1.17.5
gomod
go.mod
  • go 1.14
  • github.com/atotto/clipboard v0.1.4
  • github.com/stretchr/testify v1.8.1
  • gopkg.in/yaml.v2 v2.4.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.