Restore several of Maurice’s changes, including the new three-pane split view.

This commit is contained in:
Brent Simmons
2024-03-03 22:51:53 -08:00
parent f54fe338cd
commit 61496e138f
15 changed files with 449 additions and 418 deletions

View File

@@ -11,7 +11,7 @@ import MobileCoreServices
import Account
import UniformTypeIdentifiers
extension FeedsViewController: UITableViewDragDelegate {
extension SidebarViewController: UITableViewDragDelegate {
func tableView(_ tableView: UITableView, itemsForBeginning session: UIDragSession, at indexPath: IndexPath) -> [UIDragItem] {
guard let node = coordinator.nodeFor(indexPath), let feed = node.representedObject as? Feed else {

View File

@@ -11,7 +11,7 @@ import RSCore
import Account
import RSTree
extension FeedsViewController: UITableViewDropDelegate {
extension SidebarViewController: UITableViewDropDelegate {
func tableView(_ tableView: UITableView, canHandle session: UIDropSession) -> Bool {
return session.localDragSession != nil

View File

@@ -25,6 +25,7 @@ struct ShadowTableChanges {
var section: Int
var deletes: Set<Int>?
var inserts: Set<Int>?
var reloads: Set<Int>?
var moves: Set<ShadowTableChanges.Move>?
var isEmpty: Bool {
@@ -41,18 +42,23 @@ struct ShadowTableChanges {
return inserts.map { IndexPath(row: $0, section: section) }
}
var reloadIndexPaths: [IndexPath]? {
guard let reloads = reloads else { return nil }
return reloads.map { IndexPath(row: $0, section: section) }
}
var moveIndexPaths: [(IndexPath, IndexPath)]? {
guard let moves = moves else { return nil }
return moves.map { (IndexPath(row: $0.from, section: section), IndexPath(row: $0.to, section: section)) }
}
init(section: Int, deletes: Set<Int>?, inserts: Set<Int>?, moves: Set<Move>?) {
init(section: Int, deletes: Set<Int>?, inserts: Set<Int>?, reloads: Set<Int>?, moves: Set<Move>?) {
self.section = section
self.deletes = deletes
self.inserts = inserts
self.reloads = reloads
self.moves = moves
}
}
var deletes: Set<Int>?

View File

@@ -13,7 +13,7 @@ import RSCore
import RSTree
import SafariServices
class FeedsViewController: UITableViewController, UndoableCommandRunner {
class SidebarViewController: UITableViewController, UndoableCommandRunner {
@IBOutlet weak var filterButton: UIBarButtonItem!
private var refreshProgressView: RefreshProgressView?
@@ -628,7 +628,7 @@ class FeedsViewController: UITableViewController, UndoableCommandRunner {
// MARK: UIContextMenuInteractionDelegate
extension FeedsViewController: UIContextMenuInteractionDelegate {
extension SidebarViewController: UIContextMenuInteractionDelegate {
func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? {
guard let sectionIndex = interaction.view?.tag,
@@ -666,7 +666,7 @@ extension FeedsViewController: UIContextMenuInteractionDelegate {
// MARK: FeedTableViewSectionHeaderDelegate
extension FeedsViewController: FeedTableViewSectionHeaderDelegate {
extension SidebarViewController: FeedTableViewSectionHeaderDelegate {
func FeedTableViewSectionHeaderDisclosureDidToggle(_ sender: FeedTableViewSectionHeader) {
toggle(sender)
@@ -676,7 +676,7 @@ extension FeedsViewController: FeedTableViewSectionHeaderDelegate {
// MARK: TableViewCellDelegate
extension FeedsViewController: FeedTableViewCellDelegate {
extension SidebarViewController: FeedTableViewCellDelegate {
func feedTableViewCellDisclosureDidToggle(_ sender: FeedTableViewCell, expanding: Bool) {
if expanding {
@@ -690,7 +690,7 @@ extension FeedsViewController: FeedTableViewCellDelegate {
// MARK: Private
private extension FeedsViewController {
private extension SidebarViewController {
func configureToolbar() {
guard let refreshProgressView = Bundle.main.loadNibNamed("RefreshProgressView", owner: self, options: nil)?[0] as? RefreshProgressView else {
@@ -1230,7 +1230,7 @@ private extension FeedsViewController {
}
extension FeedsViewController: UIGestureRecognizerDelegate {
extension SidebarViewController: UIGestureRecognizerDelegate {
func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
guard let gestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer else {
return false