-
Notifications
You must be signed in to change notification settings - Fork 95
Reorganize Settings sections + add LLM model/prompt configs #116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
75de40a
f859340
064061a
5d75ae7
4bbdd6d
dceaeb7
4c4f324
28c9705
b4cd839
5338f9e
e45413f
a2e4a17
f40963a
f0dce4c
8ed367d
de8d78a
022d81b
419eeba
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| class Settings::AiPromptsController < ApplicationController | ||
| layout "settings" | ||
|
|
||
| def show | ||
| @breadcrumbs = [ | ||
| [ "Home", root_path ], | ||
| [ "AI Prompts", nil ] | ||
| ] | ||
| @family = Current.family | ||
| @assistant_config = Assistant.config_for(OpenStruct.new(user: Current.user)) | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| class Settings::GuidesController < ApplicationController | ||
| layout "settings" | ||
|
|
||
| def show | ||
| @breadcrumbs = [ | ||
| [ "Home", root_path ], | ||
| [ "Guides", nil ] | ||
| ] | ||
| markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, | ||
| autolink: true, | ||
| tables: true, | ||
| fenced_code_blocks: true, | ||
| strikethrough: true, | ||
| superscript: true | ||
| ) | ||
| @guide_content = markdown.render(File.read(Rails.root.join("docs/onboarding/guide.md"))) | ||
| end | ||
| end |
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For the order, i think it would be better to have:
This order look a lot more like some other settings, with the "User related" settings in first Also the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. so also maybe changing the object like: SETTINGS_ORDER = [
"GENERAL" : [
{ name: "Profile Info", path: :settings_profile_path },
{ name: "Preferences", path: :settings_preferences_path },
{ name: "Accounts", path: :accounts_path },
{ name: "Bank Sync", path: :settings_bank_sync_path },
{ name: "Security", path: :settings_security_path },
],
"TRANSACTIONS" : [
{ name: "Billing", path: :settings_billing_path, condition: :not_self_hosted? },
{ name: "Categories", path: :categories_path },
{ name: "Tags", path: :tags_path },
{ name: "Rules", path: :rules_path },
{ name: "Merchants", path: :family_merchants_path },
],
"ADVANCED" : [
{ name: "AI Prompts", path: :settings_ai_prompts_path },
{ name: "API Key", path: :settings_api_key_path },
{ name: "Self-Hosting", path: :settings_hosting_path, condition: :self_hosted? },
{ name: "Imports", path: :imports_path },
{ name: "SimpleFin", path: :simplefin_items_path },
],
"MORE" : [
{ name: "Guides", path: :settings_guides_path },
{ name: "What's new", path: :changelog_path },
{ name: "Feedback", path: :feedback_path }
]
] |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,17 +1,25 @@ | ||
| module SettingsHelper | ||
| SETTINGS_ORDER = [ | ||
| { name: "Account", path: :settings_profile_path }, | ||
| # General section | ||
| { name: "Accounts", path: :accounts_path }, | ||
| { name: "Bank Sync", path: :settings_bank_sync_path }, | ||
| { name: "Preferences", path: :settings_preferences_path }, | ||
| { name: "Profile Info", path: :settings_profile_path }, | ||
| { name: "Security", path: :settings_security_path }, | ||
| { name: "Self-Hosting", path: :settings_hosting_path, condition: :self_hosted? }, | ||
| { name: "API Key", path: :settings_api_key_path }, | ||
| { name: "Billing", path: :settings_billing_path, condition: :not_self_hosted? }, | ||
| { name: "Accounts", path: :accounts_path }, | ||
| { name: "Imports", path: :imports_path }, | ||
| { name: "Tags", path: :tags_path }, | ||
| # Transactions section | ||
| { name: "Categories", path: :categories_path }, | ||
| { name: "Tags", path: :tags_path }, | ||
| { name: "Rules", path: :rules_path }, | ||
| { name: "Merchants", path: :family_merchants_path }, | ||
| # Advanced section | ||
| { name: "AI Prompts", path: :settings_ai_prompts_path }, | ||
| { name: "API Key", path: :settings_api_key_path }, | ||
| { name: "Self-Hosting", path: :settings_hosting_path, condition: :self_hosted? }, | ||
| { name: "Imports", path: :imports_path }, | ||
| { name: "SimpleFin", path: :simplefin_items_path }, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why having a
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The plan is for this to go away indeed, once #104 goes in we can take of it (just wanted to avoid the merge conflict!) |
||
| # More section | ||
| { name: "Guides", path: :settings_guides_path }, | ||
| { name: "What's new", path: :changelog_path }, | ||
| { name: "Feedback", path: :feedback_path } | ||
| ] | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| <%= content_for :page_title, "AI Prompts" %> | ||
|
|
||
| <div class="bg-container rounded-xl shadow-border-xs p-4"> | ||
| <div class="rounded-xl bg-container-inset space-y-1 p-1"> | ||
| <div class="flex items-center gap-1.5 px-4 py-2 text-xs font-medium text-secondary"> | ||
| <p>OpenAI</p> | ||
| </div> | ||
|
|
||
| <div class="bg-container rounded-lg shadow-border-xs"> | ||
| <div class="space-y-4 p-4"> | ||
| <!-- Auto-Categorization Section --> | ||
| <div class="space-y-3"> | ||
| <div class="flex items-center gap-3"> | ||
| <div class="w-9 h-9 rounded-full bg-gray-25 flex justify-center items-center"> | ||
| <%= icon "brain" %> | ||
| </div> | ||
| <div> | ||
| <p class="text-sm font-medium text-primary">Transaction Categorizer</p> | ||
| <p class="text-xs text-secondary">AI automatically categorizes your transactions based on your defined categories</p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="pl-12 space-y-2"> | ||
| <label class="text-xs font-medium text-primary uppercase">Instructions</label> | ||
| <div class="px-3 py-2 bg-surface-default border border-primary rounded-lg"> | ||
| <pre class="whitespace-pre-wrap text-xs font-mono text-primary"><%= @assistant_config[:auto_categorizer]&.instructions || Provider::Openai::AutoCategorizer.new(nil).instructions %></pre> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="border-t border-primary"></div> | ||
|
|
||
| <!-- Merchant Detection Section --> | ||
| <div class="space-y-3"> | ||
| <div class="flex items-center gap-3"> | ||
| <div class="w-9 h-9 rounded-full bg-gray-25 flex justify-center items-center"> | ||
| <%= icon "store" %> | ||
| </div> | ||
| <div> | ||
| <p class="text-sm font-medium text-primary">Merchant Detector</p> | ||
| <p class="text-xs text-secondary">AI identifies and enriches transaction data with merchant information</p> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="pl-12 space-y-2"> | ||
| <label class="text-xs font-medium text-primary uppercase">Instructions</label> | ||
| <div class="px-3 py-2 bg-surface-default border border-primary rounded-lg"> | ||
| <pre class="whitespace-pre-wrap text-xs font-mono text-primary"><%= @assistant_config[:auto_merchant]&.instructions || Provider::Openai::AutoMerchantDetector.new(nil, model: "", transactions: [], user_merchants: []).instructions %></pre> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> | ||
| </div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing require for OpenStruct may raise NameError in production
OpenStruct is in Ruby’s stdlib but not auto-required. Without
require "ostruct", constants may be unavailable depending on boot order.Apply this diff:
+require "ostruct" class Settings::AiPromptsController < ApplicationController layout "settings"Alternatively (no stdlib dependency):
📝 Committable suggestion
🤖 Prompt for AI Agents