Skip to content

Commit 9de7648

Browse files
Merge pull request #35 from christianhellsten/switch-talking-to
Implement model switching using @
2 parents 1d65903 + 61eee07 commit 9de7648

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1017
-4101
lines changed

.github/workflows/run-tests.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,28 +22,33 @@ jobs:
2222
- name: Cache node modules
2323
uses: actions/cache@v2
2424
with:
25-
path: ~/.npm
26-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
25+
path: ~/.yarn
26+
key: ${{ runner.os }}-node-${{ hashFiles('**/yarn.lock') }}
2727
restore-keys: |
2828
${{ runner.os }}-node-
2929
3030
- name: Use Node.js ${{ matrix.node-version }}
3131
uses: actions/setup-node@v3
3232
with:
3333
node-version: ${{ matrix.node-version }}
34-
- run: npm install
35-
- run: npm install parcel-bundler
36-
- run: npx playwright install
34+
cache: 'yarn'
35+
36+
- name: Install dependencies
37+
run: yarn install
38+
39+
- name: Install Playwright
40+
run: yarn playwright install
41+
3742
- name: Run tests
3843
run: |
39-
nohup parcel index.html > server.log 2>&1 &
44+
nohup yarn parcel index.html > server.log 2>&1 &
4045
# Run server in the background
41-
# nohup npm run server > server.log 2>&1 &
46+
# nohup yarn server > server.log 2>&1 &
4247
# Wait for the server to start
4348
sleep 10
4449
export GITHUB_ACTIONS=true
45-
npm run test
46-
npm run test:mobile
50+
yarn test
51+
yarn test:mobile
4752
4853
- name: Upload server log
4954
if: failure()

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
tmp
22

3+
parcel-bundle-reports/
4+
*.code-workspace
5+
36
.envrc
47

8+
dist/*.gz
9+
dist/*.br
10+
511
# Logs
612
logs
713
*.log

.parcelrc.disabled

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"extends": "@parcel/config-default",
3+
"compressors": {
4+
"*.{html,css,js,svg,map}": [
5+
"...",
6+
"@parcel/compressor-gzip",
7+
"@parcel/compressor-brotli"
8+
]
9+
},
10+
"reporters": [
11+
"...",
12+
"parcel-reporter-bundle-analyzer"
13+
]
14+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ A HTML UI for [Ollama](https://ollama.ai).
1010

1111
- Minimal & responsive UI: mobile & desktop
1212
- Cross browser: support last 2 versions with more than > 0.5% global use
13-
- Zero dependencies: HTML, CSS, and JavaScript (less than 10 Kb gzipped)
13+
- Zero dependencies: HTML, CSS, and JavaScript (less than 20 Kb gzipped)
1414
- Simple installation: run in your browser, host on your own server
1515

1616
## Screenshots

css/ChatArea.scss

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,7 @@
66

77
}
88

9-
#chat-menu-button {
10-
background-color: var(--secondary-bg-color);
11-
}
12-
13-
#chat-model-info {
14-
padding: 0.25rem 0.75rem;
15-
9+
#chat-model {
1610
.chat-model-name {
1711
@extend %font-weight-bolder;
1812
}

css/ChatHistory.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* Chat history */
22
#chat-history {
3-
mask-image: linear-gradient(180deg, var(--white) 95%, transparent);
3+
padding: 0.5rem;
4+
padding-top: 1rem;
5+
// border-bottom: 1px solid #ccc;
6+
// mask-image: linear-gradient(180deg, var(--white) 98%, transparent);
47
display: flex;
58
flex-grow: 1;
69
flex-direction: column;
7-
padding: 0.5rem;
810
max-width: 1024px;
911
width: 100%; /* Full width of its parent */
1012
overflow-y: auto; /* Enable vertical scrolling */
@@ -26,7 +28,7 @@
2628

2729
/* Styling for user messages */
2830
.user-chat-message {
29-
@extend %font-weight-bolder;
31+
//@extend %font-weight-bolder;
3032

3133
.system-icon {
3234
display: none;

css/ChatList.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
.list-item.selected {
1919
background: var(--white);
20+
border-radius: 0.25rem;
2021

2122
@extend %box-shadow;
2223

css/DropDownMenu.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
}
44

55
.drop-down-menu-items {
6-
background: var(--bg-color);
76
position: absolute;
87
top: 100%; /* Position below the button */
8+
z-index: 1000;
99
display: none; /* Hide initially */
1010
font-size: 0.75rem;
1111
white-space: nowrap;
12+
background-color: var(--white);
1213

1314
i[class^='icon-']::before {
1415
padding-right: 0.5rem;

css/Sidebar.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
max-width: 480px;
88
overflow-y: auto;
99

10+
#chat-list {
11+
padding: 0.5rem;
12+
}
13+
1014
.buttons {
1115
width: 100%;
1216
display: flex;
@@ -21,5 +25,4 @@
2125
#sidebar.collapsed {
2226
min-width: 0;
2327
max-width: 0;
24-
padding: 0;
2528
}

css/colors.scss

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@
22

33
// Light theme as default
44
:root {
5+
--yellow: #ffa700;
6+
--blue: #0057e7;
7+
--white: #fff;
8+
--gray: #888;
59
--primary-color: #393e46;
610
--secondary-color: #222831;
711
--secondary-color-lighten-20: #{color.adjust(#222831, $lightness:20%)};
812
--secondary-color-lighten-40: #{color.adjust(#222831, $lightness:40%)};
913
--tertiary-color: #eee;
1014
--error-color: #ef4040;
1115
--bg-color: #fafafa;
12-
--secondary-bg-color: #f0f0f0;
16+
--secondary-bg-color: #f0f0f045;
1317
--text-color: #333;
1418
--text-color-lighten-20: #{color.adjust(#eee, $lightness:20%)};
1519
--icon-color: var(--primary-color);
@@ -21,14 +25,18 @@
2125
--border-color: #{color.adjust(#393e46, $lightness:60%)};
2226
--border-hover-color: #{color.adjust(#393e46, $lightness:40%)};
2327
--border-focus-color: #{color.adjust(#393e46, $lightness:30%)};
24-
--box-shadow-color: rgb(196 204 213 / 37%);
25-
--box-shadow-modal-color: #444;
28+
--box-shadow-color: rgb(196 204 213 / 17%);
29+
--box-shadow-modal-color: rgb(196 204 213 / 27%);
2630
--modal-header-bg-color: var(--primary-color);
2731
}
2832

2933
// Dark theme for users who prefer dark mode
3034
@media (prefers-color-scheme: dark) {
3135
:root {
36+
--yellow: #ffa700;
37+
--blue: #0057e7;
38+
--white: #fff;
39+
--gray: #888;
3240
--primary-color: #4f5b66;
3341
--secondary-color: #1c2025;
3442
--secondary-color-lighten-20: #{color.adjust(#1c2025, $lightness:20%)};

0 commit comments

Comments
 (0)