mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-24 02:27:08 -06:00
macOS: offer .potx and .ppsx too, keep the desktops' file types equal, log the change
Windows (deckcraft.wxs) and Linux (the desktop file) already offer DeckCraft for .deckcraft, .pptx, .potx and .ppsx; the macOS Info.plist now declares the same four, so a template or a slide show opens from Finder as well. A test in apps/deckcraft reads the three packaging files and fails when they drift apart, and checks every document type names its content type (Finder's "Change All" needs it). Progress log row for #138 and #347. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
12085b1153
commit
9632162029
@@ -195,6 +195,7 @@ app's JSON control channel (`deckcraft --control PORT`).
|
||||
| 2026-10-14 | Draw: pen pressure scales ink width when the pointer reports it (a mouse or a missing reading stays at the pen width; a stroke saved as a flat 0.5 still draws at the pen width). Tilt is not read |
|
||||
| 2026-10-13 | Saving a presentation keeps the embedded workbook behind an unchanged chart, and the chart part's relationships (#335). Editing the chart drops that workbook instead of writing numbers that no longer match it |
|
||||
| 2026-10-13 | A presentation whose object ids are used up refuses to grow instead of handing out duplicate ids (#407) |
|
||||
| 2026-10-13 | macOS: a Finder double-click, Open With, a drop on the Dock icon and `open -a DeckCraft deck.pptx` open the file (#138, #347). `Info.plist` now declares the documents DeckCraft opens (`.deckcraft`, `.pptx`, `.potx`, `.ppsx`, the same set as the Windows installer and the Linux desktop file, kept equal by a test), and the `kAEOpenDocuments` Apple event is handled through the pinned `fmv-macos-events` crate as in GridCraft; the `-psn_` argument older macOS adds on a Finder launch is ignored. PowerPoint stays the default until the user picks DeckCraft |
|
||||
| 2026-10-13 | Slide transitions like PowerPoint: every transition and option measured frame by frame against PowerPoint's video export and retuned (curves, directions, soft edges, 3-D perspective, contents moving over backgrounds); PowerPoint's own XML elements and defaults read and written (diagonal Wipe, Zoom, Shape In/Out, Glitter Hexagons, Shred In/Out, Page Curl Single); `deckcraft-cli render-transition` renders frames headless |
|
||||
| 2026-10-13 | Wild text cases measured against PowerPoint (102 synthetic slides): bidi by run language, East Asian vertical text upright, mongolianVert/wordArtVert/wordArtVertRtl, underline styles and strikethrough at the font's metrics, centre/right/decimal tabs, East Asian, Thai, Hindi, Arabic and Hebrew numbering, small caps, all-caps "ß", transparent text, soft hyphens, kinsoku, rtlCol and just/dist anchoring, emoji presentation, fallback faces that no longer move the baseline |
|
||||
| 2026-10-13 | Render matches PowerPoint more closely on wild shape, picture and table cases: even-odd custom paths, dashes and caps, arrowheads, radial and path gradients, tile rects, rotWithShape, gradient lines, shadows cast by what is drawn (group and perspective too), group fill, picture borders, tiles, reflection, recolour (biLevel, alphaInv, brightness/contrast), table borders and grid default, 20+ preset shapes by their ECMA formulas, default miter joins, and approximate 3-D bevels, cameras and face lighting |
|
||||
@@ -280,6 +281,7 @@ app's JSON control channel (`deckcraft --control PORT`).
|
||||
| 2026-10-13 | trivial | Progress log: Grid Options dialog |
|
||||
| 2026-10-14 | trivial | Progress log: pen pressure scales ink width |
|
||||
| 2026-10-13 | trivial | Progress log: chart workbook round-trip (#335) |
|
||||
| 2026-10-13 | trivial | Progress log: Finder opens presentations on macOS (#138) |
|
||||
| 2026-10-13 | trivial | Progress log: wild text cases |
|
||||
| 2026-10-13 | trivial | Progress log: slide show for interactive decks |
|
||||
| 2026-10-12 | minor | Progress log: table cell editing and border resizing |
|
||||
|
||||
@@ -343,4 +343,77 @@ mod tests {
|
||||
assert_eq!(files, ["talk.pptx".to_string()]);
|
||||
}
|
||||
}
|
||||
|
||||
/// The `<string>` values of every `<array>` that follows a `<key>{key}</key>` line.
|
||||
fn plist_strings(plist: &str, key: &str) -> Vec<String> {
|
||||
let mut out = Vec::new();
|
||||
let mut in_array = false;
|
||||
for line in plist.lines() {
|
||||
let line = line.trim();
|
||||
if line == format!("<key>{key}</key>") {
|
||||
in_array = true;
|
||||
continue;
|
||||
}
|
||||
if in_array {
|
||||
for part in line.split("<string>").skip(1) {
|
||||
if let Some((s, _)) = part.split_once("</string>") {
|
||||
out.push(s.to_string());
|
||||
}
|
||||
}
|
||||
if line.ends_with("</array>") {
|
||||
in_array = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
out
|
||||
}
|
||||
|
||||
/// Every desktop offers the same file types: macOS (`CFBundleTypeExtensions` and the native
|
||||
/// type's extension in `Info.plist.in`), Windows (`SupportedTypes` in `deckcraft.wxs`) and
|
||||
/// Linux (`MimeType` in the desktop file). A format added to one installer must reach the
|
||||
/// others, and each must be one Finder, Explorer or the file manager can hand to DeckCraft.
|
||||
#[test]
|
||||
fn every_desktop_offers_the_same_file_types() {
|
||||
let plist = include_str!("../../../packaging/macos/Info.plist.in");
|
||||
let wxs = include_str!("../../../packaging/windows/deckcraft.wxs");
|
||||
let desktop = include_str!("../../../packaging/linux/ai.storyteller.deckcraft.desktop");
|
||||
|
||||
let mut mac = plist_strings(plist, "CFBundleTypeExtensions");
|
||||
// The native type is declared by its UTI; its extension is in the exported type.
|
||||
mac.extend(plist_strings(plist, "public.filename-extension").into_iter().filter(|e| e == "deckcraft"));
|
||||
mac.sort();
|
||||
mac.dedup();
|
||||
assert!(mac.iter().any(|e| e == "pptx") && mac.iter().any(|e| e == "deckcraft"), "Info.plist.in: {mac:?}");
|
||||
// Every document type names a content type too, so "Change All" in Finder's Get Info works.
|
||||
let names = plist.matches("<key>CFBundleTypeName</key>").count();
|
||||
let content_types = plist.matches("<key>LSItemContentTypes</key>").count();
|
||||
assert!(names > 0 && names == content_types, "{names} document types, {content_types} with LSItemContentTypes");
|
||||
|
||||
let mut win: Vec<String> = wxs
|
||||
.lines()
|
||||
.filter(|l| l.contains("SupportedTypes\" Name=\"."))
|
||||
.filter_map(|l| l.split("Name=\".").nth(1)?.split('"').next().map(str::to_string))
|
||||
.collect();
|
||||
win.sort();
|
||||
|
||||
let mime_ext = |m: &str| match m {
|
||||
"application/x-deckcraft" => Some("deckcraft"),
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.presentation" => Some("pptx"),
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.template" => Some("potx"),
|
||||
"application/vnd.openxmlformats-officedocument.presentationml.slideshow" => Some("ppsx"),
|
||||
_ => None,
|
||||
};
|
||||
let mut linux: Vec<String> = desktop
|
||||
.lines()
|
||||
.find_map(|l| l.strip_prefix("MimeType="))
|
||||
.unwrap_or_default()
|
||||
.split(';')
|
||||
.filter(|m| !m.is_empty())
|
||||
.map(|m| mime_ext(m).unwrap_or(m).to_string()) // an unknown MIME type shows up in the diff
|
||||
.collect();
|
||||
linux.sort();
|
||||
|
||||
assert_eq!(mac, win, "macOS and Windows offer different file types");
|
||||
assert_eq!(mac, linux, "macOS and Linux offer different file types");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,9 @@
|
||||
|
||||
<!-- The documents DeckCraft opens, so Finder's Open With and "Change All" can offer it (the
|
||||
Apple events arrive through apps/deckcraft/src/apple_events.rs). PowerPoint stays the
|
||||
preferred app for .pptx unless the user picks DeckCraft. -->
|
||||
preferred app for its formats unless the user picks DeckCraft. The same set as the Windows
|
||||
installer (deckcraft.wxs) and the Linux desktop file; a test in apps/deckcraft keeps
|
||||
them equal. -->
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
@@ -80,6 +82,38 @@
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array><string>application/vnd.openxmlformats-officedocument.presentationml.presentation</string></array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>PowerPoint Template</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.openxmlformats.presentationml.template</string>
|
||||
</array>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array><string>potx</string></array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array><string>application/vnd.openxmlformats-officedocument.presentationml.template</string></array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>PowerPoint Slide Show</string>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Editor</string>
|
||||
<key>LSHandlerRank</key>
|
||||
<string>Alternate</string>
|
||||
<key>LSItemContentTypes</key>
|
||||
<array>
|
||||
<string>org.openxmlformats.presentationml.slideshow</string>
|
||||
</array>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array><string>ppsx</string></array>
|
||||
<key>CFBundleTypeMIMETypes</key>
|
||||
<array><string>application/vnd.openxmlformats-officedocument.presentationml.slideshow</string></array>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
<!-- DeckCraft's own format: a zip of a JSON manifest plus media. -->
|
||||
@@ -126,6 +160,40 @@
|
||||
<array><string>pptx</string></array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.openxmlformats.presentationml.template</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Open XML Presentation Template</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.presentation</string>
|
||||
<string>public.zip-archive</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array><string>potx</string></array>
|
||||
</dict>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>UTTypeIdentifier</key>
|
||||
<string>org.openxmlformats.presentationml.slideshow</string>
|
||||
<key>UTTypeDescription</key>
|
||||
<string>Open XML Slide Show</string>
|
||||
<key>UTTypeConformsTo</key>
|
||||
<array>
|
||||
<string>public.data</string>
|
||||
<string>public.presentation</string>
|
||||
<string>public.zip-archive</string>
|
||||
</array>
|
||||
<key>UTTypeTagSpecification</key>
|
||||
<dict>
|
||||
<key>public.filename-extension</key>
|
||||
<array><string>ppsx</string></array>
|
||||
</dict>
|
||||
</dict>
|
||||
</array>
|
||||
|
||||
</dict>
|
||||
|
||||
Reference in New Issue
Block a user