<feed xmlns='http://www.w3.org/2005/Atom'>
<title>guess-market, branch master</title>
<subtitle>definitely not polymarket
</subtitle>
<id>https://git.sartin.in/guess-market/atom?h=master</id>
<link rel='self' href='https://git.sartin.in/guess-market/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/'/>
<updated>2026-10-15T16:36:15Z</updated>
<entry>
<title>ui-web: add browser client for the Ex4 bonus</title>
<updated>2026-10-15T16:36:15Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-15T16:35:48Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=c263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e'/>
<id>urn:sha1:c263497ec8b05bc0f9254ed2f7ecb4dba6f67d4e</id>
<content type='text'>

A React + TypeScript single-page client served by Vite, working against
the same servlets as the desktop client: login, the events screen with
filters, details, order books and trading, and the account screen with
deposit, holdings, ledger rows and the user directory. No file upload,
as the exercise specifies.

It looks like the desktop client on purpose: the three skins of
theme.css as CSS variables, the four animations redone with SVG and
keyframes, and the desktop's Nerd Fonts, which npm run dev copies from
ui-fx instead of keeping a second copy in the repo. The shared chat sits
in a drawer above the status bar, as on the desktop, on its own poll
because chat lines don't move the market version.

Vite forwards /guess-market to Tomcat on 8080, so the page and the API
share an origin and the session cookie needs no CORS. The client polls
/api/sync once a second and reloads only when the version moved.

run-web.bat installs the packages and starts it on localhost:5173.
package.sh stages the sources under build/dist/ex4, without
node_modules.

</content>
</entry>
<entry>
<title>ui: add chat drawer to the desktop client</title>
<updated>2026-10-15T12:18:55Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-15T12:18:30Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=c67d5ff663b876a15a3831f5a2b564c4002e99b6'/>
<id>urn:sha1:c67d5ff663b876a15a3831f5a2b564c4002e99b6</id>
<content type='text'>

ServerClient fetches new chat lines on the same one-second poll as the
market and hands them over separately from market changes.

The shared UI gets a chat icon in the status bar, beside the eject
button, shown only against a server. It opens a drawer above the status
bar with everyone's lines and a field to send one, laid over the
content so the window keeps its size. While the drawer is closed the
icon counts unread lines. A line the server refuses is reported in the
drawer itself.


</content>
</entry>
<entry>
<title>server: add a chat shared by everyone logged in</title>
<updated>2026-10-15T08:40:30Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-15T08:40:05Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=4563c9d6d6c1576b6fb45899c2b6d6073966d8b8'/>
<id>urn:sha1:4563c9d6d6c1576b6fb45899c2b6d6073966d8b8</id>
<content type='text'>

Ex3 bonus. POST /api/chat says a line as the logged-in user and
GET /api/chat?since=N returns the lines after id N, so a polling client
only ever downloads what it has not seen. The last 500 lines are kept
in memory.

A chat line does not change the market, so the lock filter does not
bump the market version for it; otherwise every line would make every
client refetch all events.

Also read form fields as UTF-8 in the filter rather than relying on
Tomcat's default, since names and chat text may not be ASCII.


</content>
</entry>
<entry>
<title>ui-fx: list the account's ledger entries on the Users tab</title>
<updated>2026-10-14T14:52:45Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-14T14:52:19Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=6968a0105ad521d7b86b15555f8f627094a59725'/>
<id>urn:sha1:6968a0105ad521d7b86b15555f8f627094a59725</id>
<content type='text'>

Ex3 asks that a user can see every row of their account as it changes,
one row per action. The entries already reach the client in LedgerDTO
but were only drawn as the balance chart.

Add an Account activity table under the trade panel: time, type,
details, amount and balance after, newest first.


</content>
</entry>
<entry>
<title>ui-fx: give labels without a colour class the ink colour</title>
<updated>2026-10-14T11:27:10Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-14T11:26:44Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=1de283bd86ac1367f4c2c91a0417859c91b676ce'/>
<id>urn:sha1:1de283bd86ac1367f4c2c91a0417859c91b676ce</id>
<content type='text'>

Some table cells (option and shares in the trade history, YES and NO in
the participation table) carry no colour class. JavaFX then derives the
text colour from -fx-background, which the transparent scroll panes set
to transparent, and on the light skins that came out white on white.

Set a default label colour, placed first so that every existing
single-class colour rule still overrides it.


