Giter Club home page Giter Club logo

newspack-ios's Introduction

Newspack for iOS

A companion app to the Newspack service.

Getting started

  1. Create a local clone of the repository.
  2. cd into the workspace folder and run rake dependencies. This should configure the bundle and install any missing libraries and cocoapods.
  3. Ensure you have a local copy of our secrets repo. Lacking that, create a JSON file containing the secrets at ~/.mobile-secrets/iOS/newspack/newspack-app-credentials.json
  4. Open Newspack.xcworkspace in Xcode. You should be good to go.

If you need to update installed pods due to changes in the Podfile run bundle exec pod install to ensure the correct versio of CocoaPods is used.

newspack-ios's People

Contributors

aerych avatar ctarda avatar jkmassel avatar mindgraffiti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

newspack-ios's Issues

Folder Contents: Flag what has been synced and what has not.

Add a flag to folders and to folder assets to indicate what has been synced and what has not been synced to the remote site.

For folders, if synced there should be an associated draft.
For folder assets, if synced there should be an associated attachment to the draft.

Assets can not be synced until their story has a draft.

Auth: Menu view controller does not appear after auth on iOS 13

The new default page sheet presentation style in iOS 13 means the presenting view controller never receives view(Will/Did)Disappear events or the corresponding view(Will/Did)Appear events when the authentication flow completes. This is preventing the main menu from appearing.

Need to refactor the presentation logic related to the main screen after auth to resolve the issue.

Launcher: Implement a "launcher" to handle initial presentation decisions

When the app launches a user will see the screen defined in the LaunchScreen.storyboard and then should either see the authentication flow or the post list depending on if they are logged in.

Add some logic to intelligently make this decision and avoid instantiating a flow that is not needed. Ensure the transition from the launch screen is not wonky.

Authentication: Investigate and implement WordPressAuthenticator

Plan on using the WordPressAuthenticator pod to wrangle signing into the app. A complete implementation will depend on building out our core data model, leveraging the OS keychain, and whether we can rely on WordPress.com bearer token or require username/password for API calls. For now just stub out a simple integration and we'll iterate later.

  • Review the authenticator pod.
  • Integrate it.
  • Stub out an implementation of the self-hosted auth flow.

Folders: Designate current working folder

Add a flag to designate the current working folder.
If the folder is missing or deleted clear the flag and select another.
If there are no folders create one by default and make it the working folder.

Project: Set up localization project

We anticipate supporting Newspack in a number of languages.
Ensure that Newspack is configured for localization similar to our other apps, and the necessary scripts are in place.

Media: Clean up relationships & adopt DiffableDataSource for media lists.

The post list was updated to use a DiffableDataSource for its table view. During the course of the refactor relationships between the Post related models were simplified to rely on a UUID where it made sense.

Let's do the same for media to improve list performance and avoid some tricky core data crashes.

Editor: Investigate and implement mobile Gutenberg

We anticipate relying solely on mobile Gutenberg as the Newspack editor. Investigate the mobile Gutenberg library and integrate it. Stub a simple UI interaction to launch the editor.

  • Investigate mobile Gutenberg
  • Integrate it.
  • Add a button to launch the editor.

Folder Contents: Make folders and contents sortable

Folders should be sortable by data or by name, asc and desc.

Folder contents should be manually sortable.
New items are always appended.
Unsorted items (those shared from another app) should appear in a separate section.

PostList: Create a basic post list

Create and display a basic post list. For now, this should appear right after authentication, or be the first screen the users sees after authenticating. Create the necessary classes for the networking and service layers following our existing remote/service pattern. Create the necessary classes for the UI layer. Consider whether it makes sense to adopt a flux pattern. Ensure a basic level of offline support.

  • Investigate the appropriateness of a Flux architecture. Adopt it if it makes sense.
  • Create the relevant code for the networking layer (fetching)
  • Create the relevant code for the UI layer (viewing, listing)

Folders: Create new folders

Add ability to create new folders via the files API.
Folders should be quick to create, and have a default name that can be changed during creation.
There should be a root "stories" folder that contain newly created story folders.

Project: Configure sharing documents with other apps

For the version one release we want to allow other apps to view and edit the contents of our documents folder. This requires some configuration in the Xcode project. Configure up the necessary keys and values in the info.plist.

API: Create a layer of separation between API and Flux

To ensure that we can eventually easily port the core api calls to WordPressKit, insert a new layer to sit between the api calls and flux. The layer should be a thin wrapper around the remote services and only responsible for wrangling API call backs and calling action dispatchers.

Media: Investigate and implement MediaPicker-iOS

Anticipate that we're rely on the MediaPicker-iOS library to manage image and video selection within the editor. Investigate the library, integrate it, and stub some simple UI to present it.

  • Investigate MediaPicker-iOS
  • Integrate it
  • Wire up a button to present the media picker UI.

Folder Contents: Sync a folder and its conents

Wire up the basic ability to sync a folder and its contents. More refined implementation details will come later.

A story folder is represented by a draft. Create a new draft, upload it, save its data locally. A draft should not be synced until it has at least one piece of syncable content.
Story folder assets are represented by attachments to the draft. Unsynced attachments that are flagged to by synced, should be synced.

Data: Create the intial Newspack data model

Create the initial data model for the Newspack app. This should include a strategy for managing migrations, and storing data related to users, sites, posts, and media. Keep the implementation simple for now, but move code related to the persistent store out of the app delegate.

