Commit Graph

407 Commits

Author SHA1 Message Date
cogwheel0
551e844c03 fix: change service declaration to non-late initialization in TextToSpeechController 2025-10-26 19:15:40 +05:30
cogwheel0
2b44e38a2e feat(i18n/socket): add WebSocket error messages and show connect errors 2025-10-25 14:24:49 +05:30
cogwheel0
a2d786109c feat(tts): initialize and sync TTS with app settings for calls 2025-10-24 00:58:46 +05:30
cogwheel0
15299ecd82 feat(chat): dismiss after send to recover screen space 2025-10-24 00:39:43 +05:30
cogwheel0
9c2cf347a7 feat(chat): inline action panel with context menu edit flow 2025-10-24 00:31:29 +05:30
cogwheel0
c1eae6608d feat: pass button BuildContext to conversation menu to position it 2025-10-23 23:38:32 +05:30
cogwheel0
625631c096 feat: add scr color tokens and use them for drawers
Introduce scrimMedium and scrimStrong color tokens to the shared
theme color tokens and propagate them through constructors, copyWith,
and lerp so scrim values interpolate and can be overridden.

Define scrim tokens as black with different alpha values per theme
mode (lighter alpha in light mode stronger in dark mode) to create
a consistent darkening effect for overlays.

Refactor ChatPage to use the new scrim tokens for drawer scrims and
format a RegExp call for readability. This replaces previous use of
overlay tokens for platform-specific scrims to provide clearer
semantics and better visual control for modal/drawer backdrops.
2025-10-23 23:27:11 +05:30
cogwheel0
5d898aaca0 refactor: improve composer layout and constrain height
the modern chat input composer layout to better handle vertical
space and alignment. Change the row crossAxisAlignment from
center to end so controls align to the input bottom. Wrap the animated
container with a ConstrainedBox that limits the composer max height to
25% of the screen, preventing excessive growth on tall displays.

Reorder and clean up the AnimatedContainer/decoration block, extracting
the composer radius constant and preserving styling (background color,
border color/width). Move the text field and inline mic into the same
row structure under the constrained container and retain the isActive
flag and padding. These changes prevent layout overflow, ensure a
consistent border radius, and improve visual alignment of controls.
2025-10-23 23:19:41 +05:30
cogwheel0
be62358270 feat(chat): strip reasoning when copying
Remove internal reasoning from copied message text to avoidleaking implementation details or developer-only when a
user content from the chat- In chat_pagecopyMessage, cleaning steps to:
  - <details type="ing">...</details blocks
  - <think>think> and <ing>...</reason> tags
 - trim leftover whitespace before writing to the clipboard
- In assistant_message_widget._buildSegmentedContent, remove an
  unused hasMediaAbove calculation and a conditional spacer that added
  extra top padding before reasoning tiles. This simplifies rendering
  logic and avoids relying on removed spacing behavior.
2025-10-23 22:37:06 +05:30
cogwheel0
1cb8926e21 feat(chat): regenerate variants and support
Hide archived assistant variants in the linear chat view and track
previous assistant as versions so regenerated responses do not
duplicate or lose history. When regenerating, mark the previous assistant
message with an archivedVariant flag for the UI and keep it in server
history. Add a ChatMessageVersion model and a versions field to
ChatMessage to store prior generated variants. Implement
archiveLastAssistantAsVersion in chat providers to snapshot the last
assistant message into versions and reset the message for a fresh
streamed generation. Finalize flow updates to attach an adjacent archived
assistant as a version when needed so the UI can present a switcher
between current and past variants. These changes prevent duplicate
messages, preserve previous responses, and enable variant switching.
2025-10-23 22:29:28 +05:30
cogwheel0
0df4b4f050 feat(ui): support authenticated image loading with cache manager
Add Riverpod-aware image header and cache manager support for network
images used in avatar and markdown widgets. Convert AvatarImage to a
ConsumerWidget and read a self-signed cache manager and HTTP headers
from Riverpod so CachedNetworkImage can send auth/custom headers and use
the provided cache manager. In Markdown image builder, obtain headers
and cache manager from a ProviderContainer (via ProviderScope.containerOf)
to enable the same authenticated loading in non-consumer contexts.

Introduce image_header_utils.dart to centralize building Authorization
and custom headers from auth/api providers, with helpers for Ref,
WidgetRef, and ProviderContainer. Add dependency adjustments in
pubspec.lock for flutter_cache_manager and http marked as direct main.

