Git Product home page Git Product logo

cotton's People

Contributors

kyzmitch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

cotton's Issues

iPhone layout errors on iOS 13

checked on iPhone 8 simulator and iPhone x , xs with iOS 12.x and no any constraint errors in logs. Only on iOS 13.

Probably something bad with SnapKit, will try to remove this dependency and actually it's not under support since 2019, only some fresh Issues on github, but without pull requests.

[todo] HttpKit add subscribe/receive on thread/scheduler for Rx/Combine APIs

In HttpClient+RxSwift.swift and in HttpClient+Combine.swift
the makeRequest or makeRxRequest are happening on the same calling thread. Sometimes it is a UI thread, and sometimes it is a Search thread created on view layer.

It would be good to use some separate DispatchQueue defined in specific HttpClient instance.

But it is not critical, because actually the main network code is executed on a Thread created by a 3rd party Networking framework (Alamofire).

[bug] web view navigation stopped workin in UIKit mode

back and forward buttons are not active in Phone layout if UIKit mode is selected (with Async await concurrency mode) and user selects internal web site link and then some other link which should go to the different web site, but both times back button is gray and not active.

[todo] Use ServiceLocator DI to store use cases for the view models

Some existing classes has a lot of dependencies e.g. BrowserContentView, need to leverage service locator pattern or implement DI.
In the new PR #72 which is not finished yet I had to create service locator to access the use cases, but need to improve it even more.

Make sure to use ServiceLocator only inside UseCaseFactory or other factories.

Fix CLI build on Ventura 13.6 and Xcode 15.0

Tried to build make build-ios-dev-release on fresh macOS installation with Xcode 15 using make command, but it failed with following errors:

output:
-macosx_version_min has been renamed to -macos_version_min
ld: unknown options: -sdk_version

> Task :linkReleaseFrameworkMacosX64 FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':linkReleaseFrameworkMacosX64'.

/bin/bash: swiftlint: command not found

[bug] Layout errors while logging in on Facebook site

preconditions:

  • clear installation to remove cookies to trigger instagram login procedure.
  • enter instagram.com
  • press Sign in using facebook.
  1. enter email
  2. press Tab to switch to password text field on Facebook sign in web page

Probably something connected with keyboard based layout changes

[todo] Fix SwiftLint workflow step

Currently it could be triggered by pull request, but for some reason it can't find swift files to check:

Run norio-nomura/[email protected]
  env:
    DIFF_BASE: master
...
"/home/runner/work/Cotton/Cotton":"/github/workspace" 5bedb4:05ddb88e99204900a5dd037a6155f6a8
fatal: detected dubious ownership in repository at '/github/workspace'
To add an exception for this directory, call:

	git config --global --add safe.directory /github/workspace
error: Could not access 'FETCH_HEAD'
No Swift file changed

[bug] SmartphoneSearchBarViewController changeState is getting called extra time

Even if selected tab content is the same and tabs observer filter out possible duplicates to not notify about the same data, turns out that it is still possible to be notified with the same object more than once.

SmartphoneSearchBarViewController is a subscriber of TabsObserver tabDidSelect and it updates the view state accordingly, but AppCoordinator is also needs to be subscribed to do some different handling for different views and the issue is that it also asks SmartphoneSearchBarViewController again to update the view state.

[todo] TabsViewController finish scroll implementation

// pixels could be negative to scroll to the left

When new tab is added (usually at the end of the list - right side) user could have tab selected in the beginning of the list and there are a lot of other tabs, so, we're scrolling tab views to show the last one which was added/selected automatically. This works, but it seems need to finish some corner cases.

[bug] Only Xcode 13 crash - on tab creating [WebViewController]()

Xcode 13.0 beta ?

final class WebViewsReuseManager {
private init(_ viewsLimit: Int = 10) {
        assert(viewsLimit >= 1, "Not possible view limit")
        views = [WebViewController]() <----

env:
iPhone simulator 12.4 iphone xs, master branch (not! feature/visual_state_tab_property_refactor)
steps:

  1. open website which should create a tab

Works fine on Xcode 12.5 with same iphone xs

#10	0x000000010f7060eb in WebViewsReuseManager.init(_:) at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:29
#11	0x000000010f705f84 in WebViewsReuseManager.__allocating_init(_:) ()
#12	0x000000010f705f30 in one-time initialization function for shared at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:16
#13	0x00000001155cadb5 in _dispatch_client_callout ()
#14	0x00000001155cc83c in _dispatch_once_callout ()
#15	0x0000000113b1a579 in swift_once ()
#16	0x000000010f705fc1 in WebViewsReuseManager.shared.unsafeMutableAddressor at /Users/aermoshin/prj/catowser/catowser/catowser/WebSite/WebViewsReuseManager.swift:16
#17	0x000000010f73d2f1 in MasterBrowserViewController.openSiteTabContent(with:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:387
#18	0x000000010f73cffa in MasterBrowserViewController.open(tabContent:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:369
#19	0x000000010f73fe8c in MasterBrowserViewController.didSelect(index:content:) at /Users/aermoshin/prj/catowser/catowser/catowser/Browser/MasterBrowserViewController.swift:519

[todo] Use Swift actors

[bug] Blank tab loads content from previous tab with website

When tab content - web site loading takes too long, e.g. youtube video, and after switching to blank tab with top sites. It is still shows web site loading progress bar (not finished like 80%) and after some time it loads web view to this blank tab which is completely unexpected, because top sites view still should stay.

[todo] web search auto complete using Concurrency API

Concurrency API worked for web search autocomplete, but now with View Model it needs to be revisited.

probably on view model impl level it should look like:

@Published var aaState: SearchSuggestionsViewState = .waitingForQuery

The only issue is it is better to use something similar to @Published property wrapper from SwiftUI. It is because actually SwiftUI is not needed here because old UIKit views are used currently. And another thing is that property wrappers can't be used in Swift protocols and swift protocol for ViewModel is used.

Use UUID in ResponseHandlingApi type instead of custom hash function

To be able to store these instances in the hash table or other hash based collection need need to have such a function, but it could be improved most likely.

public func hash(into hasher: inout Hasher) {
        /// TODO:  could use UUID for each `ResponseHandlingApi` to simplify this
        let caseNumber: Int
        switch self {
        case .closure(let closureWrapper):
            caseNumber = 0
            hasher.combine(closureWrapper)
        case .rxObserver(let observerWrapper):
            caseNumber = 1
            hasher.combine(observerWrapper)
        case .waitsForRxObserver:
            caseNumber = 2
        case .waitsForCombinePromise:
            caseNumber = 3
        case .combine(let promiseWrapper):
            caseNumber = 4
            hasher.combine(promiseWrapper)
        case .asyncAwaitConcurrency:
            caseNumber = 5
        }
        hasher.combine(caseNumber)
    }

[bug] Video file download fails after moving app to background

It seems I can't fix it without using background tasks, Alamofire doesn't implement them

Alamofire/Alamofire#2674

https://forums.developer.apple.com/thread/85066

download error: network error: Error Domain=NSPOSIXErrorDomain Code=53 "Software caused connection abort" UserInfo={_NSURLErrorFailingURLSessionTaskErrorKey=LocalDownloadTask <A429C574-5C04-47FA-B065-A9282A2D22BF>.<1>, _kCFStreamErrorDomainKey=1, NSErrorPeerAddressKey=<CFData 0x2838c9360 [0x1d8b51420]>{length = 16, capacity = 16, bytes = 0x100201bb804beb2c0000000000000000}, _kCFStreamErrorCodeKey=53, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDownloadTask <A429C574-5C04-47FA-B065-A9282A2D22BF>.<1>" )}

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.