Skip to content

Commit 2160e86

Browse files
Better visual separation with card layout on setup page (#28)
1 parent 3cc493e commit 2160e86

3 files changed

Lines changed: 84 additions & 56 deletions

File tree

static/styles.css

Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -691,20 +691,32 @@ pre {
691691
padding: 40px 20px;
692692
}
693693

694-
/* Style for the main sections */
694+
/* Style for the main sections — card appearance */
695695
.setupSection {
696696
display: flex;
697697
flex-direction: column;
698-
align-items: center; /* Center direct children */
698+
align-items: center;
699699
gap: 20px;
700700
width: 100%;
701+
background: #fafafa;
702+
border: 1px solid #e2e2e2;
703+
border-radius: 12px;
704+
padding: 24px;
705+
}
706+
707+
.setupSection h3 {
708+
width: 100%;
709+
text-align: left;
710+
padding-bottom: 12px;
711+
border-bottom: 1px solid #e2e2e2;
712+
margin: 0;
701713
}
702714

703715
/* Style for forms within setup sections */
704716
.setupSection form {
705717
display: flex;
706718
flex-direction: column;
707-
align-items: flex-start; /* Changed from center to flex-start */
719+
align-items: flex-start;
708720
gap: 20px;
709721
width: 100%;
710722
}
@@ -713,17 +725,33 @@ pre {
713725
.setupSection form > div {
714726
display: flex;
715727
flex-direction: column;
716-
align-items: flex-start; /* Align labels to the left */
717-
gap: 10px; /* Vertical gap between labels */
718-
width: 100%; /* Changed from auto to 100% */
719-
margin-bottom: 1rem; /* Restore some margin below the group */
728+
align-items: flex-start;
729+
gap: 10px;
730+
width: 100%;
731+
}
732+
733+
/* Fieldset groups within setup cards */
734+
.setupFieldset {
735+
border: none;
736+
padding: 0;
737+
margin: 0;
738+
width: 100%;
739+
display: flex;
740+
flex-direction: column;
741+
gap: 10px;
742+
}
743+
744+
.setupFieldset legend {
745+
font-weight: 600;
746+
font-size: 1em;
747+
margin-bottom: 4px;
720748
}
721749

722750
/* Style labels containing checkboxes */
723-
.setupSection label { /* Target labels more generally within setup sections */
751+
.setupSection label {
724752
display: flex;
725-
align-items: center; /* Align checkbox and text vertically */
726-
gap: 0.5rem; /* Space between checkbox and text */
753+
align-items: center;
754+
gap: 0.5rem;
727755
cursor: pointer;
728756
}
729757

templates/components/file-viewer.html

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<!-- file-viewer.html -->
2-
<h3>Upload Files</h3>
3-
<form id="upload-form"
4-
hx-post="{{ url_for('upload_file') }}"
5-
hx-target="#file-list-container"
2+
<h3>File Management</h3>
3+
<form id="upload-form"
4+
hx-post="{{ url_for('upload_file') }}"
5+
hx-target="#file-list-container"
66
hx-swap="outerHTML"
77
hx-indicator="#upload-indicator"
88
enctype="multipart/form-data">
@@ -14,16 +14,15 @@ <h3>Upload Files</h3>
1414
</div>
1515
</form>
1616

17-
<h3>Existing Files</h3>
18-
<div id="file-list-container"
19-
hx-get="{{ url_for('list_files') }}"
20-
hx-trigger="load"
17+
<div id="file-list-container"
18+
hx-get="{{ url_for('list_files') }}"
19+
hx-trigger="load"
2120
hx-swap="outerHTML">
2221
<p>Loading files...</p>
2322
</div>
24-
<button
23+
<button
2524
class="button"
26-
hx-get="{{ url_for('list_files') }}"
25+
hx-get="{{ url_for('list_files') }}"
2726
hx-target="#file-list-container"
2827
hx-swap="outerHTML"
2928
hx-indicator="#list-indicator">

templates/setup.html

Lines changed: 37 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ <h3>Setup Required</h3>
3434
</form>
3535
</div>
3636
{% else %}
37+
{# ── Model & Instructions ── #}
3738
<div class="setupSection">
38-
<h3>Save App Configuration</h3>
39-
39+
<h3>Model &amp; Instructions</h3>
4040
<form action="{{ url_for('save_app_config') }}" method="POST">
4141
<div>
4242
<label for="model-select">Select Model:</label>
@@ -47,37 +47,30 @@ <h3>Save App Configuration</h3>
4747
{% endfor %}
4848
{% else %}
4949
<option value="" disabled>Could not load models</option>
50-
{# Optionally include a default fallback if loading fails #}
5150
{% if current_model %}
5251
<option value="{{ current_model }}" selected>{{ current_model }} (current)</option>
5352
{% else %}
54-
<option value="gpt-4o" selected>gpt-4o (default)</option> {# Default fallback #}
53+
<option value="gpt-4o" selected>gpt-4o (default)</option>
5554
{% endif %}
5655
{% endif %}
5756
</select>
5857
</div>
59-
60-
<div style="margin-top: 15px;">
58+
59+
<div>
6160
<label for="instructions-input">System Prompt:</label>
62-
<textarea
63-
name="instructions"
64-
id="instructions-input"
65-
class="input"
66-
rows="4"
61+
<textarea
62+
name="instructions"
63+
id="instructions-input"
64+
class="input"
65+
rows="4"
6766
placeholder="e.g., You are a helpful assistant."
6867
style="width: 100%; resize: none;"
6968
>{% if current_instructions %}{{ current_instructions }}{% else %}You are a helpful assistant.{% endif %}</textarea>
7069
</div>
7170

72-
<div style="margin-top: 15px;">
73-
<label>
74-
<input type="checkbox" name="show_tool_call_detail" value="true" {% if current_show_tool_call_detail %}checked{% endif %}>
75-
Show tool call detail in responses
76-
</label>
77-
</div>
78-
79-
<p class="setupMessage" style="margin-top: 15px;">Select tools for your assistant:</p>
80-
<div>
71+
{# ── Tools ── #}
72+
<fieldset class="setupFieldset">
73+
<legend>Tools</legend>
8174
<label>
8275
<input type="checkbox" name="tool_types" value="code_interpreter" {% if "code_interpreter" in current_tools %}checked{% endif %}>
8376
Code Interpreter
@@ -94,29 +87,38 @@ <h3>Save App Configuration</h3>
9487
<input type="checkbox" name="tool_types" value="mcp" {% if "mcp" in current_tools %}checked{% endif %}>
9588
MCP Tools
9689
</label>
97-
</div>
90+
</fieldset>
91+
92+
{# ── Display ── #}
93+
<fieldset class="setupFieldset">
94+
<legend>Display</legend>
95+
<label>
96+
<input type="checkbox" name="show_tool_call_detail" value="true" {% if current_show_tool_call_detail %}checked{% endif %}>
97+
Show tool call detail in responses
98+
</label>
99+
</fieldset>
100+
98101
<div class="centered-button-container">
99-
<button
100-
type="submit"
101-
class="button"
102-
>
103-
Save Configuration
104-
</button>
102+
<button type="submit" class="button">Save Configuration</button>
105103
</div>
106104
</form>
107105
</div>
106+
107+
{# ── File Management ── #}
108108
{% if "file_search" in current_tools %}
109-
<div class="setupSection" style="margin-top: 20px;">
110-
{% include 'components/file-viewer.html' %}
109+
<div class="setupSection">
110+
{% include 'components/file-viewer.html' %}
111111
</div>
112112
{% endif %}
113+
114+
{# ── Custom Functions & MCP Servers ── #}
113115
{% if "function" in current_tools or "mcp" in current_tools %}
114116
<form action="{{ url_for('save_app_config') }}" method="POST" id="tool-config-form">
115117
<input type="hidden" name="action" value="regenerate_registry">
116118
{% endif %}
117119
{% if "function" in current_tools %}
118-
<div class="setupSection" style="margin-top: 20px;">
119-
<h3>Register Custom Functions</h3>
120+
<div class="setupSection">
121+
<h3>Custom Functions</h3>
120122
<p class="setupMessage">Provide function entries to include in <code>tool.config.json</code>. Use module import path for functions and a template path relative to the <code>templates/</code> directory (e.g., <code>components/weather-widget.html</code>). If you paste a path beginning with <code>templates/</code>, it will be normalized automatically.</p>
121123

122124
<div id="registry-rows" style="align-self: flex-start;">
@@ -134,15 +136,14 @@ <h3>Register Custom Functions</h3>
134136
{% endif %}
135137
</div>
136138

137-
<div style="display:flex; gap: 10px; align-self: flex-start;"">
139+
<div style="align-self: flex-start;">
138140
<button type="button" class="button" hx-get="{{ url_for('new_registry_row') }}" hx-target="#registry-rows" hx-swap="beforeend" hx-include="#registry-rows input[name='reg_function_names'], #registry-rows input[name='reg_import_paths'], #registry-rows input[name='reg_template_paths']">Add Function</button>
139141
</div>
140142
</div>
141-
142143
{% endif %}
143144
{% if "mcp" in current_tools %}
144-
<div class="setupSection" style="margin-top: 20px;">
145-
<h3>Register MCP Servers</h3>
145+
<div class="setupSection">
146+
<h3>MCP Servers</h3>
146147
<p class="setupMessage">Add MCP servers to include in <code>tool.config.json</code>. Provide a label and either a server URL or a connector ID.</p>
147148

148149
<div id="mcp-rows" style="align-self: flex-start;">
@@ -164,7 +165,7 @@ <h3>Register MCP Servers</h3>
164165
{% endif %}
165166
</div>
166167

167-
<div style="display:flex; gap: 10px; align-self: flex-start;">
168+
<div style="align-self: flex-start;">
168169
<button type="button" class="button" hx-get="{{ url_for('new_mcp_row') }}" hx-target="#mcp-rows" hx-swap="beforeend" hx-include="#mcp-rows input[name='mcp_labels'], #mcp-rows input[name='mcp_server_urls'], #mcp-rows input[name='mcp_connector_ids'], #mcp-rows input[name='mcp_authorizations'], #mcp-rows textarea[name='mcp_headers_jsons'], #mcp-rows input[name='mcp_require_approvals']">Add MCP Server</button>
169170
</div>
170171
</div>

0 commit comments

Comments
 (0)