These changes ensure protected images (self-signed or auth-required)
load correctly across the app and reuse the configured cache manager.
2025-10-23 17:36:31 +05:30
cogwheel0
56246507de feat(tts): add karaoke-style TTS progress bar to assistant UI
Add rendering and support for a karaoke-style text-to-speechprogress bar in assistant messages so users can see the currently
spoken sentence and highlighted word during playback.

- Append TTS karaoke bar to AssistantMessageWidget when the message is
  the active TTS target and playback is speaking/paused/loading.
- Implement _buildKaraokeBar to render the active sentence with a
  highlighted word span, using ConduitCard and theme styles.
- Import conduit_components for shared UI primitives.
- Extend TextToSpeechState with sentence data:
  sentences, sentenceOffsets, activeSentenceIndex, and per-word
  progress (wordStartInSentence, wordEndInSentence).
- Add provider callbacks wiring: onSentenceIndex and
  onDeviceWordProgress handlers (hooked into TTS backend).
- Prepare sentence splitting and word-progress plumbing in the TTS
  provider (prepares data used to drive the karaoke display).

This change improves UX by visually indicating the spoken sentence
and current word during TTS playback, aiding comprehension and
accessibility.
2025-10-23 17:05:35 +05:30
cogwheel0
8ec411d6aa feat(tts): server chunked playback queue on server pathRefactor server-backedTS path to perform sentence chunking and
queued playback via a dedicated _startServerChunkedPlayback method
instead of generating a single monolithic audio blob.

This change simplifies the server flow, avoids constructing an entire
audio buffer in memory, and enables smoother playback and error
recovery. On errors, the code still falls back to device TTS.
2025-10-23 16:46:24 +05:30
cogwheel0
561e7dd616 feat(tts): server-backed TTS engine selection
Introduce server TTS support and engine selection while keeping
device TTS as the default.

- Add new persistence keys for storing TTS engine and selected
  server voice (ttsEngine, ttsServerVoiceId, ttsServerVoiceName).
- Extend TextToSpeechService to support two engines:
  TtsEngine.device (FlutterTts) and TtsEngine.server (remote audio).
- Wire in an AudioPlayer and optional ApiService to fetch raw
  audio bytes from the server and play them, with event hooks
  mapped to existing lifecycle callbacks.
- Implement fallback to device TTS on server errors or empty
  responses, and ensure player lifecycle (pause/stop/dispose)
  is handled when using server engine.
- Allow engine and preferred voice to be configured before
  initialization and updated at runtime via updateSettings.

This enables selecting a server-side voice and using a remote
TTS provider while preserving compatibility with the existing
device TTS implementation.
2025-10-23 16:31:15 +05:30
cogwheel0
d00cbe36cf refactor: Replace hardcoded monospace font with AppTypography constant
- Updated multiple instances of the 'monospace' font family to use AppTypography.monospaceFontFamily for consistency across the application.
- This change enhances maintainability and ensures a unified typography approach throughout the app.
2025-10-21 00:09:12 +05:30
cogwheel0
a0a0d43116 refactor: Update MainActivity for edge-to-edge display support
- Implemented modern edge-to-edge display handling for Android 15+ in MainActivity.kt.
- Removed deprecated SystemUiMode.edgeToEdge configuration from main.dart, as edge-to-edge is now managed natively.
- Ensured backward compatibility by maintaining the previous edge-to-edge display settings for lower Android versions.
2025-10-20 23:56:40 +05:30
cogwheel0
e05a560966 refactor: Enhance markdown processing for text-to-speech conversion
- Introduced new regex patterns to remove thinking and reasoning blocks from markdown input.
- Added functionality to strip emojis from the text, improving clarity for TTS.
- Implemented HTML entity decoding to ensure proper text representation.
- Replaced the existing sanitization method with a more comprehensive markdown-to-text conversion approach, enhancing performance and maintainability.
2025-10-20 23:53:07 +05:30
cogwheel0
810b44975d refactor: Enhance chat input interaction with state-based overlay colors
- Implemented state-based overlay color changes for the chat input's InkWell widget to improve user feedback during interactions.
- Adjusted the color of the chat input icon to align with the primary button text color, enhancing visual consistency and usability.
2025-10-19 23:07:36 +05:30
cogwheel0
27bfde8f95 refactor: Enhance onboarding process in chat and app startup providers
- Integrated autofocus management for the composer in both chat and onboarding contexts to improve user experience.
- Added error handling for focus management to ensure smooth onboarding transitions.
- Updated modal bottom sheet handling to restore autofocus state after onboarding completion, enhancing usability across the app.
2025-10-19 21:10:10 +05:30
cogwheel0
42efbe8fc5 refactor: Update quick actions description and enhance AppCustomizationPage layout
- Revised the quick actions description in multiple languages to clarify their purpose as "Quickpills in chat."
- Adjusted the layout of AppCustomizationPage by reintroducing the quick pills section for improved user interaction.
- Modified spacing between UI elements for better visual consistency and usability.
- Streamlined the component structure to enhance maintainability and readability.
2025-10-19 16:06:20 +05:30
cogwheel0
89f897e8ad refactor: Revamp AppCustomizationPage layout and component structure
- Reorganized the layout of AppCustomizationPage to enhance readability and maintainability.
- Introduced an expandable card widget for collapsible settings sections, improving user interaction.
- Updated theme and language selection sections for better clarity and usability.
- Refactored theme and language handling methods to streamline the code and improve performance.
- Enhanced the overall UI consistency by adjusting spacing and component arrangements.
2025-10-19 15:23:31 +05:30
cogwheel0
553c213a47 refactor: Update placeholder color in chat input for improved visibility
- Changed the placeholder color in the modern chat input to use the input text color with adjusted alpha for better contrast and visibility in both light and dark themes.
- This enhancement aims to improve user experience by ensuring the placeholder text is more legible across different brightness settings.
2025-10-19 15:08:15 +05:30
cogwheel0
52753b92f7 refactor: Enhance image attachment handling in chat
- Introduced asynchronous decoding for base64 image data to improve performance and responsiveness.
- Added caching for decoded image bytes to optimize loading times and reduce redundant processing.
- Updated error handling to provide clearer feedback when image loading fails, enhancing user experience.
- Refactored loading logic to streamline the process of checking cached images and managing loading states.
- Improved the handling of data URLs and relative URLs for better image attachment management.
2025-10-19 14:18:26 +05:30
cogwheel0
2f8fd97022 refactor: Enhance file attachment handling and UI components
- Updated the file attachment service to utilize a new LocalAttachment class, improving the management of file metadata such as display names.
- Refactored methods for picking and uploading files to accommodate the new LocalAttachment structure, ensuring consistent handling of file attributes.
- Improved the chat page to validate and manage file attachments more effectively, enhancing user experience during file uploads.
- Added functionality for image previews in the file attachment widget, allowing users to see selected images before sending.
- Introduced a remove button for attachments, improving usability by enabling users to easily discard unwanted files.
2025-10-19 13:50:54 +05:30
cogwheel0
1104661238 refactor: Update message hint text for improved user guidance
- Changed the placeholder text in the message input field across multiple languages to "Ask Conduit" for better clarity and user engagement.
- Updated localization files for German, English, Spanish, French, Italian, Dutch, Russian, and Chinese to reflect the new hint text.
2025-10-18 19:08:21 +05:30
cogwheel0
d0a8a9ea05 refactor: Update spacing in AppCustomizationPage for improved layout
- Increased the spacing between UI elements in AppCustomizationPage from `Spacing.xs` to `Spacing.md` for better visual separation and improved user experience.
- Adjusted the layout of the speech rate, pitch, and volume sliders to enhance overall UI consistency.
2025-10-18 18:56:28 +05:30
cogwheel0
7676e5c67e refactor: Adjust chat bubble and message bubble padding for improved UI consistency
- Reduced the chat bubble padding from 16.0 to 12.0 for a more compact design.
- Updated the message bubble border radius from 18.0 to 12.0 to enhance visual harmony across components.
2025-10-18 15:46:30 +05:30
cogwheel0
bb57f91aeb refactor: Improve chat input UI with enhanced microphone icon handling
- Updated the background color logic in the chat input to use a more consistent alpha value based on brightness.
- Simplified the layout of the chat input by removing unnecessary alignment and shadow properties.
- Introduced a new inline microphone icon that activates voice input, improving user interaction.
- Enhanced the overall structure of the chat input widget for better readability and maintainability.
2025-10-18 15:35:07 +05:30
cogwheel0
f36ebfd630 feat: Enhance chat functionality with follow-up message handling
- Added logic to determine the visibility of follow-up messages based on the presence of user and assistant bubbles below the current message.
- Updated the AssistantMessageWidget to accept a new parameter `showFollowUps`, allowing for conditional rendering of follow-up messages.
- Improved the user experience by ensuring follow-up messages are displayed appropriately based on the chat context.
2025-10-18 15:03:06 +05:30
cogwheel0
f81237e374 refactor: Enhance UI components with updated border styles and theme adjustments
- Removed unnecessary border from UserMessageBubble for a cleaner appearance.
- Adjusted Divider and OutlineInputBorder styles in ChatsDrawer to improve visual consistency with updated alpha values.
- Updated color tokens in AppColorTokens and TweakcnThemes to streamline theme management and ensure better contrast handling.
- Introduced new Tweakcn theme variant 'Claude' for a warm, tactile palette, enhancing overall UI aesthetics.
2025-10-18 14:25:26 +05:30
cogwheel0
60883315a2 refactor: Migrate to Tweakcn themes and enhance UI consistency
- Replaced references to AppColorPalettes with TweakcnThemes across various files to standardize theme usage.
- Updated the AppTheme and AppColorTokens to utilize TweakcnThemeDefinition for improved theme management.
- Adjusted UI components in ChatPage, ChatsDrawer, AppCustomizationPage, and ProfilePage to align with the new theme structure, ensuring consistent styling and color application.
- Removed the deprecated color_palettes.dart file to streamline the theme architecture.
2025-10-18 13:58:15 +05:30
cogwheel0
23071bb7b1 refactor: Simplify platform-specific icon handling in AppCustomizationPage and ProfilePage
- Replaced direct platform checks with a utility method `UiUtils.platformIcon` for better readability and maintainability.
- Updated localization strings for app customization to enhance clarity and consistency across multiple languages.
- Adjusted icon colors in the UI to ensure proper theming and visual consistency.
2025-10-17 15:09:37 +05:30
cogwheel0
6c81d68e59 feat: Add Text-to-Speech settings and customization options
- Introduced new preference keys for TTS settings: voice, speech rate, pitch, and volume.
- Updated SettingsService to handle TTS settings and persist them.
- Enhanced AppSettings to include TTS-related properties.
- Implemented TTS settings UI in AppCustomizationPage, allowing users to select voice and adjust speech parameters.
- Added localization support for TTS settings in multiple languages.
2025-10-17 14:40:44 +05:30
cogwheel0
a2ae48f85f chore: update Fastlane configuration and clean up API service
- Updated the Deliverfile to submit for review and skip metadata and screenshots.
- Removed outdated build lane from Fastfile.
- Refactored API service to eliminate fallback to latest assistant message, addressing duplication issues in multi-turn conversations.
2025-10-16 23:51:18 +05:30
cogwheel0
893d8445f2 chore: bump version to 2.1.4 2025-10-16 11:45:55 +05:30
cogwheel0
146cbfb492 refactor: Trigger haptic feedback on tap down for immediate response 2025-10-16 11:34:42 +05:30
cogwheel0
762155500b feat: Improve offline detection logic
This commit refactors the connectivity service to be more robust and less prone to UI flicker.

