Skip to content

Commit

Permalink
Add screenshots of mobile device
Browse files Browse the repository at this point in the history
  • Loading branch information
christianhellsten committed Dec 23, 2023
1 parent 166f725 commit ac7675c
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 7 deletions.
11 changes: 10 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ A HTML UI for Ollama.

- Zero dependencies: vanilla HTML, CSS, and Javascript
- Simple installation: download and open in browser
- Minimal & responsive UI: mobile & desktop

## Features

Expand All @@ -27,10 +28,18 @@ A HTML UI for Ollama.

## Screenshots

![Main screen](/screenshots/chat.png)
**Desktop**

![Chat](/screenshots/chat.png)
![Chat (fullscreen)](/screenshots/chat-collapsed.png)
![Settings screen](/screenshots/settings.png)
![Search](/screenshots/search.png)

**Mobile**

![Chat](/screenshots/chat-mobile.png)
![Chat (fullscreen)](/screenshots/chat-collapsed-mobile.png)

## Installing

First, install and start [Olama](https://ollama.ai/).
Expand Down
28 changes: 22 additions & 6 deletions js/App.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ class AppTest {
this.sidebar = this.page.locator('#sidebar')
}

async mobileDevice () {
const width = 375
const height = 667
await this.page.setViewportSize({ width, height })
}

async showSettings () {
await this.page.click('#settings-button')
await expect(this.page.locator('#settings-dialog')).toBeVisible()
Expand Down Expand Up @@ -168,7 +174,7 @@ test.describe('Application tests', () => {

test('Search chats', async () => {
// Create chats for each country
for (const name of ['Finland', 'Sweden', 'Canada', 'Norway', 'Denmark']) {
for (const name of ['History of Finland', 'History of Sweden', 'History of Canada', 'History of Norway', 'History of Denmark']) {
await app.newChat(name)
}

Expand Down Expand Up @@ -200,7 +206,7 @@ test.describe('Application tests', () => {

test('Collapse sidebar', async () => {
// Create chats for each country
for (const name of ['Finland', 'Sweden', 'Norway', 'Denmark']) {
for (const name of ['History of Finland', 'History of Sweden', 'History of Norway', 'History of Denmark']) {
await app.newChat(name)
}
// Collapse sidebar
Expand All @@ -212,12 +218,22 @@ test.describe('Application tests', () => {
})

if (GITHUB_ACTIONS === false) {
console.log('AAAAAAAAAAAAAA')
test('Send message', async () => {
await app.updateSettings(url, model)
await app.editChatTitle('What is 10+10?')
await app.sendMessage('What is 10+10?')
// Create chat
await app.editChatTitle('What is Mistral?')
await app.sendMessage('What is Mistral?')
await app.screenshot('screenshots/chat.png')
// Collapse
await app.page.click('#hamburger-menu')
await app.screenshot('screenshots/chat-collapsed.png')
await app.page.click('#hamburger-menu')
// Mobile device
app.mobileDevice()
await app.screenshot('screenshots/chat-mobile.png')
// Collapse
await app.page.click('#hamburger-menu')
await app.screenshot('screenshots/chat-collapsed-mobile.png')
})

test('Show settings', async () => {
Expand All @@ -232,7 +248,7 @@ test.describe('Application tests', () => {

test('Send message (server down)', async () => {
await app.page.fill('#message-input', 'Server is down')
await app.page.fill('#message-input', 'What is 10+10?')
await app.page.fill('#message-input', 'What is Mistral?')
await app.page.click('#send-button')
await app.page.waitForTimeout(500) // Small delay to allow UI to update
await app.screenshot('screenshots/chat-error.png')
Expand Down
Binary file added screenshots/chat-collapsed-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/chat-collapsed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/chat-error.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added screenshots/chat-mobile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/chat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified screenshots/settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ac7675c

Please sign in to comment.