Commit graph

409 commits

Author SHA1 Message Date
3a1e91cc4f
scope user text child-add cypress selectors
the seeded text already has nested nodes, so 'li.first()'
matched multiple buttons. scope the selectors to top-level
li children to match the working pattern in adminText.cy.js.
2026-05-02 21:58:34 +03:00
c065e065e9
fix admin texts route shadow conflict
FastRoute rejected /api/texts/all because the previously
declared variable route /api/texts/{textId} would shadow it,
crashing the app on boot. move the admin all-texts endpoint
to /api/admin/texts to clear the conflict; admin texts.js
follows the new URL.
2026-05-02 21:54:43 +03:00
71e5fb8fda
add cypress coverage for user text pages
loginAsSecondUser helper backs new specs that cover the
/texts list (own-only scoping, create form, link to
/texts/{id}) and /texts/{id} detail (own access, 403 on
another user's text, owner can add a child node).
2026-05-02 21:47:20 +03:00
6d11f7e887
add user texts and text detail pages
new /texts page lets a user manage their own texts (list +
create form linking to /texts/{id}); /texts/{id} reuses
text.js for the node tree, with a back link to /texts. home
gains a 'My texts' link in the header. the admin texts page
now sources its cross-user list from /api/texts/all.
2026-05-02 21:46:41 +03:00
7473af4163
enforce text ownership on node endpoints
getNodesOfText, createNode, and bulkCreateNodes now require
the session user, look up the target text, and respond 403
unless the user owns the text or is an admin. paves the way
for moving these endpoints out of the admin-only group.
2026-05-02 21:45:47 +03:00
e56cb56ce7
test node controller ownership checks
add failing tests asserting 403 when a non-owner tries to
read or write nodes on another user's text, plus admin
bypass. existing tests now attach a session user to mirror
the new controller signature.
2026-05-02 21:45:15 +03:00
051e44033f
wire user texts routes and update seed
open POST /api/texts and node create endpoints to any
authenticated user; expose new /texts and /texts/{id} pages
plus admin-only GET /api/texts/all. ViewController gains
userTexts and userText methods. seed gives Tanach to the
regular user and adds a second non-admin user.
2026-05-02 21:43:48 +03:00
acdf703d80
scope text endpoints by ownership
TextRepository gains findByUser; JsonTextRepository and the
fake implement filtering by stored userId. TextController
splits the list endpoint into getMyTexts (own) and
getAllTexts (admin), and getText now requires the session
user, returning 403 to non-owners while admins bypass.
2026-05-02 21:42:51 +03:00
ea6d65a77d
test text controller scoping and ownership
add failing tests for getMyTexts (own-only), getAllTexts
(admin), getText 403 for non-owner, and admin bypass on
getText. existing test_get_one_text updated to pass the
session user via the new request signature.
2026-05-02 21:41:52 +03:00
cbbbc80326
update downstream tests for text user requirement
Text now requires a User on construction. seed a user in
each test setUp that creates a Text directly or through the
fake repository so the suite remains green.
2026-05-02 21:27:55 +03:00
40fdf25da2
add tests for text user relationship
cover that the created Text carries the supplied User, that
the controller persists the user from the session attribute,
and that any userId in the request body is ignored.
2026-05-02 21:27:49 +03:00
6668240126
update fake text repository for user
include the user when rebuilding Text instances in find and
getAll, preserving the rule that lookup methods return new
instances rather than stored references.
2026-05-02 21:27:45 +03:00
4635fef3c7
persist user id in json text repository
store userId in the json record and rehydrate the User via
UserRepository. throws DomainException if the referenced user
no longer exists.
2026-05-02 21:27:40 +03:00
bac8323806
extract user from session in text controller
prevent payload from spoofing ownership by reading the user
from the request attribute set by auth middleware. respond 401
when unauthenticated.
2026-05-02 21:27:36 +03:00
bf006220e8
pass user object to create text use case
drop UserRepository dependency; controller now passes the
authenticated User directly via CreateTextRequest, eliminating
a redundant repository lookup.
2026-05-02 21:27:32 +03:00
ffef0ddff6
add user property to text entity 2026-05-02 21:27:28 +03:00
dfa0bc6c00
Merge branch 'add-form-ux' 2026-05-02 20:48:14 +03:00
a1bfe4f7c1
close other add forms when opening a new one
introduce closeAllAddForms which strips every add-child and
bulk-add input/button from the tree, and call it at the start of
toggleAddForm and toggleBulkAddForm (after the same-li toggle-off
short-circuit, so clicking the same trigger still closes its own
form). enforces a single open add form across the whole tree.
2026-05-01 11:58:12 +03:00
d61d68571d
test only one add form open at a time
assert that opening any add-child or bulk-add form closes any
other open add form across the tree. currently fails: each toggle
function only checks for an open form on its own li.
2026-05-01 11:56:44 +03:00
bd14bfd7a1
submit bulk add form on enter key
extract the save-bulk handler into a submit closure shared by the
save button click and a keydown listener on both the title and
count inputs. focus the title input as soon as the form opens.
2026-05-01 11:55:43 +03:00
ff8ec9a2ab
test enter submits bulk add form
assert that pressing enter from either the bulk-title or
bulk-count input submits the bulk add form. currently fails:
only the save-bulk button click triggers the post.
2026-05-01 11:54:53 +03:00
3928fef213
submit add child form on enter key
extract the save-child handler into a submit closure shared by
the save button click and a keydown listener on the input. also
focus the input as soon as the form opens so the user can type
and hit enter without touching the mouse.
2026-05-01 11:53:54 +03:00
74705379cb
test enter submits add child form
assert that pressing enter while typing in the add-child input
submits the form. currently fails: only the save-child button
click triggers the post.
2026-05-01 11:53:06 +03:00
838c31293e
Merge branch 'preserve-tree-expansion' 2026-05-01 11:48:49 +03:00
1342a67cf3
preserve expanded state across node re-render
introduce a module-level expandedNodeIds set that tracks which
nodes the user has manually expanded. renderTree consults the set
when deciding initial visibility (falling back to the depth-based
default for a fresh load), the toggle click handler keeps the set
in sync, and both add-child save handlers add the parent's id
before triggering the re-fetch. on a fresh load the set starts
empty so root-only-open behavior is unchanged and the existing
toggle tests keep passing.
2026-05-01 11:45:55 +03:00
dce4e4a4f6
test child add keeps parent expanded
assert that a non-root parent that the user expanded stays expanded
after adding a child. currently fails: fetchAndRenderNodes wipes
and rebuilds the tree with depth-based default visibility, so any
manually expanded non-root collapses on every save.
2026-05-01 11:44:24 +03:00
a9a7461aad
Merge branch 'style-foundation' 2026-05-01 11:37:46 +03:00
9979178fd5
style forbidden page with auth-card layout
reuse the centered auth-card shell for the 403 page so the error
state matches the visual language of the rest of the app, with a
primary back-to-home action.
2026-05-01 11:33:49 +03:00
8d38a092d8
style register page with auth-card layout
apply the shared auth-shell + auth-card layout to the register
template, mirroring the login page. ids and the #register-error
element are preserved for the existing cypress auth tests.
2026-05-01 11:33:37 +03:00
a20d12177e
style login page with auth-card layout
introduce .auth-shell and .auth-card classes for the centered,
narrow-card layout shared by login and register, then apply them
to the login template. form ids and the #login-error element are
preserved so the existing cypress auth flows still target them.
2026-05-01 11:33:24 +03:00
e51378b8c7
style admin landing page with shell and card nav
wrap the admin page in the shared header (with the logout button)
and present the texts entry-point as a card-link in a list-cards
list. the #texts and #logout id hooks used by cypress are
preserved.
2026-05-01 11:33:05 +03:00
59ec2e19e8
style admin text detail page with node tree
apply the page shell to the text detail page and add a scoped
.node-tree style block to app.css. the tree dom rendered by text.js
must keep ul/li with buttons and inputs as direct children of each
li (cypress relies on > selectors), so styling is applied entirely
via descendant selectors without wrapping the rendered nodes.
2026-05-01 11:32:49 +03:00
5be645f4e5
style admin texts page with card list and form
apply the page shell to the admin texts page and present each
existing text as a card-link plus the new-text form as a card with
a primary submit button. ids (#texts-list, #newTextName, #submit,
#back) and the name attribute on the input are preserved so the
existing cypress flows continue to work.
2026-05-01 11:32:21 +03:00
2349e69c4f
style today page with shell and card list
wrap the today page in the shared header + container/stack shell,
render scheduled nodes as cards via list-cards, and add a muted
empty-state message that toggles when no nodes are scheduled.
existing #scheduled-nodes-list and li selectors used by cypress
tests are preserved (the empty message lives in its own element).
2026-05-01 11:31:55 +03:00
807458ebe8
style home page with shell and card list
apply the new design system to the home page: wrap content in a
container/stack shell with a site-header for the logout and today
links, render the texts list as a vertical stack of cards via the
list-cards primitive, and dress the create plan modal with the new
modal/btn classes. js renders each text as an li.card with the
create-plan button preserved so existing cypress hooks (li,
.create-plan, .plan-name, .save-plan, .cancel-plan, ids) keep
matching.
2026-05-01 11:25:45 +03:00
b259a1243e
add layout primitives and components to app.css
extend app.css with the every-layout style primitives (container,
stack, cluster, center) used to compose page shells, plus a small
component layer: site-header, btn (primary/secondary/danger), card
and card-link, list-cards, modal, error and a few utility classes.
no template changes here - templates start adopting these classes
in the per-page styling commits that follow.
2026-05-01 11:24:58 +03:00
d4a8adc4a4
link app.css and add viewport meta in templates
add a stylesheet link and the standard responsive viewport meta tag
to every page template. purely additive - no markup or selector
changes - so existing cypress assertions and page js id hooks remain
intact. with this commit every page picks up the base styling from
app.css.
2026-05-01 11:24:30 +03:00
34da76607f
add app.css with reset and design tokens
introduce a single shared stylesheet under public/css. this first
section covers a minimal reset, warm/readable design tokens (color,
typography, spacing, radii, shadows), and base element styling for
headings, links, lists, forms, and buttons. layout primitives and
component classes follow in subsequent commits.
2026-05-01 11:23:41 +03:00
d885319597
remove wrong caveman plugin 2026-05-01 11:19:49 +03:00
8d46a4158e
fix caveman json file 2026-05-01 11:14:09 +03:00
cd2f688372
remove unused import 2026-05-01 10:58:23 +03:00
38d72ba1a8
Merge branch 'today-scheduled-nodes-page' 2026-05-01 10:54:51 +03:00
7091eefd4a
add caveman ai plugin config 2026-05-01 10:52:56 +03:00
ed4440eec2
test scheduled node controller returns 404 when user missing 2026-05-01 10:25:24 +03:00
f315db6d00
wrap get todays schedule in try catch 2026-05-01 10:25:00 +03:00
659f9b88f1
test scheduled node controller surfaces date error from use case 2026-05-01 10:24:43 +03:00
2eafe67f31
test scope schedule to requesting user 2026-05-01 10:19:03 +03:00
3711840669
test exclude future scheduled nodes 2026-05-01 10:18:47 +03:00
54e33f9b03
test empty schedule returns empty array 2026-05-01 10:18:32 +03:00
c0f35c88b7
throw on missing user in get todays schedule 2026-05-01 10:18:19 +03:00