# UnifiedFiler v1.9.8 Notes

v1.9.8 focuses on FilePicker / FileSaver completion and Host-facing workflow stabilization.

## Main changes

- Added `HostProfilePresetService`.
  - Built-in profiles: `default`, `unifiedDesktop`, `office`, `viewer`, `editor`, `package`.
  - Host applications can use `hostProfile` / `profile` and override any option explicitly.
- Strengthened `FilePickerControl` public API.
  - `open()` resolves with selected entries.
  - `select()`, `refresh()`, `openPath()`, `openFolder()`, `setStorage()`, `getSelection()`, `getState()`.
  - cancel can resolve or reject by `rejectOnCancel`.
- Strengthened `FileSaverControl` public API.
  - `open()` resolves with save result.
  - `save(data, options)`, `getSaveRequest()`, `setFileName()`, `setData()`, `setWorkflow()`, `refresh()`.
- Added optional Preview pane to FilePicker.
  - `enablePreview: true`.
  - Uses `PreviewService.renderWithResources()` and revokes Blob URLs on selection changes / close.
  - Supports text, Markdown, JSON, image, PDF, and supported fallback previews according to PreviewService settings.
- Added Recent / Favorite integration to FilePicker.
  - `enableRecentFiles: true`.
  - `enableFavorites: true`.
  - File selection commits are stored in `RecentFileService` when available.
- Clarified Save As / Export / Package Save workflow metadata.
  - FileSaver request now includes `workflow`, `exportFormat`, `packageType`, `sourceEntry`, `hostProfile`.
- Updated demo options for FilePicker / FileSaver.

## Host API examples

```javascript
var picker = new UnifiedFiler.controls.FilePickerControl({
  services: services,
  hostProfile: 'viewer',
  enablePreview: true
});

picker.open().then(function (result) {
  console.log(result.entries);
});
```

```javascript
var saver = new UnifiedFiler.controls.FileSaverControl({
  services: services,
  hostProfile: 'office',
  workflow: 'packageSave',
  defaultFileName: 'document.uwpsx'
});

saver.save(packageBlob, { fileName: 'document.uwpsx' }).then(function (result) {
  console.log(result.savedEntry || result.request);
});
```

## Compatibility

The jQuery plugin APIs remain available:

- `$.fn.fileExplorer`
- `$.fn.filePickerDialog`
- `$.fn.fileSaverDialog`

The architectural position remains unchanged: jQuery plugins are internal View / Controller components owned by Control classes.
