59 Commits

Author SHA1 Message Date
Jeremy Daer 723c8180b4 Add JSON response format for full SDK/CLI coverage (#2675)
* Add JSON response format to void-response controller actions

Add respond_to blocks with JSON format to 14 controllers that
previously only rendered HTML or Turbo Stream responses. JSON
callers get head :no_content (or :created/:ok for push
subscriptions, distinguishing new vs existing).

Covers: board involvements, board/account entropies, column
reordering, card readings, card publishing, user roles, user
avatars, account settings, notification settings, join codes
(with 422 error branch), and push subscriptions.

* Add steps index endpoint with JSON view

Add index action to Cards::StepsController so SDK/CLI callers
can list all steps for a card. Reuses the existing _step.json
partial.

* Add JSON views for paginated card list endpoints

Add show.json.jbuilder for stream, not-now, and closed column
endpoints. No controller changes needed — set_page_and_extract_
portion_from and fresh_when already work format-agnostically.

* Add JSON search endpoint with distinct-card pagination

JSON search paginates distinct Card records (via the existing
Card.mentioning scope with .distinct) rather than Search::Record
objects. This ensures page boundaries, Link headers, and counts
reflect unique cards — no short pages from post-pagination dedup.

ID-match searches return a uniform single-element Card[] array
through the same pagination path.

* Add JSON views for settings and configuration endpoints

Add show.json.jbuilder for account settings (name), join codes
(code, usage_count, usage_limit, url, active), and notification
settings (bundle_email_frequency). Tests for show and update
were added in the void-response commit.

* Add JSON response format to data exports

Create returns 201 with export id, status, and created_at so
callers can poll. Show returns any-status exports for JSON (not
just completed) with a download_url when ready, or 404 for
missing/other-user exports.

* Extend access token JSON API

Add index.json and _access_token.json partial for listing tokens.
Add JSON format to destroy. Include id and created_at in the
create response alongside the existing token/description/permission
fields.

* Fix ambiguous precedence warning in export JSON view

* Assert X-Total-Count pagination header in streams JSON test

* Address review feedback

- Guard steps index against HTML requests (redirect to card)
- Normalize created_at to UTC in access token and export JSON
- Add deterministic ordering (.latest) to search JSON pagination

* Return 406 for HTML requests to steps index instead of redirect

* Add wrap_parameters for flat SDK JSON payload compatibility

Five controllers infer the wrong wrapper key from their class
name, so flat JSON bodies like {"role":"admin"} fail with 400.
Add explicit wrap_parameters declarations:

- Users::RolesController → :user
- Notifications::SettingsController → :user_settings
- Account::JoinCodesController → :account_join_code
- Account::SettingsController → :account
- Boards::EntropiesController → :board

Add integration tests that send flat (unwrapped) JSON payloads
for all seven param-bearing endpoints to prove SDK compatibility.

* Address PR review feedback

- Use 201 Created (not 204) for all create actions: publishes, readings,
  left/right positions, push subscriptions
- Simplify push subscription to always return :created (no 200/201 variance)
- Remove superfluous respond_to block from steps#index
- Merge exports#show into single respond_to block
- Move export download_url conditional out of inline args
- Ensure join code active is explicitly boolean
- Remove extra parens from search controller assignment
- Add blank lines between format blocks for readability

* Return JSON bodies on create actions

Create actions for boards, cards, columns, comments, and steps now
render the resource as JSON (via their show views) instead of returning
empty 201 responses with only a Location header. SDKs expect a JSON
body they can deserialize into the created resource.

* Return JSON bodies on reaction create actions

Card and comment reaction creates now render the reaction as JSON
instead of returning empty 201 responses, consistent with the other
resource-creating endpoints.

* Allow access tokens API without account scope

Access tokens are identity-level (not account-scoped), so the
controller needs to work with bearer token auth and no account slug
in the URL. Skip require_account so the bearer token auth path
can proceed.

Also fix involvement test to send params in JSON body (not query
string) to match real SDK usage.
2026-03-09 11:39:49 -07:00
Adrien Maston 57249fb9b7 Target results frame and advance action 2026-03-04 10:29:07 +01:00
Adrien Maston 8fced550d8 Refactor 2026-03-03 10:31:08 +01:00
Adrien Maston 340d9aa763 Delegate clearing the input to new controller 2026-03-02 14:21:32 +01:00
Adrien Maston f2fb05cecf Replace unless by if 2026-02-19 14:09:48 +01:00
Adrien Maston 97f2f677d6 Don't render empty state instead of hiding it 2026-02-19 14:04:14 +01:00
Adrien Maston 0e1feb0f3f Create @query in controller instead of testing for blank? 2026-02-19 12:06:49 +01:00
Adrien Maston 5c0508d91c Don't show "no match" when not searching anything yet 2026-02-18 18:19:37 +01:00
Adrien Maston 3b97b2e5c8 Merge branch 'main' into mobile/bridge-components
* main: (22 commits)
  Disable card column buttons when active
  Prevent comment content from overlapping with reaction button
  Delete pins belonging to cards in a board with revoked access
  Update development dependencies in SAAS lockfile
  Update runtime dependencies
  Update development dependencies
  Balance magic link instructions
  Add `.txt-balance` utility
  Move handleDesktop inside restoreColumnsDisablingTransitions
  Adjust border radius
  Clean up blank slates
  Add dialog manager to events page
  More sturated mini bubbles in light mode
  Brighten mini bubbles in dark mode
  Use separate cache namespaces for each beta instance
  Bump boost size up a tick on mobile
  Move Undo form inside closure message element
  Phrasing tweak for exceeding storage limit
  Keep strong tags words on same line
  Allow ActionText embed reuse and safe purge (#2346)
  ...
2026-01-14 10:34:13 +01:00
Denis Švara 4f7cec3b71 Rename bride page controller to title controller and remove text size related code. 2026-01-13 09:36:24 +01:00
Andy Smith 64fdbf6b8f Clean up blank slates 2026-01-12 15:37:06 -06:00
Denis Švara ecf0921af9 Add bridge page targets. 2026-01-06 16:03:28 +01:00
Adrien Maston 573ffe0ee4 Add titles to pins and search permas 2025-12-19 15:44:36 +01:00
Adrien Maston 5d6f3f5156 Allow search perma's form to target the whole page
... to pick up the url change and <head> update
2025-12-18 10:13:55 +01:00
Adrien Maston b040424e2f Make search perma mobile friendly 2025-12-17 12:50:36 +01:00
Alexander Zaytsev 78b62e692e Apply blank slate styles to .search__empty 2025-12-10 20:26:44 +01:00
Mike Dalessio 642506e79e Add datetime to the search results
I find it helpful (especially when going through a long list of
results) to know how far back in time I'm looking.

A note on the timestamp being used: it's the search index
timestamp. Using the card or comment `updated_at` is fraught because
we do so much touching of records (e.g., comment is touched when a
reaction is added; card is touched when a comment is added). Let's
display the search record's `created_at`, which is the ordering used
for the overall results.
2025-12-08 11:58:54 -05:00
Jason Zimdars b45554966f Lose the second close button 2025-11-24 17:48:21 -06:00
Andy Smith 250935530f Better focus and clearing when searching 2025-11-21 14:32:10 -06:00
Mike Dalessio 99fe5ff934 Make sure that comments show up in search properly
when the search term appears in both the comment and the card description
2025-11-19 18:02:36 -05:00
Donal McBreen 28efe28f24 Replace Search::Index with Search::Records
Lean on ActiveRecord models for searching and strip out the raw SQL.
Replaces the search_index_* tables with sharded search_records_* tables
as that allows us to use a Search::Record model name.

A Class is dynamically created for each record table shard so that we
and we can access it via the Search::Record.for_account(account_id)
method.
2025-11-17 09:12:40 -05:00
Donal McBreen 7fef6ca9b9 Use the card number in the results view 2025-11-17 09:12:36 -05:00
Jorge Manrubia 39ec6cf062 Replace collection with board in the code, tests green 2025-11-05 13:41:12 +01:00
Jorge Manrubia 03a345609e Baseline replacing collection with board across code 2025-11-05 13:31:54 +01:00
Jason Zimdars 7d154b682e Rename 'BOXCAR' to 'Fizzy'
Missed files
2025-11-03 16:30:44 -06:00
Jorge Manrubia b76ff27b96 Keep the last search in place
https://app.box-car.com/5986089/cards/2703
2025-11-03 09:25:46 +01:00
David Heinemeier Hansson 9f7a97eeea Always use camel case for turbo frames 2025-10-30 17:16:03 +01:00
Jason Zimdars 9f59dd7bdb Reset bar after clicking a result
Fixes that search input was still filled even though the dialog was
gone: https://box-car.com/5986089/cards/2513
2025-10-29 15:35:33 -05:00
Andy Smith b2a83f1625 Add Basecamp-style boosts 2025-10-27 16:59:57 -05:00
Andy Smith 6b0fc35627 Revert "Reactions" 2025-10-27 16:16:57 -05:00
Andy Smith a742ed65ff Use new icons 2025-10-27 14:10:47 -05:00
Jason Zimdars f5384baf63 Boxcar -> BOXCAR 2025-10-23 15:05:36 -07:00
Jason Zimdars 49e87310d7 Rename Fizzy, Boxcar 2025-10-22 13:42:41 -07:00
Jorge Manrubia 4e6866bd2e Add pagination to searches 2025-10-07 08:49:05 +02:00
Jorge Manrubia 1b6b82a6cc Redirect to cards when searching by card id 2025-09-30 13:52:27 +02:00
Andy Smith 8954aeb88e Add reset button for search 2025-09-19 14:23:08 -05:00
Stanko Krtalić 0e2c7f7d4d Escape HTML everywhere where html_safe is used (#1114)
* Escape HTML everywhere where html_safe is used
* Mark search results as HTML safe at the attribute
2025-09-16 11:52:15 +02:00
Jason Zimdars 3c2581a98f Copy 2025-08-25 10:26:44 -05:00
Jason Zimdars 2384ce5d94 Simplify search results 2025-08-22 07:33:26 +02:00
Jason Zimdars 0aa18f4d3a Center thinking indicator, make input size/position consistent 2025-08-22 07:33:26 +02:00
Jason Zimdars b2ac817d5b Use a more reliable transition method, adjust input styles 2025-08-22 07:33:26 +02:00
Jason Zimdars 517f7d946f Adjust conversation transcript, improve input entry effect 2025-08-22 07:33:26 +02:00
Stanko K.R. 56152c77f3 Focus the input field when Fizzy bar gets triggered 2025-08-22 07:33:26 +02:00
Stanko K.R. 8b21b5a570 Fix search 2025-08-22 07:33:26 +02:00
Stanko K.R. ed2aab78c6 Fiz Fizzy Ask 2025-08-22 07:33:26 +02:00
Stanko K.R. 59a488eb9c Render inputs inline & results in a turbo frame 2025-08-22 07:33:26 +02:00
Jason Zimdars a2af8360e1 WIP
Move the inputs for search and ask into the bar, output in the modals.
Simplify search.
2025-08-22 07:33:26 +02:00
Stanko K.R. a580a0ddbf Fix navigation bugs 2025-08-22 07:33:26 +02:00
Stanko K.R. 50562bff0b Add close button to search 2025-08-22 07:33:00 +02:00
Stanko K.R. 9a6fc1f54a Create bar controller 2025-08-22 07:33:00 +02:00