Skip to content

Commit fa219cb

Browse files
LarsEckartAmp
andcommitted
Improve web chat UI and update documentation
- Style user messages to fit content width and align to right - Fix contradictory hot-reload information in docs with proper Spring Boot devtools explanation - Update README to reflect working web UI (removing incomplete status) Co-authored-by: Amp <amp@sourcegraph.com>
1 parent 2f3a305 commit fa219cb

File tree

5 files changed

+32
-23
lines changed

5 files changed

+32
-23
lines changed

Agent.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@
1111
## Development Server
1212
- **Start dev server**: `./dev-server.sh start` (web mode with hot reloading)
1313
- **Stop dev server**: `./dev-server.sh stop`
14+
- **Restart dev server**: `./dev-server.sh restart` (needed for static file changes)
1415
- **Check status**: `./dev-server.sh status`
1516
- **View logs**: `./dev-server.sh logs`
1617

18+
**Note**: Hot reloading works for Java code changes. Static files (HTML, CSS, JS) in `src/main/resources/static/` require being "built" (copied to classpath) to trigger live reload - when running from command line with Gradle, this typically requires a server restart to see changes.
19+
1720
## Code Style Guidelines
1821
- **Package**: Use `com.larseckart` root package
1922
- **Imports**: Group imports (standard library, third-party, then local), alphabetically within groups

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,12 @@ For development with hot reloading, use the provided development script:
3636

3737
The development server includes:
3838
- **Automatic restart** when Java classes change
39-
- **Live reload** for static resources and templates
39+
- **Live reload** for static resources and templates (after build)
4040
- **Development configuration** with disabled caching
4141
- **Background process management** with PID tracking
4242

43+
**Note**: Hot reloading works for Java code changes. Static files (HTML, CSS, JS) in `src/main/resources/static/` require being "built" (copied to classpath) to trigger live reload - when running from command line with Gradle, this typically requires a server restart to see changes.
44+
4345
## Architecture Overview
4446

4547
This is a Java-based conversational AI agent that communicates with the Anthropic Claude API. The application follows a hexagonal architecture with clear separation between business logic and I/O adapters.

README.md

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ This application demonstrates clean architecture principles and provides both CL
88
### Project Statistics
99

1010
- **Total Commits**: 55
11-
- **AI-Assisted Commits**: 35 (63.64%)
12-
- **Total Lines Added**: 7240
13-
- **AI-Assisted Lines Added**: 5549 (76.64%)
14-
- **Total Lines Changed**: 10785
15-
- **AI-Assisted Lines Changed**: 8338 (77.31%)
11+
- **AI-Assisted Commits**: 36 (65.45%)
12+
- **Total Lines Added**: 7258
13+
- **AI-Assisted Lines Added**: 5588 (76.99%)
14+
- **Total Lines Changed**: 10821
15+
- **AI-Assisted Lines Changed**: 8418 (77.79%)
1616

1717
### Breakdown by AI Assistant
1818

@@ -21,21 +21,21 @@ This application demonstrates clean architecture principles and provides both CL
2121
- **Commits**: 30 (54.55%)
2222
- **Lines Added**: 4941
2323
- **Lines Deleted**: 2307
24-
- **Lines Changed**: 7248 (67.20%)
24+
- **Lines Changed**: 7248 (66.98%)
2525

2626
#### Amp
2727

2828
- **Commits**: 4 (7.27%)
2929
- **Lines Added**: 576
3030
- **Lines Deleted**: 449
31-
- **Lines Changed**: 1025 (9.50%)
31+
- **Lines Changed**: 1025 (9.47%)
3232

3333
#### GitHub Copilot
3434

35-
- **Commits**: 1 (1.82%)
36-
- **Lines Added**: 32
37-
- **Lines Deleted**: 33
38-
- **Lines Changed**: 65 (0.60%)
35+
- **Commits**: 2 (3.64%)
36+
- **Lines Added**: 71
37+
- **Lines Deleted**: 74
38+
- **Lines Changed**: 145 (1.34%)
3939

4040

4141
*Statistics are automatically updated on each commit.*
@@ -99,11 +99,7 @@ To automatically update AI contribution statistics in the README:
9999
./gradlew run -Dapp.mode=web
100100
```
101101

102-
Then open http://localhost:8080 in your browser.
103-
104-
> **Note**: The web UI implementation is currently incomplete.
105-
> While the Spring Boot dependencies and REST controller are in place, there are no Thymeleaf templates or proper web interface beyond a basic HTML file.
106-
> The full web functionality was previously built and then reverted. The web mode architecture is kept as an exercise for AI-assisted development and future implementation.
102+
Then open http://localhost:8080 in your browser to access the chat interface.
107103

108104
## Development
109105

@@ -159,7 +155,7 @@ This application follows hexagonal architecture principles:
159155
### Adapters
160156

161157
- **CLI Adapters**: Console-based I/O using Scanner and System.out
162-
- **Web Adapters**: Spring Boot REST API
158+
- **Web Adapters**: Spring Boot REST API with HTML chat interface
163159

164160
### Built-in Tools
165161

@@ -215,7 +211,7 @@ Claude: [Reads and displays file contents]
215211
### Web Mode
216212
1. Start: `./gradlew run -Dapp.mode=web`
217213
2. Open: http://localhost:8080
218-
3. Chat through the web interface (currently incomplete - see note above)
214+
3. Chat through the web interface
219215
220216
## Dependencies
221217

app/src/main/java/com/larseckart/core/tools/ListFilesTool.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import java.nio.file.Path;
1010
import java.nio.file.Paths;
1111
import java.util.Comparator;
12-
import java.util.stream.Collectors;
1312
import java.util.stream.Stream;
1413
import org.slf4j.Logger;
1514

app/src/main/resources/static/index.html

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,25 @@
3131
margin-bottom: 15px;
3232
padding: 10px;
3333
border-radius: 5px;
34+
display: block;
35+
clear: both;
3436
}
3537
.user-message {
3638
background-color: #007bff;
3739
color: white;
38-
text-align: right;
40+
max-width: 70%;
41+
float: right;
42+
margin-left: auto;
43+
margin-right: 0;
44+
word-wrap: break-word;
3945
}
4046
.claude-message {
4147
background-color: #28a745;
4248
color: white;
49+
max-width: 70%;
50+
float: left;
51+
margin-right: auto;
52+
margin-left: 0;
4353
}
4454
.input-container {
4555
display: flex;
@@ -134,7 +144,6 @@ <h1>Chat with Claude</h1>
134144
});
135145

136146
messageInput.focus();
137-
addMessage('Chat with Claude (web interface)', false);
138147
</script>
139148
</body>
140-
</html>
149+
</html>

0 commit comments

Comments
 (0)