Key changes:
- Any successful API response now briefly suppresses the offline warning. This prevents the UI from flashing an offline message between regular connectivity checks.
- The threshold for showing the offline warning is increased from 2 to 3 consecutive failed health checks.
- The timeout for health checks is increased to better handle slow networks.
- The offline warning is now suppressed if there are active data streams to avoid interrupting the user.
- A custom JSON converter is added for conversation metadata to handle potential type mismatches from local storage.
2025-10-16 11:34:28 +05:30
cogwheel0
14af2a100a build: Bump Android Gradle Plugin to 8.9.1
fix(chat): Improve Markdown formatter state management

- Explicitly clear the streaming formatter when switching conversations to prevent state leakage.
- Implement defensive checks to ensure the formatter is always associated with the correct message, resetting it if a mismatch is detected.
- Refine the formatter seeding logic to only use existing content in resume scenarios, preventing content duplication.
- Add detailed logging to the chat provider for better debugging of streaming and formatter behavior.
2025-10-16 11:34:13 +05:30
cogwheel0
c07ac6b427 refactor: Improve model tools auto-selection logic
This commit refactors the `modelToolsAutoSelectionProvider` to more robustly handle the automatic selection of tools when the model changes or the list of available tools is updated.

Key changes include:
- Triggering the auto-selection logic not only when the selected model changes, but also when the `toolsListProvider` finishes loading. This ensures tools are correctly applied even if they load after the model is selected.
- Restructuring the logic to handle asynchronous tool loading more gracefully, preventing race conditions.
- Using `Future.microtask` to schedule the tool application, ensuring state updates are handled correctly within the provider lifecycle.
- Clearing selected tools if the new model has no associated tools or if previously selected tools become invalid.
2025-10-13 15:25:20 +05:30
cogwheel0
ea14ea6f09 feat: Add Spanish, Dutch, Russian, and Chinese languages
Adds support for Spanish, Dutch, Russian, and Chinese to the language selection menu. This includes adding the necessary translation strings and updating the app customization page to display these new language options.
2025-10-12 20:59:05 +05:30
cogwheel0
7d4aca1944 fix: add tls override for websockets incase of self signed certs 2025-10-11 16:17:35 +05:30
cogwheel0
499291e594 refactor: enhance search field styling in ChatsDrawer
- Wrapped the TextField in a Material widget to improve styling and ensure proper background handling.
- Added TextDecoration.none to various text styles to remove underlines, enhancing visual consistency.
- Updated the search field's input decoration for better alignment with the app's theme and design standards.
2025-10-11 14:55:13 +05:30
cogwheel0
4003941482 feat: implement background task management for improved streaming continuity
- Integrated BackgroundTasks framework in iOS to manage background processing for audio streams.
- Added methods to register, schedule, and handle background tasks, allowing streams to continue for extended periods.
- Enhanced the BackgroundStreamingHandler to support background task notifications and keep-alive signals.
- Updated Info.plist to permit background task identifiers, ensuring compliance with iOS requirements.
- Improved the PersistentStreamingService to handle background task extensions and keep-alive signals effectively, enhancing overall streaming reliability.
2025-10-11 13:53:30 +05:30
cogwheel0
1333b10cd8 feat: enhance model and tools integration with auto-selection functionality
- Added a new `toolIds` field to the `Model` class to support tool identification.
- Implemented `modelToolsAutoSelectionProvider` to automatically apply model-specific tools when the selected model changes.
- Enhanced the logic to filter and set valid tool IDs based on available tools, improving user experience by ensuring relevant tools are automatically selected.
- Updated the default model auto-selection provider to initialize the new tools auto-selection feature, ensuring seamless integration within the app's lifecycle.
2025-10-11 13:27:39 +05:30
cogwheel0
7a8bd54dba refactor: remove self-signed certificate manager and streamline certificate handling
- Deleted the SelfSignedCertificateManager and its associated files to simplify the certificate management process.
- Updated ApiService and ConnectivityService to include self-signed certificate configuration directly, enhancing clarity and maintainability.
- Adjusted comments to reflect the new approach to handling self-signed certificates, ensuring better understanding of security considerations.
- Improved the application startup sequence by deferring unnecessary initializations, contributing to a more efficient first paint performance.
2025-10-11 13:16:31 +05:30
cogwheel0
968c02940f refactor: optimize application startup sequence and migration handling
- Removed the immediate initialization of SelfSignedCertificateManager to improve the app's first paint performance.
- Introduced lazy initialization of the certificate manager after the first frame, enhancing startup efficiency.
- Implemented a fast path for migration checks in PersistenceMigrator to skip unnecessary operations if already completed in the current session, improving overall performance during app startup.
- Updated comments for clarity on the changes made to the startup sequence and migration process.
2025-10-11 12:44:35 +05:30
cogwheel0
8ac71c5718 fix: improve server connection handling during authentication
- Updated AuthStateManager to clear the active server ID upon logout, ensuring a proper return to the server connection page.
- Enhanced RouterNotifier to allow users to stay on the server connection page if authenticated, improving navigation flow.
- Modified AuthenticationPage to navigate back to the server connection page instead of popping the navigation stack, enhancing user experience during server setup.
2025-10-10 22:08:23 +05:30
cogwheel0
c26ba02a88 feat: add support for additional languages in localization
- Expanded the localization support by adding new languages: Chinese (zh), Russian (ru), Dutch (nl), and Spanish (es).
- Updated the localization files and the AppLocalizations class to include the new languages, ensuring a broader reach for international users.
- Enhanced the isSupported method to recognize the newly added languages, improving the app's adaptability to diverse user preferences.
2025-10-10 21:38:19 +05:30
cogwheel0
dea53593ba refactor: replace SlideDrawer with ResponsiveDrawerLayout for improved responsiveness
- Updated ChatPage and ChatsDrawer to utilize ResponsiveDrawerLayout instead of SlideDrawer, enhancing the drawer's adaptability across devices.
- Removed the SlideDrawer implementation, streamlining the codebase and improving maintainability.
- Adjusted drawer opening and closing logic to align with the new layout structure, ensuring a smoother user experience on both mobile and tablet devices.
2025-10-10 21:21:13 +05:30
cogwheel0
4eb1191748 feat: enhance background streaming functionality with improved wake lock management
- Updated the wake lock duration in BackgroundStreamingHandler to 3 hours, ensuring the service remains active for longer periods.
- Modified the keepAlive method to support both iOS and Android, allowing for better background task management across platforms.
- Implemented a periodic keep-alive timer in VoiceCallService to refresh the wake lock every 5 minutes, enhancing service reliability during voice calls.
- Added debug logging for successful keep-alive invocations, improving traceability of background operations.
2025-10-10 19:59:17 +05:30