Questions:
What post types are supported? Do we need pages? Other types?
Are we concerned about post formats?
Do we need tags and categories?

  • Move core data related code out of the app delegate.
  • Create entities and backing code for users
  • Create entities and backing code for sites
  • Create entities and backing code for posts
  • Create entities and backing code for media

Folders: Delete a folder.

Add ability to delete a folder and it's contents. Prompt to confirm before deletion. This only deletes the local contents, nothing remote.

Post List: Fix non animating ghost cells

Ghost cells are mostly working but it looks like there might be a glitch where cells do not animate when reused.
Jorge had some thoughts. Investigate and fix.

Networking: Investigate and implement WordPressKit to handle our API layer.

Let's anticipate that WordPressKit will contain the bulk of the API calls the app will need to make. We'll need to determine the data and service layer architecture before wiring up any calls so for now just add the pod.

  • Investigate the WordPressKit pod and confirm its a viable solution for our API layer.
  • Integrate into the project.

Folders: Renaming a StoryFolder to a name that's already taken fails silently leaving the UI in a confusing state.

Well spotted by @jleandroperez when testing #74.

We could handle this a couple of ways. We might try appending a numeric after the name like when creating new stories. Regardless the UI should update appropriately, probably displaying a brief prompt to the user.

Folder renaming is something we could move out of the story folder list and into the details section of the asset list. This might be something we handle as part of the UI implementation.

Posts: Ensure posts update relevant properties on their postlistiems

PostListItems have fields that are also present on Posts. Whenever a post is saved in core data, ensure that it updates the relevant fields on the PostListItem to avoid stale data. Maybe something managed by the store... maybe something we could manage on the post if we can see its modified date is more recent than its related item's.

Posts: Encapsulate change detection into a single place

We need a single source of truth for change detection between posts, revisions, autosaves, and stagedEdits. This can potentially exist in a store but it might be nice to have it in a PostListItem since it is aware of both its post (if one is present) and its stagedEdits.

Project: Configure sharing

Ensure version one is configured to support other apps sharing text, video, images, and audio to Newspack.

Primary Issue: App Scaffolding

These are the anticipated high level tasks needed to lay the ground work for starting work on a v1.

  • #1 Authentication
  • #2 App secrets
  • #3 Basic Networking/API layer
  • #4 Basic editor integration
  • #5 Stubbed media support
  • #6 Initial data model
  • #7 Stubbed post list
  • #9 Create a post
  • #10 Edit a post
  • #11 Browse and insert media into a post

Folder Contents: Rollback direct file system interaction and implement core data proxy with reconciliation

The first pass on Folder Contents was inspecting the file system directly (just like for the story folder themselves). We want to move away from this and rely on core data as a proxy for the file system, as well as implement similar reconciliation logic that we now have for the story folder.

  • Remove references to direct file system access
  • Implement core data fetching and interaction behaviors for story assets. These will be the general ground work as the particulars will come as individual asset features are implemented.
  • Implement basic reconciliation logic. Inspect the contents of a story folder, look for anything new and create the appropriate record for it. Look for anything missing and remove it. Ignore anything that is not a known type.

App Secrets: Implement application secrets management.

Mimic the way applications secrets are managed in the WooCommerce and WordPress apps.

  • Create a new application in the WordPress developers portal so we have a client ID and secret.
  • Create in the Newspack app versions of the relevant secret wrangling code from WooCommerce/WordPress
  • Create a new secrets file in the secrets repo.
  • Add in the Newspack project a user defined setting pointing to the secrets file.
  • Update the project build phase to generate AppCredentials.
  • Push the new file to the secrets repo.

Update tooling

Update to the current versions of bundler, ruby, cocoapods etc. used by our other apps.
Investigate whether we can move directly to Swift 5 in Newspack.
Investigate whether we can switch to iOS 13 only and embrace SwiftUI for the V1.

Folder Contents: List folder contents and keep in sync with core data.

Display the contents of a folder in a list.
There should be a matching core data representation backing the contents of a folder. This will require some updates to the current folder code.

Folders and folder contents should:

  • Detect when a new folder or asset is added and create any needed data.
  • Detect when an existing folder or asset is deleted and clean up any associated data.
  • Detect when an existing folder is moved/renamed and maintain the correct data association.

Basically what's in core data should be kept in sync with what's in the file system.

Additionally:

  • Associate Folders and contents with a site. Site folders naming should be robust.

Posts: Add ability to preview a post

Need to be able to preview existing posts, and new drafts after the first autosave. Look to see how authentication is handled by WPiOS in order to preview private posts. (Also needed for private media.)

Editor: Create a new post

Add simple support for creating a new post. Open the editor from the post list. There should be a way to specify a title and some content. There should be a way to publish the post. Keep it simple.

  • Open the editor from the post list
  • Support title and content editing
  • Add relevant service/networking code to save/publish/sync the new post.
  • Add publish option to editor.
  • Update the post list to show the new post.

V0 Lingering Issue Wrap up Punch List

A punch list of things to wrap up between v0 and v1 milestones:

  • #19 Ensure the view relies on actions when initiating work in stores. Media should be fine. Double check posts.
  • #27 Fix menu view controller presentation on iOS 13
  • #22 Double check we have good test coverage for posts
  • #17 Let's just remove the ghosts for now.
  • #16 Clean up trashed posts. Oguz had thoughts about this.
  • #20 and #21 Improve change detection in posts

For later exploration when there is time:

  • #15 sync revisions with posts.
  • #23 Implement post previews.
  • Add scaffolding for syncing taxonomies like categories and tags.

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.