Skip to content

Feat 275 placeholder options#276

Open
mohammadsherif0 wants to merge 13 commits into
project-1-ai-standardizationfrom
feat-275-placeholder_options
Open

Feat 275 placeholder options#276
mohammadsherif0 wants to merge 13 commits into
project-1-ai-standardizationfrom
feat-275-placeholder_options

Conversation

@mohammadsherif0

Copy link
Copy Markdown
Collaborator

Description

Type 8 prompt templates support optional per-token options, starting with Character limit on pdfText. Authors configure options in the template sidebar before insert; limits apply at resolution time (resolver and AI hook path), not on text written in the editor.

New User Features

  • Optional Character limit on pdfText before insert (e.g. ~pdfText[1]{characterLimit:5000}~); omit for full retrieved text.
  • Clearer type-8 placeholder descriptions, help tooltips, and preview examples.

New Dev Features

  • placeholderOptions JSONB column on placeholder (seeded for type-8 pdfText with characterLimit).
  • Shared placeholder-tokens module now supports options in token syntax: parse, format, validate, and pass them through when replacing tokens.
  • When a prompt is resolved, each pdfText token is truncated only if that token has a valid characterLimit option; tokens without it keep the full retrieved text.

Improvements

  • Removed global cap on stored ~pdfText~ base value so per-token limits control truncation.
  • Type-8 sidebar validates token options; warns when an option row is incomplete but still inserts the placeholder.

Bug Fixes

  • Template editor preview now updates correctly when placeholder examples load from the server.

Known Limitations

  • Phase 1 per-token options apply to characterLimit on pdfText only. Other placeholders have no option support yet.
  • editorText and submissionFiles still use the global 2000-character cap: unchanged in Phase 1; no per-token limit option for those yet.
  • New option types or placeholders require a DB seed/migration plus resolver and sidebar wiring.

Future Steps

  • Extend placeholderOptions and resolver handling to other placeholders and additional option types beyond character limit.

#275
#248

@mohammadsherif0
mohammadsherif0 force-pushed the feat-275-placeholder_options branch from 41151d1 to 7cfbb2f Compare July 22, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant