Skip to content

feat: persist chats & stream everything#1

Merged
kauffinger merged 40 commits intomainfrom
refactor
Jun 26, 2025
Merged

feat: persist chats & stream everything#1
kauffinger merged 40 commits intomainfrom
refactor

Conversation

@kauffinger
Copy link
Copy Markdown
Owner

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements persistent chats with full-streaming support and modernizes UI components across the app.

  • Adds Livewire components and tests for chat listing, viewing, and interactions with streaming messages
  • Introduces a reusable JavaScript markdown processor for real-time rendering of streamed content
  • Refactors Blade templates for consistent attribute formatting and removes the legacy welcome view

Reviewed Changes

Copilot reviewed 101 out of 106 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
vite.config.js Clean up imports and single-quote consistency
routes/web.php Redirect home, define dashboard and chat routes
resources/js/components/markdownProcessor.js New markdownProcessor module for streamed content
resources/views/livewire/chats/*.blade.php Full chat UI and message streaming templates
tests/Feature/Livewire/Chats/{Index,Show}Test.php Comprehensive Livewire chat tests
Comments suppressed due to low confidence (1)

resources/js/components/markdownProcessor.js:1

  • [nitpick] The markdownProcessor module contains non-trivial parsing, theming, and streaming logic but currently has no dedicated unit tests. Consider adding JS tests to cover JSON parsing, theme switching, and rendered output.
/**

}

// Try to parse as JSON first (new format)
const jsonData = JSON.parse(content);
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JSON.parse can throw a runtime exception if content is not valid JSON. Wrap this in a try/catch or validate the string before parsing to prevent the component from breaking.

Suggested change
const jsonData = JSON.parse(content);
let jsonData = null;
try {
jsonData = JSON.parse(content);
} catch (error) {
console.error("Failed to parse JSON content:", error);
// Skip processing invalid JSON
return;
}

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't matter, each component needs to always successfully parse

Route::get('settings/appearance', Appearance::class)->name('settings.appearance');
});

Route::get('chats/{chat}', ChatsShow::class)->middleware('can:view,chat')->name('chat.show');
Copy link

Copilot AI Jun 26, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This route relies only on the can:view policy and is not wrapped in auth middleware. Consider adding ->middleware('auth') so unauthorized or unauthenticated users cannot trigger authorization logic inadvertently.

Suggested change
Route::get('chats/{chat}', ChatsShow::class)->middleware('can:view,chat')->name('chat.show');
Route::get('chats/{chat}', ChatsShow::class)->middleware(['auth', 'can:view,chat'])->name('chat.show');

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no, we want guests to see public chats

@kauffinger kauffinger merged commit e40f740 into main Jun 26, 2025
2 checks passed
@kauffinger kauffinger deleted the refactor branch June 28, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants