Skip to content

Commit 43ed061

Browse files
authored
[Playground] playground page layout (#291)
1 parent 6aef2d5 commit 43ed061

File tree

6 files changed

+68
-27
lines changed

6 files changed

+68
-27
lines changed

src/AzureOpenAIProxy.PlaygroundApp/Components/App.razor

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<meta charset="utf-8" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<base href="/" />
8-
<link rel="stylesheet" href="bootstrap/bootstrap.min.css" />
8+
@* <link rel="stylesheet" href="bootstrap/bootstrap.min.css" /> *@
9+
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
910
<link rel="stylesheet" href="app.css" />
1011
<link rel="stylesheet" href="AzureOpenAIProxy.PlaygroundApp.styles.css" />
11-
<link href="_content/Microsoft.FluentUI.AspNetCore.Components/css/reboot.css" rel="stylesheet" />
1212
<link rel="icon" type="image/png" href="favicon.png" />
1313
<HeadOutlet />
1414
</head>

src/AzureOpenAIProxy.PlaygroundApp/Components/Layout/MainLayout.razor.css

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,23 @@ main {
2727
text-decoration: none;
2828
}
2929

30-
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31-
text-decoration: underline;
32-
}
30+
.top-row ::deep a:hover, .top-row ::deep .btn-link:hover {
31+
text-decoration: underline;
32+
}
3333

34-
.top-row ::deep a:first-child {
35-
overflow: hidden;
36-
text-overflow: ellipsis;
37-
}
34+
.top-row ::deep a:first-child {
35+
overflow: hidden;
36+
text-overflow: ellipsis;
37+
}
3838

3939
@media (max-width: 640.98px) {
4040
.top-row {
4141
justify-content: space-between;
4242
}
4343

44-
.top-row ::deep a, .top-row ::deep .btn-link {
45-
margin-left: 0;
46-
}
44+
.top-row ::deep a, .top-row ::deep .btn-link {
45+
margin-left: 0;
46+
}
4747
}
4848

4949
@media (min-width: 641px) {
@@ -64,11 +64,11 @@ main {
6464
z-index: 1;
6565
}
6666

67-
.top-row.auth ::deep a:first-child {
68-
flex: 1;
69-
text-align: right;
70-
width: 0;
71-
}
67+
.top-row.auth ::deep a:first-child {
68+
flex: 1;
69+
text-align: right;
70+
width: 0;
71+
}
7272

7373
.top-row, article {
7474
padding-left: 2rem !important;

src/AzureOpenAIProxy.PlaygroundApp/Components/Layout/NavMenu.razor.css

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.navbar-toggler {
1+
/*.navbar-toggler {
22
appearance: none;
33
cursor: pointer;
44
width: 3.5rem;
@@ -94,12 +94,12 @@
9494
display: none;
9595
}
9696
97-
.nav-scrollable {
98-
/* Never collapse the sidebar for wide screens */
99-
display: block;
97+
.nav-scrollable {*/
98+
/* Never collapse the sidebar for wide screens */
99+
/*display: block;*/
100100

101-
/* Allow sidebar to scroll for tall menus */
102-
height: calc(100vh - 3.5rem);
101+
/* Allow sidebar to scroll for tall menus */
102+
/*height: calc(100vh - 3.5rem);
103103
overflow-y: auto;
104104
}
105-
}
105+
}*/
Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
@page "/playground"
2+
@rendermode InteractiveServer
23

34
<PageTitle>Playground Page</PageTitle>
45

5-
<h1>playground page!</h1>
6+
<FluentLayout>
7+
<FluentHeader Style="padding-top: 5px;"><h1>Azure OpenAI Proxy Playground</h1></FluentHeader>
68

7-
<ConfigTabComponent @rendermode="InteractiveServer"/>
9+
<FluentGrid Spacing="3" AdaptiveRendering="true" Justify="JustifyContent.FlexStart">
10+
<FluentGridItem Class="config-grid" xs="12" sm="12" md="4" lg="4" xl="4" xxl="4">
11+
<ConfigTabComponent @rendermode="InteractiveServer"/>
12+
</FluentGridItem>
13+
14+
<FluentGridItem Class="chat-grid" xs="12" sm="12" md="8" lg="8" xl="8" xxl="8">
15+
Chat Window
16+
</FluentGridItem>
17+
</FluentGrid>
18+
</FluentLayout>

src/AzureOpenAIProxy.PlaygroundApp/wwwroot/app.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ a, .btn-link {
1313
}
1414

1515
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
16-
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
16+
box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
1717
}
1818

1919
.content {

test/AzureOpenAIProxy.PlaygroundApp.Tests/Pages/PlaygroundPageTests.cs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
using FluentAssertions;
2+
13
using Microsoft.Playwright;
24
using Microsoft.Playwright.NUnit;
35

@@ -17,6 +19,34 @@ public async Task SetUp()
1719
await Page.WaitForLoadStateAsync(LoadState.NetworkIdle);
1820
}
1921

22+
[Test]
23+
public async Task Given_Page_When_Endpoint_Invoked_Then_It_Should_Show_Header()
24+
{
25+
// Arrange
26+
var header = Page.Locator("div.layout")
27+
.Locator("header.header")
28+
.Locator("div.header-gutters")
29+
.Locator("h1");
30+
31+
// Act
32+
var headerText = await header.TextContentAsync();
33+
34+
// Assert
35+
headerText.Should().Be("Azure OpenAI Proxy Playground");
36+
}
37+
38+
[Test]
39+
[TestCase("config-grid")]
40+
[TestCase("chat-grid")]
41+
public async Task Given_Page_When_Endpoint_Invoked_Then_It_Should_Show_Panels(string id)
42+
{
43+
// Act
44+
var panel = Page.Locator($"div.{id}");
45+
46+
// Assert
47+
await Expect(panel).ToBeVisibleAsync();
48+
}
49+
2050
[Test]
2151
public async Task Given_ConfigTab_When_Endpoint_Invoked_Then_ConfigTab_Should_Be_Displayed()
2252
{

0 commit comments

Comments
 (0)