Skip to content

feat(flare): open recent list - #757

Merged
github-actions[bot] merged 1 commit into
devfrom
lead/mac-platform-mp1
Oct 14, 2026
Merged

github-actions[bot] merged 1 commit into
devfrom
lead/mac-platform-mp1

Conversation

@prakashUXtech

@prakashUXtech prakashUXtech commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

What

MP-1 of the mac-platform packet (docs/blueprints/flare/features/mac-platform.md). This adds the Open Recent list to FlareWorkspace as an extension in Sources/FlareModel/FlareFiles.swift:

  • public static let recentLimit = 10
  • public mutating func noteRecent(_ path: String) moves or inserts the path at the front. Entries are deduplicated by exact path, and the list keeps at most recentLimit of them. This follows the packet's pseudocode.
  • public mutating func clearRecent() empties the list.

FlareWorkspace.swift is unchanged because its recent property already exists. The flare-model-sources description in docs/c4/model.json now mentions the Open Recent list.

Why

The app calls noteRecent with a file's path after each successful open or save. File > Open Recent (J26, F17a) reads this list. The entries are paths, not display names, so two files with the same name in different folders stay as two separate entries.

Part of #739

Proof

Tests/FlareModelTests/FlareRecentTests.swift (Swift Testing) checks that:

  • noting A, then B, then A gives [A, B]
  • after 11 distinct paths the list holds 10, and the oldest is gone
  • /x/a.flare and /y/a.flare stay two entries
  • clearRecent empties the list
  • newDocument() leaves the list as it was

No snapshot changes, because this is Model-only.

The only APIs used are from the Swift standard library (Array.filter, Array.prefix(_:)). I checked prefix(_:) with the apple-docs MCP (searchAppleDocumentation). No SwiftUI, AppKit or Foundation API is used.

Belt-Lead: act-1a13b14336c-tqna
Feature: mac-platform
Fast-Check: pass
Head: 0770f49


@prakashUXtech prakashUXtech added the fast-lane Merge automatically when small, green and outside protected paths label Oct 14, 2026 — with Claude
@github-actions
github-actions Bot merged commit 956d946 into dev Oct 14, 2026
1 check passed
@github-actions github-actions Bot added the fast-lane-merged Merged by the fast lane; review after the fact label Oct 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Fast lane: merged into dev (74 lines, 3 files, Fast-Check marker).

github-actions Bot pushed a commit that referenced this pull request Oct 14, 2026
MP-2 of the mac-platform feature (docs/blueprints/flare/features/mac-platform.md). MP-1 (#757) shipped the Open Recent half of #739; this is the rest.

Closes #739

## What changed
- `Sources/FlareModel/FlareFiles.swift` (extension on `FlareWorkspace`; `FlareWorkspace.swift` not edited):
  - `public static let autosaveDelay: Double = 30`
  - `autosaveDue(lastEdit:now:)`: false unless the document is dirty and both times are present and finite; true once `now - lastEdit >= autosaveDelay`.
  - `recoveryData()`: nil when clean or with no document; otherwise the document encoded with `FlareFormat.encode`, the same encoder the save path uses (`try?`).
- `docs/c4/model.json`: the `flare-model-sources` description gains one clause about the autosave due time and the recovery bytes.

## Why
The autosave writer (MP-5) and launch recovery (MP-6) need a Linux-tested rule for when a recovery write is due and what bytes it writes. Putting it in the Model keeps the app's timer code small.

## Proof
`Tests/FlareModelTests/FlareAutosaveDueTests.swift` (Swift Testing): an edit at 0 is not due at 29.9 and is due at 30.0; a clean document is never due; no last edit is not due; after `didSave` it is not due; undo back to the saved document is not due; NaN and infinite times are not due; `recoveryData()` decodes through `FlareWorkspace.decodeFile` to `document`, and is nil when clean or with no document.

No view code changed, so no snapshot PNGs changed.

Docs check: I confirmed `Double.isFinite` with the apple-docs MCP (searchAppleDocumentation). `Data` comes through the Linux-safe Foundation import the file already has.

Belt-Lead: act-1a13b14336c-tqna
Feature: mac-platform
Fast-Check: pass
Head: ade071c
@github-actions github-actions Bot mentioned this pull request Oct 14, 2026
github-actions Bot pushed a commit that referenced this pull request Oct 14, 2026
## What and why

The last PR of the mac-platform feature (#793, resumes #754). It records that the packet is built and carries `feature-done`, so the lane dispatches the full CI run on `dev` that judges the feature.

- `docs/blueprints/flare/features/mac-platform.md`: a **Status** line naming the merged task PRs (MP-1 #757, MP-2 #759, MP-3 #760, MP-4 #756, MP-5 #761, MP-6 #762), the round-1 test fix #764, and the feature issue #793. Nothing is wired into the window yet; F17a #205 and F17c #393 add the menu and the restore alert.
- `docs/blueprints/flare/features/waves.md`: the wave-1 row's feature issue is now #793 (built).

No CI run has judged the feature since 4594082. #801 fixed FlareModel's build against creative-core main, which had broken every Linux build of `dev`.

## Proof

Docs only. `scripts/ci`: CI: PASS (1414 tests) on this head, rebased on 11e3e0c (#801).

Snapshot PNGs changed: none.

Refs #793

Belt-Lead: act-1a13c789856-0qa9
Feature: mac-platform
Fast-Check: pass
Head: e3c132f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fast-lane Merge automatically when small, green and outside protected paths fast-lane-merged Merged by the fast lane; review after the fact

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant