Skip to content

Commit 576e05f

Browse files
committed
chore: update version and enhance installer configuration
- Bump application version from 0.0.1 to 0.1.0. - Exclude Linux runtimes from the installer files. - Update icon names for consistency in the installer script. - Improve logging in MainWindow and NotepadWindow for better AI error handling. - Adjust AI manager initialization to handle exceptions gracefully. - Update README to reflect new AI features and installation instructions.
1 parent f160a99 commit 576e05f

6 files changed

Lines changed: 118 additions & 76 deletions

File tree

‎MainWindow.xaml.cs‎

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -587,23 +587,55 @@ void RebuildModelsPanel()
587587
RebuildModelsPanel();
588588
}
589589

590+
private static readonly string _logPath = Path.Combine(
591+
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "NoteUI", "debug.log");
592+
593+
private static void LogDebug(string msg)
594+
{
595+
try { File.AppendAllText(_logPath, $"[{DateTime.Now:HH:mm:ss}] {msg}\n"); } catch { }
596+
}
597+
590598
private void ShowAiInSettings(Flyout flyout)
591599
{
592-
_aiManager ??= new AiManager();
593-
_aiManager.Load();
600+
LogDebug("ShowAiInSettings called");
601+
try
602+
{
603+
_aiManager ??= new AiManager();
604+
_aiManager.Load();
605+
LogDebug("AiManager loaded OK");
606+
}
607+
catch (Exception ex)
608+
{
609+
LogDebug($"AiManager error: {ex}");
610+
flyout.Content = new TextBlock { Text = $"AI error: {ex.Message}", TextWrapping = TextWrapping.Wrap, Margin = new Thickness(10) };
611+
return;
612+
}
594613

595614
ActionPanel.ShowAiPanel(flyout, _aiManager, Content.XamlRoot,
596615
onBack: () => Settings_Click(SettingsButton, new RoutedEventArgs()),
597616
onAiStateChanged: RefreshAiUiAcrossOpenWindows);
617+
LogDebug("ShowAiPanel done");
598618
}
599619

600620
private void ShowPromptsInSettings(Flyout flyout)
601621
{
602-
_aiManager ??= new AiManager();
603-
_aiManager.Load();
622+
LogDebug("ShowPromptsInSettings called");
623+
try
624+
{
625+
_aiManager ??= new AiManager();
626+
_aiManager.Load();
627+
LogDebug("AiManager loaded OK");
628+
}
629+
catch (Exception ex)
630+
{
631+
LogDebug($"AiManager error: {ex}");
632+
flyout.Content = new TextBlock { Text = $"AI error: {ex.Message}", TextWrapping = TextWrapping.Wrap, Margin = new Thickness(10) };
633+
return;
634+
}
604635

605636
ActionPanel.ShowPromptsPanel(flyout, _aiManager,
606637
onBack: () => Settings_Click(SettingsButton, new RoutedEventArgs()));
638+
LogDebug("ShowPromptsPanel done");
607639
}
608640

609641
private void RefreshAiUiAcrossOpenWindows()

‎NoteUI.csproj‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,6 @@
4040
<PackageReference Include="LLamaSharp" Version="0.26.0" />
4141
<PackageReference Include="LLamaSharp.Backend.Cpu" Version="0.26.0" />
4242
<PackageReference Include="LLamaSharp.Backend.Cuda12" Version="0.26.0" />
43-
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="9.0.0" />
43+
<PackageReference Include="System.Security.Cryptography.ProtectedData" Version="8.0.0" />
4444
</ItemGroup>
4545
</Project>

