hplush / slowreader

Web app to combine feeds from social networks and RSS and to help read more meaningful and deep content
https://dev.slowreader.app
GNU Affero General Public License v3.0
161 stars 37 forks source link

<TwoStepPage> mobile support #186

Closed ilyatitovich closed 6 months ago

ilyatitovich commented 6 months ago

Fixes #95

Done:

test('show second side: add/url', async () => {
  setBaseTestRoute({ params: { url: 'dev.to/feed' }, route: 'add' })
  await setTimeout(100)
  strictEqual(side.get(), 'second')
})

Test gives an error: TypeError [Error]: request is not a function. I haven't figured out why yet.

In Progress:

Motivation

These changes will improve the user experience on mobile devices.

Checklist

ai commented 6 months ago

I didn’t find , maybe I understood something wrong

TwoStepsPage 😅

Package size limit has exceeded by 1.34 kB

Increase size limit with 5 KB step

Test gives an error: TypeError [Error]: request is not a function. I haven't figured out why yet.

You need to mock the request like in https://github.com/hplush/slowreader/blob/main/core/test/preview.test.ts

  1. mockRequest() in beforeEach
  2. checkAndRemoveRequestMock() in afterEach
  3. expectRequest with expected URLs in the test

We can add some simpler mock if needed.

setBaseTestRoute({ params: { url: 'dev.to/feed' }, route: 'add' }) await setTimeout(100) strictEqual(side.get(), 'second')

How user will select feed if we switch to the second step? The feed adding process:

  1. Enter URL in first step
  2. Select feed candidate in first step
  3. Only then preview feed posts and add feed in the second step

Maybe route-based logic is not enough for all two-step logic. We can export some methods from two-steps to use in preview and similar pages when steps are separated by internal state, not route.

ilyatitovich commented 6 months ago

Thanks! Now process to add feed is clearer. I'll add some function to check this steps.

ilyatitovich commented 6 months ago
ilyatitovich commented 6 months ago

Removed URL patterns from the core code and updated logic.

ilyatitovich commented 6 months ago
ilyatitovich commented 6 months ago
ai commented 6 months ago

Thanks!