Commit graph

34 commits

Author SHA1 Message Date
b5040fff14
handle forbidden and not found errors on text page 2026-05-03 16:36:57 +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
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
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
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
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
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
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
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
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
bfacb5b62c
add today view route and template 2026-04-26 21:24:35 +03:00
c649dbbcc2
include credentials on fetch calls 2026-04-24 13:30:54 +03:00
8c52294b10
remove hardcoded user id from home 2026-04-24 13:29:49 +03:00
cb697daa03
add auth javascript 2026-04-24 13:29:38 +03:00
f836a09d02
submit create plan via fetch 2026-04-24 10:28:04 +03:00
e7d30d364a
add cancel handler for modal 2026-04-24 10:23:37 +03:00
389e125cef
open modal on create plan click 2026-04-24 10:21:53 +03:00
39539313c9
add create plan buttons to texts list 2026-04-24 10:20:48 +03:00
1c2ca21f44
add home javascript 2026-04-23 10:01:56 +03:00
12fd5a88b6
add toggle children button to nodes 2026-04-20 09:35:53 +03:00
189493b045
php cs fixer 2026-04-19 23:07:48 +03:00
9ed42654a3
add js for bulk creating nodes 2026-04-18 23:06:04 +03:00
3ce6a91e6e
add and save button functionality 2026-04-18 22:07:38 +03:00
f277ae7983
move fetch nodes by text id into its own function
re renders if theres a root list of nodes existing
2026-04-18 22:06:25 +03:00
f5a8b8447f
rename route for nodes and adjust calls to route 2026-04-18 21:01:02 +03:00
49140195f1
add parsing functions for nodes of text to create indented tree 2026-04-17 17:52:32 +03:00
68da48aedd
add view for single text 2026-04-17 09:23:38 +03:00
3689945cfe
make texts into a tags 2026-04-15 21:48:32 +03:00
4c919d2205
Add texts.js for AJAX load and form submission 2026-04-15 20:47:07 +03:00
c2ad749b84
run the app from public index file 2026-03-22 10:04:14 +02:00