feat: selected-text quote display with .env-driven configuration - #1
Merged
Conversation
quiet-node
force-pushed
the
feature/selected-text-quote
branch
from
March 31, 2026 19:15
79904dc to
0d4ce2d
Compare
- Add `quotedText?: string` to the `Message` interface - Separate display content from the Ollama prompt in `ask()` so the raw `Context: "..."` preamble no longer appears in the chat bubble - Render a left-bordered italic quote block above the user's message text in `ChatBubble` when `quotedText` is present - Clear `selectedContext` after the first submit so the quote is not re-injected into follow-up messages Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Add formatQuotedText() utility to intelligently format quotes - Preserve line breaks from multi-line selections (instead of collapsing to single line) - Cap display at 4 lines or 300 characters total - Add "..." truncation indicator when limits are exceeded - Use white-space: pre-wrap to maintain formatting in UI - Apply to both AskBar preview and chat bubble quote Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
- Update useOllama tests for new ask(displayContent, ollamaPrompt, quotedText?) signature - Add tests for quotedText storage and separate ollamaPrompt forwarding - Update AskBarView test for whitespace-pre-wrap (replaces line-clamp-2) - Add ChatBubble tests for quote block rendering with quotedText prop - Add formatQuotedText() unit tests covering truncation, line limits, edge cases - All 121 tests pass with 100% coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
- Create .env with VITE_QUOTE_MAX_DISPLAY_LINES, VITE_QUOTE_MAX_DISPLAY_CHARS, and VITE_QUOTE_MAX_CONTEXT_LENGTH (defaults: 4, 300, 4096) - Add src/config.ts with envInt() helper that reads Vite env vars with type-safe fallback defaults for invalid/missing values - Type env vars in vite-env.d.ts via ImportMetaEnv interface - Update AskBarView, ChatBubble, and App to consume config values - Remove hardcoded MAX_CONTEXT_LENGTH from App.tsx - Add config tests covering env overrides and edge cases (empty, NaN, negative, zero, decimal, Infinity) - 133 tests passing, 100% coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
- Add .env to .gitignore and remove tracked .env from git - Create .env.example as the committed reference template - Create docs/configurations.md with full configuration reference table, validation rules, and Vite file precedence - Update README.md Getting Started with environment setup step Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
- Fix JSDoc formatting regression in useOllama.ts (restore standard /** * */ style) - Update docs/configurations.md to reference correct path src/config/index.ts - Add early return for empty string in formatQuotedText() for explicit intent - Add test for empty string edge case Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
force-pushed
the
feature/selected-text-quote
branch
from
March 31, 2026 20:30
defbe29 to
1b7a0f4
Compare
This was referenced Apr 5, 2026
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
* feat: display selected text as a quote block in chat bubbles - Add `quotedText?: string` to the `Message` interface - Separate display content from the Ollama prompt in `ask()` so the raw `Context: "..."` preamble no longer appears in the chat bubble - Render a left-bordered italic quote block above the user's message text in `ChatBubble` when `quotedText` is present - Clear `selectedContext` after the first submit so the quote is not re-injected into follow-up messages Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * improve: preserve line breaks in quoted text display - Add formatQuotedText() utility to intelligently format quotes - Preserve line breaks from multi-line selections (instead of collapsing to single line) - Cap display at 4 lines or 300 characters total - Add "..." truncation indicator when limits are exceeded - Use white-space: pre-wrap to maintain formatting in UI - Apply to both AskBar preview and chat bubble quote Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com> * test: update existing tests and add coverage for quote features - Update useOllama tests for new ask(displayContent, ollamaPrompt, quotedText?) signature - Add tests for quotedText storage and separate ollamaPrompt forwarding - Update AskBarView test for whitespace-pre-wrap (replaces line-clamp-2) - Add ChatBubble tests for quote block rendering with quotedText prop - Add formatQuotedText() unit tests covering truncation, line limits, edge cases - All 121 tests pass with 100% coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * feat: add .env-driven configuration for quote display limits - Create .env with VITE_QUOTE_MAX_DISPLAY_LINES, VITE_QUOTE_MAX_DISPLAY_CHARS, and VITE_QUOTE_MAX_CONTEXT_LENGTH (defaults: 4, 300, 4096) - Add src/config.ts with envInt() helper that reads Vite env vars with type-safe fallback defaults for invalid/missing values - Type env vars in vite-env.d.ts via ImportMetaEnv interface - Update AskBarView, ChatBubble, and App to consume config values - Remove hardcoded MAX_CONTEXT_LENGTH from App.tsx - Add config tests covering env overrides and edge cases (empty, NaN, negative, zero, decimal, Infinity) - 133 tests passing, 100% coverage Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: add .env.example, gitignore .env, add configuration docs - Add .env to .gitignore and remove tracked .env from git - Create .env.example as the committed reference template - Create docs/configurations.md with full configuration reference table, validation rules, and Vite file precedence - Update README.md Getting Started with environment setup step Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * refactor: move config.ts into src/config/ directory Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: address code review findings - Fix JSDoc formatting regression in useOllama.ts (restore standard /** * */ style) - Update docs/configurations.md to reference correct path src/config/index.ts - Add early return for empty string in formatQuotedText() for explicit intent - Add test for empty string edge case Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: formatted code Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * docs: enforce 100% test coverage requirement in CLAUDE.md Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
added a commit
that referenced
this pull request
Apr 10, 2026
* feat: display selected text as a quote block in chat bubbles - Add `quotedText?: string` to the `Message` interface - Separate display content from the Ollama prompt in `ask()` so the raw `Context: "..."` preamble no longer appears in the chat bubble - Render a left-bordered italic quote block above the user's message text in `ChatBubble` when `quotedText` is present - Clear `selectedContext` after the first submit so the quote is not re-injected into follow-up messages * improve: preserve line breaks in quoted text display - Add formatQuotedText() utility to intelligently format quotes - Preserve line breaks from multi-line selections (instead of collapsing to single line) - Cap display at 4 lines or 300 characters total - Add "..." truncation indicator when limits are exceeded - Use white-space: pre-wrap to maintain formatting in UI - Apply to both AskBar preview and chat bubble quote * test: update existing tests and add coverage for quote features - Update useOllama tests for new ask(displayContent, ollamaPrompt, quotedText?) signature - Add tests for quotedText storage and separate ollamaPrompt forwarding - Update AskBarView test for whitespace-pre-wrap (replaces line-clamp-2) - Add ChatBubble tests for quote block rendering with quotedText prop - Add formatQuotedText() unit tests covering truncation, line limits, edge cases - All 121 tests pass with 100% coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * feat: add .env-driven configuration for quote display limits - Create .env with VITE_QUOTE_MAX_DISPLAY_LINES, VITE_QUOTE_MAX_DISPLAY_CHARS, and VITE_QUOTE_MAX_CONTEXT_LENGTH (defaults: 4, 300, 4096) - Add src/config.ts with envInt() helper that reads Vite env vars with type-safe fallback defaults for invalid/missing values - Type env vars in vite-env.d.ts via ImportMetaEnv interface - Update AskBarView, ChatBubble, and App to consume config values - Remove hardcoded MAX_CONTEXT_LENGTH from App.tsx - Add config tests covering env overrides and edge cases (empty, NaN, negative, zero, decimal, Infinity) - 133 tests passing, 100% coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: add .env.example, gitignore .env, add configuration docs - Add .env to .gitignore and remove tracked .env from git - Create .env.example as the committed reference template - Create docs/configurations.md with full configuration reference table, validation rules, and Vite file precedence - Update README.md Getting Started with environment setup step Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * refactor: move config.ts into src/config/ directory Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: address code review findings - Fix JSDoc formatting regression in useOllama.ts (restore standard /** * */ style) - Update docs/configurations.md to reference correct path src/config/index.ts - Add early return for empty string in formatQuotedText() for explicit intent - Add test for empty string edge case Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: formatted code Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * docs: enforce 100% test coverage requirement in CLAUDE.md Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
quiet-node
added a commit
that referenced
this pull request
Apr 11, 2026
* feat: display selected text as a quote block in chat bubbles - Add `quotedText?: string` to the `Message` interface - Separate display content from the Ollama prompt in `ask()` so the raw `Context: "..."` preamble no longer appears in the chat bubble - Render a left-bordered italic quote block above the user's message text in `ChatBubble` when `quotedText` is present - Clear `selectedContext` after the first submit so the quote is not re-injected into follow-up messages * improve: preserve line breaks in quoted text display - Add formatQuotedText() utility to intelligently format quotes - Preserve line breaks from multi-line selections (instead of collapsing to single line) - Cap display at 4 lines or 300 characters total - Add "..." truncation indicator when limits are exceeded - Use white-space: pre-wrap to maintain formatting in UI - Apply to both AskBar preview and chat bubble quote * test: update existing tests and add coverage for quote features - Update useOllama tests for new ask(displayContent, ollamaPrompt, quotedText?) signature - Add tests for quotedText storage and separate ollamaPrompt forwarding - Update AskBarView test for whitespace-pre-wrap (replaces line-clamp-2) - Add ChatBubble tests for quote block rendering with quotedText prop - Add formatQuotedText() unit tests covering truncation, line limits, edge cases - All 121 tests pass with 100% coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * feat: add .env-driven configuration for quote display limits - Create .env with VITE_QUOTE_MAX_DISPLAY_LINES, VITE_QUOTE_MAX_DISPLAY_CHARS, and VITE_QUOTE_MAX_CONTEXT_LENGTH (defaults: 4, 300, 4096) - Add src/config.ts with envInt() helper that reads Vite env vars with type-safe fallback defaults for invalid/missing values - Type env vars in vite-env.d.ts via ImportMetaEnv interface - Update AskBarView, ChatBubble, and App to consume config values - Remove hardcoded MAX_CONTEXT_LENGTH from App.tsx - Add config tests covering env overrides and edge cases (empty, NaN, negative, zero, decimal, Infinity) - 133 tests passing, 100% coverage Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: add .env.example, gitignore .env, add configuration docs - Add .env to .gitignore and remove tracked .env from git - Create .env.example as the committed reference template - Create docs/configurations.md with full configuration reference table, validation rules, and Vite file precedence - Update README.md Getting Started with environment setup step Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * refactor: move config.ts into src/config/ directory Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * fix: address code review findings - Fix JSDoc formatting regression in useOllama.ts (restore standard /** * */ style) - Update docs/configurations.md to reference correct path src/config/index.ts - Add early return for empty string in formatQuotedText() for explicit intent - Add test for empty string edge case Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * chore: formatted code Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> * docs: enforce 100% test coverage requirement in CLAUDE.md Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com> --------- Signed-off-by: Logan Nguyen <lg.131.dev@gmail.com>
This was referenced Apr 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context: "..."preamble no longer appears in user chat bubblesformatQuotedTextutility: 4-line / 300-char cap).env-driven configuration via Vite's built-in env support (VITE_QUOTE_MAX_DISPLAY_LINES,VITE_QUOTE_MAX_DISPLAY_CHARS,VITE_QUOTE_MAX_CONTEXT_LENGTH) with validated fallback defaultsdocs/configurations.mdwith full reference table,.env.exampletemplate, and README setup stepTest Plan
Context:prefix is gone.env(e.g.,VITE_QUOTE_MAX_DISPLAY_LINES=2), restart dev server — limits applybun run test:coverage— 134 tests pass, 100% coverage🤖 Generated with Claude Code