</content>
</entry>
<entry>
<title>ui-client: test a whole event lifecycle across several clients</title>
<updated>2026-10-14T08:05:45Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-14T08:05:18Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=1a39fb21f05c3478058cd2443604aef25cb92bb8'/>
<id>urn:sha1:1a39fb21f05c3478058cd2443604aef25cb92bb8</id>
<content type='text'>

One user uploads and opens an event, four others deposit and buy at the
same time, and the first settles it. Check the payout, that the event's
contract ends empty and that the users' balances still add up to what
was deposited.


</content>
</entry>
<entry>
<title>tools: package the server as a WAR and the client as a directory</title>
<updated>2026-10-13T16:20:05Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-13T16:19:40Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2'/>
<id>urn:sha1:da4f3ceb1fc1f317a3cca788b6c9b78ffab12de2</id>
<content type='text'>

The Ex3 submission is exactly one WAR for Tomcat's webapps/ plus a
directory holding the client, its jars and its batch file.

package.sh now stages both under build/dist/ex3. The WAR is named
guess-market.war after the context path the client expects, and carries
the api and service jars with gson and JAXB; Tomcat only has to provide
the servlet API. The client directory holds ui-client, api, ui-fx,
gson, OkHttp and JavaFX, and nothing of the engine.

An executable's Class-Path used to name every module. List only the
modules it depends on, so the client jar no longer points at
service.jar, and stop producing a plain jar for the server module.

Add tomcat.sh to try the result by hand: it copies the packaged WAR
into a local Tomcat ($CATALINA_HOME, or the newest
C:\tomcat\apache-tomcat-*) and runs it in the foreground.


</content>
</entry>
<entry>
<title>ui-client: add login window</title>
<updated>2026-10-13T13:08:55Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-13T13:08:27Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=4edb27d378e8b79931ef6a6abebfda66f894d538'/>
<id>urn:sha1:4edb27d378e8b79931ef6a6abebfda66f894d538</id>
<content type='text'>

Ask for the server address and a user name before opening the market,
and show the server's reason when it refuses (name taken, unreachable).
The request runs off the JavaFX thread so a dead server cannot freeze
the window.

--server= and --user= now only prefill the form.


</content>
</entry>
<entry>
<title>ui-fx: support running as one logged-in user of a server</title>
<updated>2026-10-13T10:15:15Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-13T10:14:50Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=c0e134981cb494f12c72fbbd3e5c4de513327520'/>
<id>urn:sha1:c0e134981cb494f12c72fbbd3e5c4de513327520</id>
<content type='text'>

The shared UI assumed the whole market was local: it showed nothing
until a file was loaded, let the user act as anyone in the list and
offered to create events by hand. None of that holds for a client of a
shared server.

AppState and AppView now take an optional session user. When it is set:

- the tabs show from the start, since other users' events are there
  whether or not we loaded a file ourselves;
- the acting user is fixed, and the user list becomes a directory of
  the other users with their balance and role;
- the buttons that create events are hidden, and the Users tab gets a
  Deposit Funds button with a small dialog;
- loading a file skips the two-second pause Ex2 asked for.

Without a session user everything behaves as before.

Also keep the event's Trade and Close buttons from collapsing to an
ellipsis when the description is long.


</content>
</entry>
<entry>
<title>ui-client: add desktop client that talks to the server</title>
<updated>2026-10-13T07:42:40Z</updated>
<author>
<name>Kostya</name>
<email>mail@sartin.in</email>
</author>
<published>2026-10-13T07:42:15Z</published>
<link rel='alternate' type='text/html' href='https://git.sartin.in/guess-market/commit/?id=a8bc9dce528abb6340315f7daa61ad76be4a8739'/>
<id>urn:sha1:a8bc9dce528abb6340315f7daa61ad76be4a8739</id>
<content type='text'>

New module for the Ex3 desktop app. It reuses the ui-fx views and
depends on the api only, never on the engine.

ServerClient owns the OkHttp session and the last snapshot pulled from
/api/sync. RemoteCatalogContext, RemoteGuessMarketContext and
RemoteAccountContext implement the api interfaces on top of it: reads
are answered from the snapshot, so AppState never waits on the network,
and writes go over HTTP and pull a fresh snapshot before returning.

A daemon thread polls once a second with blocking calls and refreshes
AppState through Platform.runLater only when the server's version
moved. AppState reselects the event and user by id, so a refresh keeps
the selection.

Server and user name come from --server= and --user= until the login
screen exists.


</content>
</entry>
</feed>