‎NoteWindow.xaml.cs‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,8 +1072,8 @@ private async Task ApplyAiToSelectionAsync(RichEditBox editor, string instructio
10721072

10731073
private async Task<string?> TransformSelectionWithAiAsync(string selectedText, string instruction)
10741074
{
1075-
_aiManager ??= new AiManager();
1076-
_aiManager.Load();
1075+
try { _aiManager ??= new AiManager(); _aiManager.Load(); }
1076+
catch { await ShowAiMessageAsync("AI unavailable"); return null; }
10771077
if (!_aiManager.IsEnabled)
10781078
{
10791079
await ShowAiMessageAsync(Lang.T("ai_no_model_selected"));
@@ -1206,18 +1206,29 @@ private static string NormalizeAiOutput(string raw)
12061206

12071207
public void RefreshAiUi()
12081208
{
1209-
_aiManager ??= new AiManager();
1210-
_aiManager.Load();
1211-
if (!_aiManager.IsEnabled)
1212-
_aiManager.UnloadModel();
1213-
AiButton.Visibility = _aiManager.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
1209+
try
1210+
{
1211+
_aiManager ??= new AiManager();
1212+
_aiManager.Load();
1213+
if (!_aiManager.IsEnabled)
1214+
_aiManager.UnloadModel();
1215+
AiButton.Visibility = _aiManager.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
1216+
}
1217+
catch
1218+
{
1219+
AiButton.Visibility = Visibility.Collapsed;
1220+
}
12141221
}
12151222

12161223
private bool IsAiEnabled()
12171224
{
1218-
_aiManager ??= new AiManager();
1219-
_aiManager.Load();
1220-
return _aiManager.IsEnabled;
1225+
try
1226+
{
1227+
_aiManager ??= new AiManager();
1228+
_aiManager.Load();
1229+
return _aiManager.IsEnabled;
1230+
}
1231+
catch { return false; }
12211232
}
12221233

12231234
private async Task ShowAiMessageAsync(string message)

‎NotepadWindow.xaml.cs‎

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,8 @@ private async Task ApplyAiToSelectionAsync(string instruction)
599599

600600
private async Task<string?> TransformSelectionWithAiAsync(string selectedText, string instruction)
601601
{
602-
_aiManager ??= new AiManager();
603-
_aiManager.Load();
602+
try { _aiManager ??= new AiManager(); _aiManager.Load(); }
603+
catch { await ShowAiMessageAsync("AI unavailable"); return null; }
604604
if (!_aiManager.IsEnabled)
605605
{
606606
await ShowAiMessageAsync(Lang.T("ai_no_model_selected"));
@@ -733,18 +733,29 @@ private static string NormalizeAiOutput(string raw)
733733

734734
public void RefreshAiUi()
735735
{
736-
_aiManager ??= new AiManager();
737-
_aiManager.Load();
738-
if (!_aiManager.IsEnabled)
739-
_aiManager.UnloadModel();
740-
AiButton.Visibility = _aiManager.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
736+
try
737+
{
738+
_aiManager ??= new AiManager();
739+
_aiManager.Load();
740+
if (!_aiManager.IsEnabled)
741+
_aiManager.UnloadModel();
742+
AiButton.Visibility = _aiManager.IsEnabled ? Visibility.Visible : Visibility.Collapsed;
743+
}
744+
catch
745+
{
746+
AiButton.Visibility = Visibility.Collapsed;
747+
}
741748
}
742749

743750
private bool IsAiEnabled()
744751
{
745-
_aiManager ??= new AiManager();
746-
_aiManager.Load();
747-
return _aiManager.IsEnabled;
752+
try
753+
{
754+
_aiManager ??= new AiManager();
755+
_aiManager.Load();
756+
return _aiManager.IsEnabled;
757+
}
758+
catch { return false; }
748759
}
749760

750761
private async Task ShowAiMessageAsync(string message)

‎README.md‎

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ A modern sticky notes application for Windows, built with **WinUI 3** (Windows A
1515
- Search and filter by title or content
1616
- Inline title editing
1717
- Auto-save on every change
18+
- Keyboard-accessible note cards (Tab to focus, Enter to open)
1819

1920
### Task Lists
2021
- Dedicated task list note type with checkboxes
@@ -24,18 +25,29 @@ A modern sticky notes application for Windows, built with **WinUI 3** (Windows A
2425
- Enter to add a new task, Backspace on empty to delete
2526

2627
### Reminders
27-
- Set reminders on individual tasks with a date and time picker (keyboard input, minute precision)
28+
- Set reminders on notes and individual tasks with date picker and time picker
2829
- Windows toast notifications when a reminder fires
2930
- Visual bell indicator on tasks with active reminders
3031
- Automatic cleanup after notification
3132

33+
### AI Integration
34+
- **Cloud providers**: OpenAI, Claude (Anthropic), Google Gemini with API key management (DPAPI encrypted)
35+
- **Local models**: LLamaSharp GGUF inference (CPU + CUDA 12 GPU acceleration)
36+
- Predefined models: Gemma 2 2B, Llama 3.2 3B, Llama 3.1 8B
37+
- Custom GGUF model download from URL
38+
- AI text transformations: improve writing, fix grammar, adjust tone (professional, friendly, concise)
39+
- Editable built-in prompts and custom user prompts
40+
- Accessible via slash commands (`/ai`) or status bar robot icon
41+
- Per-note and per-notepad AI actions with selection-based transformation
42+
3243
### Notepad
3344
- Multi-tab text editor with add, close, and close-all operations
3445
- File operations: Open, Save, Save As, Save to Notes
3546
- Undo / Redo, Cut, Copy, Paste, Select All
3647
- Date/Time insertion and slash commands support
3748
- View options: word wrap toggle, zoom in/out
3849
- Markdown mode toggle
50+
- AI text transformations (same as notes)
3951

4052
### Voice Notes
4153
- Speech-to-text recording with real-time transcription
@@ -77,7 +89,8 @@ A modern sticky notes application for Windows, built with **WinUI 3** (Windows A
7789
- Backdrop: Acrylic, Mica, MicaAlt, Custom Acrylic, or None
7890
- Custom Acrylic editor with live preview (tint color, opacity, luminosity)
7991
- Configurable notes storage folder
80-
- Keyboard shortcut rebinding
92+
- Keyboard shortcut rebinding (Show/Hide, New Note, Flyout Back)
93+
- Global system hotkeys (Ctrl+Alt+N to show, Ctrl+N for new note)
8194
- Slash commands toggle (enable/disable)
8295
- Always-on-top (pin) for any window
8396

@@ -87,6 +100,7 @@ A modern sticky notes application for Windows, built with **WinUI 3** (Windows A
87100
- Smooth compact/expand transitions
88101
- Card shadows for depth
89102
- System tray icon (close to tray, reopen from tray)
103+
- Nested flyout navigation with configurable keyboard shortcut (Ctrl+P default)
90104

91105
## Installation
92106

@@ -104,65 +118,39 @@ Options during installation:
104118
- Windows 10 (build 19041) or later
105119

106120
### Build
107-
\`\`\`bash
121+
```bash
108122
dotnet build
109-
\`\`\`
123+
```
110124

111125
### Publish
112-
\`\`\`bash
126+
```bash
113127
dotnet publish -c Release -r win-x64 --self-contained true
114-
\`\`\`
128+
```
115129

116-
Output: \`bin/Release/net8.0-windows10.0.19041.0/win-x64/publish/\`
130+
Output: `bin/Release/net8.0-windows10.0.19041.0/win-x64/publish/`
117131

118132
### Create Installer
119133
Requires [Inno Setup 6](https://jrsoftware.org/isinfo.php):
120-
\`\`\`bash
121-
"C:\Users\Dev\AppData\Local\Programs\Inno Setup 6\ISCC.exe" installer.iss
122-
\`\`\`
123-
124-
Output: \`installer/NoteUI-Setup.exe\`
125-
126-
## Project Structure
127-
128-
\`\`\`
129-
NoteUI/
130-
App.xaml.cs # Application entry point
131-
MainWindow.xaml/.cs # Main window (note list, search, settings)
132-
NoteWindow.xaml/.cs # Note editor / task list editor
133-
NotepadWindow.xaml/.cs # Multi-tab text editor
134-
VoiceNoteWindow.xaml/.cs # Voice recording and transcription
135-
NotesManager.cs # Note data model, persistence, and cloud sync
136-
SpeechRecognitionService.cs # Vosk/Whisper STT engines and model downloader
137-
ReminderService.cs # Background reminder checker and toast notifications
138-
FirebaseSync.cs # Firebase Realtime Database sync and auth
139-
WebDavSync.cs # WebDAV/Nextcloud sync
140-
AppSettings.cs # Settings persistence (theme, backdrop, cloud, language)
141-
ActionPanel.cs # Settings panel, flyout menus, and color picker
142-
SlashCommands.cs # Slash command detection and execution
143-
Lang.cs # Localization system (EN/FR)
144-
OcrService.cs # Windows OCR text extraction
145-
OcrCaptureOverlay.cs # Full-screen region capture overlay
146-
ScreenCaptureService.cs # Screenshot insertion via Snipping Tool
147-
AnimationHelper.cs # GPU Composition animations
148-
AcrylicSettingsWindow.xaml/.cs # Custom acrylic backdrop editor
149-
WindowHelper.cs # Borderless window utilities
150-
WindowShadow.cs # DWM shadow effects
151-
TrayIcon.cs # System tray integration
152-
installer.iss # Inno Setup installer script
153-
\`\`\`
134+
```bash
135+
iscc installer.iss
136+
```
137+
138+
Output: `installer/NoteUI-Setup.exe`
154139

155140
## Data Storage
156141

157-
- **Notes**: \`<notes_folder>/notes.json\` (default: \`%LocalAppData%/NoteUI/notes/\`)
158-
- **Settings**: \`%LocalAppData%/NoteUI/\` (theme, backdrop, cloud credentials)
159-
- **Voice models**: \`%LocalAppData%/NoteUI/models/<model_id>/\`
160-
- **Voice settings**: \`%LocalAppData%/NoteUI/voice_settings.json\`
142+
- **Notes**: `<notes_folder>/notes.json` (default: `%LocalAppData%/NoteUI/notes/`)
143+
- **Settings**: `%LocalAppData%/NoteUI/` (theme, backdrop, cloud credentials, AI settings)
144+
- **Voice models**: `%LocalAppData%/NoteUI/models/<model_id>/`
145+
- **AI models**: `%LocalAppData%/NoteUI/ai_models/`
146+
- **Voice settings**: `%LocalAppData%/NoteUI/voice_settings.json`
161147

162148
## Tech Stack
163149

164150
- **Framework**: WinUI 3 / Windows App SDK 1.8
165151
- **Runtime**: .NET 8 (self-contained, win-x64)
152+
- **AI (local)**: LLamaSharp 0.26.0 (CPU + CUDA 12)
153+
- **AI (cloud)**: OpenAI, Anthropic Claude, Google Gemini REST APIs
166154
- **Audio**: NAudio 2.2.1
167155
- **Speech-to-text**: Vosk 0.3.38, Whisper.net 1.7.4
168156
- **OCR**: Windows.Media.Ocr (built-in Windows OCR engine)

‎installer.iss‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[Setup]
22
AppId={{B8A3D1E7-4F2C-4B9A-8E6D-1A5C3F7E9D2B}
33
AppName=NoteUI
4-
AppVersion=0.0.1
4+
AppVersion=0.1.0
55
AppPublisher=NoteUI
66
DefaultDirName={localappdata}\Programs\NoteUI
77
DefaultGroupName=NoteUI
@@ -23,12 +23,12 @@ Name: "desktopicon"; Description: "Créer un raccourci sur le bureau"; GroupDesc
2323
Name: "startup"; Description: "Lancer au démarrage de Windows"; GroupDescription: "Options:"
2424

2525
[Files]
26-
Source: "bin\Release\net8.0-windows10.0.19041.0\win-x64\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
26+
Source: "bin\Release\net8.0-windows10.0.19041.0\win-x64\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: "runtimes\linux-*\*"
2727

2828
[Icons]
29-
Name: "{group}\Notes"; Filename: "{app}\NoteUI.exe"
30-
Name: "{autodesktop}\Notes"; Filename: "{app}\NoteUI.exe"; Tasks: desktopicon
31-
Name: "{userstartup}\Notes"; Filename: "{app}\NoteUI.exe"; Tasks: startup
29+
Name: "{group}\NoteUI"; Filename: "{app}\NoteUI.exe"
30+
Name: "{autodesktop}\NoteUI"; Filename: "{app}\NoteUI.exe"; Tasks: desktopicon
31+
Name: "{userstartup}\NoteUI"; Filename: "{app}\NoteUI.exe"; Tasks: startup
3232

3333
[Run]
34-
Filename: "{app}\NoteUI.exe"; Description: "Lancer Notes"; Flags: nowait postinstall skipifsilent
34+
Filename: "{app}\NoteUI.exe"; Description: "Lancer NoteUI"; Flags: nowait postinstall skipifsilent

0 commit comments

Comments
 (0)